diff options
author | Riccardo Spagni <ric@spagni.net> | 2018-09-14 13:02:58 +0200 |
---|---|---|
committer | Riccardo Spagni <ric@spagni.net> | 2018-09-14 13:02:58 +0200 |
commit | 9f24e57dc225a26583571792caa0a948904ef21c (patch) | |
tree | 73d9603806fbabf485e128fb9b020758c4f3f30c /CMakeLists.txt | |
parent | Merge pull request #4380 (diff) | |
parent | NetBSD support (diff) | |
download | monero-9f24e57dc225a26583571792caa0a948904ef21c.tar.xz |
Merge pull request #4326
bcda7adc NetBSD support (thomasvaughan)
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 84e52d41a..5e47edcca 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -498,6 +498,17 @@ else() set(ARCH_FLAG "-march=armv8") else() set(ARCH_FLAG "-march=${ARCH}") + if(ARCH STREQUAL "native") + check_c_compiler_flag(-march=native CC_SUPPORTS_MARCH_NATIVE) + if (NOT CC_SUPPORTS_MARCH_NATIVE) + check_c_compiler_flag(-mtune=native CC_SUPPORTS_MTUNE_NATIVE) + if (CC_SUPPORTS_MTUNE_NATIVE) + set(ARCH_FLAG "-mtune=${ARCH}") + else() + set(ARCH_FLAG "") + endif() + endif() + endif() endif() set(WARNINGS "-Wall -Wextra -Wpointer-arith -Wundef -Wvla -Wwrite-strings -Wno-error=extra -Wno-error=deprecated-declarations -Wno-unused-parameter -Wno-unused-variable -Wno-error=unused-variable -Wno-error=undef -Wno-error=uninitialized") if(NOT MINGW) |