Skip to content

Commit 83a1af6

Browse files
authored
Fix compilation using default options on Emscripten (#470)
* Fix compilation using default options on Emscripten By default, fcl compiles with the `FCL_USE_X64_SSE` option enabled, that compiles the library with SSE flags enabled. This creates problems in any compiler that do not targets x86 or x86_64 . While the problem can be easily solved by user by setting the FCL_USE_X64_SSE to OFF (as done for example in Debian packaging scripts, see https://salsa.debian.org/science-team/fcl/-/blob/61641fb7a12d19806c799503fc90fcd64b20c5ad/debian/rules#L10) it is nice to provide a working build out of the box.
1 parent 1b13d7b commit 83a1af6

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

CMakeLists.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,13 @@ else()
8686
endif()
8787

8888
# Whether to enable SSE
89+
if(CMAKE_SYSTEM_NAME STREQUAL "Emscripten")
90+
set(FCL_TARGET_SUPPORT_X64_SSE OFF)
91+
else()
92+
set(FCL_TARGET_SUPPORT_X64_SSE ON)
93+
endif()
8994
set(SSE_FLAGS "")
90-
option(FCL_USE_X64_SSE "Whether FCL should x64 SSE instructions" ON)
95+
option(FCL_USE_X64_SSE "Whether FCL should x64 SSE instructions" ${FCL_TARGET_SUPPORT_X64_SSE})
9196
if(FCL_USE_X64_SSE)
9297
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
9398
set(SSE_FLAGS -mfpmath=sse -msse -msse2 -msse3 -mssse3)

0 commit comments

Comments
 (0)