Skip to content

Commit 80130c7

Browse files
committed
Trying to fix Emscripten compile with recent Emscripten versions
1 parent 68352ae commit 80130c7

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/lib/third_party/numerics/CMakeLists.txt

+9-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,15 @@ if(WIN32)
99
# but I know no other option...)
1010
string(REGEX REPLACE "/W[0-4]" "/W0" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
1111
else()
12-
add_definitions(-w -fcommon)
12+
if(VORPALINE_PLATFORM STREQUAL "Emscripten-clang")
13+
# -fcommon is broken in latest clang
14+
add_definitions(-w)
15+
else()
16+
# -fcommon: merges uninitialized variables declarations (supposes that the
17+
# 'extern' keyword was missing, avoid duplicated symbols errors in legacy
18+
# code that was not properly declaring extern variables).
19+
add_definitions(-w -fcommon)
20+
endif()
1321
endif()
1422

1523
include_directories(${GEOGRAM_SOURCE_DIR}/src/lib/third_party/numerics/INCLUDE)

0 commit comments

Comments
 (0)