Skip to content

Commit

Permalink
that's better
Browse files Browse the repository at this point in the history
  • Loading branch information
TingDaoK committed Sep 4, 2024
1 parent 5114b54 commit c8dcb53
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions crt/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,8 @@ if(UNIX AND NOT APPLE)
string(TOLOWER "${CMAKE_SYSTEM_PROCESSOR}" CMAKE_SYSTEM_PROCESSOR_LOWER)
if(CMAKE_SYSTEM_PROCESSOR_LOWER MATCHES "x86_64|amd64|x86|i386|i686" AND CMAKE_SIZEOF_VOID_P EQUAL 4)
# Add -msse2 for x86-32bit because of https://github.com/aws/aws-lc/commit/6fe8dcbe96e580ea85233fdb98a142e42951b70b
# Be wary that CMAKE_SYSTEM_PROCESSOR may not correspond to the target architecture when cross-compiling.
# (E.g. on Windows, the host may be AMD64 even when using a MSVC cl compiler with a 32-bit target).
# The CMAKE_TOOLCHAIN_FILE is supposed to set it correctly, but may not have.
# CMAKE_SYSTEM_PROCESSOR is supposed to match the target architecture when cross-compiling,
# but this is not guaranteed. See: https://cmake.org/cmake/help/v3.30/variable/CMAKE_SYSTEM_PROCESSOR.html
# So, check for both CMAKE_SIZEOF_VOID_P and CMAKE_SYSTEM_PROCESSOR_LOWER for x86-32bit
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -msse2")
endif()
Expand Down

0 comments on commit c8dcb53

Please sign in to comment.