Skip to content

Commit

Permalink
Merge pull request #430 from saucecontrol/sse-fix
Browse files Browse the repository at this point in the history
Fix SSE detection logic
  • Loading branch information
farindk authored Nov 21, 2023
2 parents d7bd5d6 + a44ddd2 commit 9393983
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,17 @@ if(CMAKE_COMPILER_IS_GNUCXX OR ${CMAKE_CXX_COMPILER_ID} MATCHES Clang)
add_definitions(-Wall)
endif()

set(DISABLE_SSE ON)
check_c_source_compiles(
"#if !defined(__x86_64) && !defined(__i386__) \\
&& !defined(_M_IX86) && !defined(_M_AMD64)
#error not x86
#endif
int main(){return 0;}"
HAVE_X86)
set(DISABLE_SSE "Disable SSE optimizations" ${HAVE_X86})
"#if !defined(__x86_64) && !defined(__i386__) \
&& !defined(_M_IX86) && !defined(_M_AMD64)
#error not x86
#endif
int main(){return 0;}"
HAVE_X86)
if (HAVE_X86)
set(DISABLE_SSE OFF)
endif()

option(BUILD_SHARED_LIBS "Build shared library" ON)
if(NOT BUILD_SHARED_LIBS)
Expand Down

0 comments on commit 9393983

Please sign in to comment.