aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2018-09-14 13:02:58 +0200
committerRiccardo Spagni <ric@spagni.net>2018-09-14 13:02:58 +0200
commit9f24e57dc225a26583571792caa0a948904ef21c (patch)
tree73d9603806fbabf485e128fb9b020758c4f3f30c /CMakeLists.txt
parentMerge pull request #4380 (diff)
parentNetBSD support (diff)
downloadmonero-9f24e57dc225a26583571792caa0a948904ef21c.tar.xz
Merge pull request #4326
bcda7adc NetBSD support (thomasvaughan)
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt11
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)