--- CMakeLists.txt.orig 2025-07-20 11:08:58 UTC +++ CMakeLists.txt @@ -19,7 +19,6 @@ function(check_macro_defined MACRO OUTPUT_VAR) SOURCE_FROM_CONTENT "check_${OUTPUT_VAR}.cc" "#ifndef ${MACRO}\n#error \"${MACRO} is missing\"\n#endif\n" - COMPILE_DEFINITIONS -march=native ) set("${OUTPUT_VAR}" "${result}" PARENT_SCOPE) message("${OUTPUT_VAR}: ${result}") @@ -46,25 +45,25 @@ function(add_native_code TARGET) cmake_dependent_option(ENABLE_BMI2 "Use BMI2 instructions" ON "ENABLE_NATIVE_CODE;HAVE_BMI2" OFF) function(add_native_code TARGET) if(ENABLE_NATIVE_CODE) - target_compile_options("${TARGET}" PRIVATE -march=native) +# target_compile_options("${TARGET}" PRIVATE -march=native) if(ENABLE_BMI2) - target_compile_options("${TARGET}" PRIVATE -DMARISA_USE_BMI2 -mbmi2 -msse4) + target_compile_options("${TARGET}" PRIVATE -DMARISA_USE_BMI2) elseif(ENABLE_BMI) - target_compile_options("${TARGET}" PRIVATE -DMARISA_USE_BMI -mbmi -msse4) + target_compile_options("${TARGET}" PRIVATE -DMARISA_USE_BMI) elseif(ENABLE_SSE4A) - target_compile_options("${TARGET}" PRIVATE -DMARISA_USE_SSE4A -msse4a) + target_compile_options("${TARGET}" PRIVATE -DMARISA_USE_SSE4A) elseif(ENABLE_SSE4_2 AND ENABLE_POPCNT) - target_compile_options("${TARGET}" PRIVATE -DMARISA_USE_SSE4 -msse4) + target_compile_options("${TARGET}" PRIVATE -DMARISA_USE_SSE4) elseif(ENABLE_SSE4_2) - target_compile_options("${TARGET}" PRIVATE -DMARISA_USE_SSE4_2 -msse4.2) + target_compile_options("${TARGET}" PRIVATE -DMARISA_USE_SSE4_2) elseif(ENABLE_SSE4_1) - target_compile_options("${TARGET}" PRIVATE -DMARISA_USE_SSE4_1 -msse4.1) + target_compile_options("${TARGET}" PRIVATE -DMARISA_USE_SSE4_1) elseif(ENABLE_SSSE3) - target_compile_options("${TARGET}" PRIVATE -DMARISA_USE_SSSE3 -mssse3) + target_compile_options("${TARGET}" PRIVATE -DMARISA_USE_SSSE3) elseif(ENABLE_SSE3) - target_compile_options("${TARGET}" PRIVATE -DMARISA_USE_SSE3 -msse3) + target_compile_options("${TARGET}" PRIVATE -DMARISA_USE_SSE3) elseif(ENABLE_SSE2) - target_compile_options("${TARGET}" PRIVATE -DMARISA_USE_SSE2 -msse2) + target_compile_options("${TARGET}" PRIVATE -DMARISA_USE_SSE2) endif() endif() endfunction()