diff options
author | AlexSm <alex@ydb.tech> | 2024-01-18 11:28:56 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-18 11:28:56 +0100 |
commit | 9d0a3761b3201e0d9db879a7adf91876ebdb0564 (patch) | |
tree | 541d11ac878c18efd7ebca81e35112aa0fef995b /cmake/global_flags.compiler.gnu.march.cmake | |
parent | 404ef8886ecc9736bc58ade6da2fbd83b486a408 (diff) | |
download | ydb-9d0a3761b3201e0d9db879a7adf91876ebdb0564.tar.gz |
Library import 8 (#1074)
* Library import 8
* Add contrib/libs/cxxsupp/libcxx/include/__verbose_abort
Diffstat (limited to 'cmake/global_flags.compiler.gnu.march.cmake')
-rw-r--r-- | cmake/global_flags.compiler.gnu.march.cmake | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/cmake/global_flags.compiler.gnu.march.cmake b/cmake/global_flags.compiler.gnu.march.cmake new file mode 100644 index 0000000000..a81af88c70 --- /dev/null +++ b/cmake/global_flags.compiler.gnu.march.cmake @@ -0,0 +1,34 @@ + +set(_GNU_MARCH_C_CXX_FLAGS "") + +if (CMAKE_SYSTEM_PROCESSOR MATCHES "^(i686|x86_64|AMD64)$") + if (CMAKE_SYSTEM_PROCESSOR STREQUAL "i686") + string(APPEND _GNU_MARCH_C_CXX_FLAGS " -m32") + elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "^(x86_64|AMD64)$") + string(APPEND _GNU_MARCH_C_CXX_FLAGS " -m64") + endif() + string(APPEND _GNU_MARCH_C_CXX_FLAGS "\ + -msse2 \ + -msse3 \ + -mssse3 \ + ") + + if ((CMAKE_SYSTEM_PROCESSOR MATCHES "^(x86_64|AMD64)$") OR (NOT ANDROID)) + string(APPEND _GNU_MARCH_C_CXX_FLAGS "\ + -msse4.1 \ + -msse4.2 \ + -mpopcnt \ + ") + if (NOT ANDROID) + # older clang versions did not support this feature on Android: + # https://reviews.llvm.org/rGc32d307a49f5255602e7543e64e6c38a7f536abc + string(APPEND _GNU_MARCH_C_CXX_FLAGS " -mcx16") + endif() + endif() + + if (CMAKE_SYSTEM_NAME STREQUAL "Linux") + string(APPEND _GNU_MARCH_C_CXX_FLAGS " -D_YNDX_LIBUNWIND_ENABLE_EXCEPTION_BACKTRACE") + endif() +elseif (ANDROID AND (CMAKE_ANDROID_ARCH_ABI STREQUAL "armeabi-v7a")) + string(APPEND _GNU_MARCH_C_CXX_FLAGS " -mfloat-abi=softfp") +endif() |