Skip to content

Commit 5ce88e8

Browse files
committed
cmake(libsql-ffi): don't use -msse4.2 -maes when compiling for ARM hosts
1 parent 28294c9 commit 5ce88e8

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

libsql-ffi/bundled/SQLite3MultipleCiphers/CMakeLists.txt

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ if (CMAKE_SYSTEM_NAME STREQUAL "Linux"
286286
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -msse4.2 -maes")
287287
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse4.2 -maes")
288288
endif()
289-
289+
290290
set(SQLITE3MC_LINK_LIBRARIES
291291
pthread
292292
dl
@@ -297,14 +297,18 @@ if (CMAKE_SYSTEM_NAME STREQUAL "Linux"
297297
endif()
298298
set(SHARED_LIB_EXPORT_DEFINITION "__attribute__((visibility(\"default\")))")
299299
else()
300-
if (CMAKE_C_COMPILER_ID STREQUAL "GNU")
300+
if (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND NOT (
301+
CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64" OR CMAKE_SYSTEM_PROCESSOR STREQUAL "arm64"
302+
))
301303
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -msse4.2 -maes")
302304
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse4.2 -maes")
303305
endif()
304306
set(SHARED_LIB_EXPORT_DEFINITION "__declspec(dllexport)")
305307
endif()
306308

307-
if (CMAKE_C_COMPILER_ID STREQUAL "Clang")
309+
if (CMAKE_C_COMPILER_ID STREQUAL "Clang" AND NOT (
310+
CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64" OR CMAKE_SYSTEM_PROCESSOR STREQUAL "arm64"
311+
))
308312
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -msse4.2 -maes -Wno-error=incompatible-function-pointer-types")
309313
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse4.2 -maes")
310314
endif()

0 commit comments

Comments
 (0)