commit b8ae03a444d3c252c4c90cbe8ab73ed49cbf1657
parent 08f749917f65b1b8691870011602fc694e266f4f
Author: [email protected] <[email protected]>
Date: Tue, 19 Jul 2016 15:55:35 +0300
CMake: Set target cpu
Diffstat:
4 files changed, 10 insertions(+), 7 deletions(-)
diff --git a/.gitignore b/.gitignore
@@ -67,7 +67,7 @@ var/
*.egg
# Sphinx documentation
-docs/_build/
+docs/
# CLion
.idea/
diff --git a/CMakeLists.txt b/CMakeLists.txt
@@ -36,9 +36,9 @@ if (${CMAKE_GENERATOR} STREQUAL "Visual Studio 14 2015")
endif ()
set(CMAKE_CXX_FLAGS "${OPT_TARGET} ${OPT_BITNESS} ${OPT_STATIC}" CACHE STRING "compile flags" FORCE)
set(CMAKE_C_FLAGS "${OPT_TARGET} ${OPT_BITNESS} ${OPT_STATIC}" CACHE STRING "compile flags" FORCE)
-set(CMAKE_EXE_LINKER_FLAGS "${OPT_TARGET} ${OPT_BITNESS}")
-set(CMAKE_SHARED_LINKER_FLAGS "${OPT_TARGET} ${OPT_BITNESS}")
-set(CMAKE_STATIC_LINKER_FLAGS "${OPT_TARGET} ${OPT_BITNESS}")
+#set(CMAKE_EXE_LINKER_FLAGS "${OPT_TARGET} ${OPT_BITNESS}")
+#set(CMAKE_SHARED_LINKER_FLAGS "${OPT_TARGET} ${OPT_BITNESS}")
+#set(CMAKE_STATIC_LINKER_FLAGS "${OPT_TARGET} ${OPT_BITNESS}")
project(kfr)
@@ -48,9 +48,8 @@ set(ALL_WARNINGS -Weverything -Wno-c++98-compat -Wno-c++98-compat-pedantic -Wno-
if (NOT MSVC)
add_compile_options(-std=c++1y)
- add_compile_options(-march=native)
else ()
- add_compile_options(/EHsc /D_HAS_EXCEPTIONS=0 /arch:AVX)
+ add_compile_options(/EHsc /D_HAS_EXCEPTIONS=0)
endif ()
add_subdirectory(examples)
diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt
@@ -21,6 +21,8 @@ if (NOT MSVC)
add_compile_options(-fno-exceptions -fno-rtti)
add_compile_options(-march=native)
link_libraries(stdc++ pthread)
+else ()
+ add_compile_options(/arch:AVX)
endif ()
include_directories(../include)
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
@@ -18,8 +18,10 @@
cmake_minimum_required(VERSION 3.0)
if (NOT MSVC)
- add_compile_options(-fno-exceptions -fno-rtti -ftemplate-backtrace-limit=0)
+ add_compile_options(-fno-exceptions -fno-rtti -ftemplate-backtrace-limit=0 -march=native)
link_libraries(stdc++ pthread m)
+else ()
+ add_compile_options(/arch:AVX)
endif ()
include_directories(../include)