Skip to content

Commit

Permalink
Fix compilation using default options on Emscripten (#470)
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
traversaro authored May 17, 2020
1 parent 1b13d7b commit 83a1af6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,13 @@ else()
endif()

# Whether to enable SSE
if(CMAKE_SYSTEM_NAME STREQUAL "Emscripten")
set(FCL_TARGET_SUPPORT_X64_SSE OFF)
else()
set(FCL_TARGET_SUPPORT_X64_SSE ON)
endif()
set(SSE_FLAGS "")
option(FCL_USE_X64_SSE "Whether FCL should x64 SSE instructions" ON)
option(FCL_USE_X64_SSE "Whether FCL should x64 SSE instructions" ${FCL_TARGET_SUPPORT_X64_SSE})
if(FCL_USE_X64_SSE)
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
set(SSE_FLAGS -mfpmath=sse -msse -msse2 -msse3 -mssse3)
Expand Down

0 comments on commit 83a1af6

Please sign in to comment.