commit deb0648a18385fb732db32a027866b6838a96289
parent eb357ab2e6405c393b2379c330f7d5084cc2f232
Author: [email protected] <[email protected]>
Date: Tue, 9 Aug 2016 05:20:03 +0300
Update CMakeLists.txt
Diffstat:
3 files changed, 39 insertions(+), 33 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
@@ -17,11 +17,11 @@
cmake_minimum_required(VERSION 2.8)
-if(CMAKE_VERSION VERSION_LESS "2.8.12")
+if (CMAKE_VERSION VERSION_LESS "2.8.12")
function(add_compile_options)
add_definitions(${ARGN})
endfunction(add_compile_options)
-endif()
+endif ()
set(OPT_BITNESS "") # cmake -DOPT_BITNESS="-m32" or -m64
set(OPT_STATIC "") # cmake -DOPT_STATIC="-static"
@@ -52,6 +52,8 @@ include(sources.cmake)
set(ALL_WARNINGS -Weverything -Wno-c++98-compat -Wno-c++98-compat-pedantic -Wno-c99-extensions -Wno-padded)
+set(STD_LIB stdc++)
+
if (NOT MSVC)
add_compile_options(-std=c++1y)
else ()
diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt
@@ -24,7 +24,7 @@ if (NOT MSVC)
else ()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${ARCH_FLAGS}")
endif ()
- link_libraries(stdc++ pthread)
+ link_libraries(${STD_LIB} pthread)
else ()
add_compile_options(/arch:AVX)
endif ()
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
@@ -1,16 +1,16 @@
# Copyright (C) 2016 D Levin (http://www.kfrlib.com)
# This file is part of KFR
-#
+#
# KFR is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
-#
+#
# KFR is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-#
+#
# You should have received a copy of the GNU General Public License
# along with KFR.
@@ -19,14 +19,16 @@ cmake_minimum_required(VERSION 2.8)
if (NOT MSVC)
add_compile_options(-fno-exceptions -fno-rtti -ftemplate-backtrace-limit=0)
- link_libraries(stdc++ pthread m)
-endif ()
+ link_libraries(${STD_LIB} pthread m)
+endif ()
include_directories(../include)
-add_executable(multiarch multiarch.cpp multiarch_fir_sse2.cpp multiarch_fir_avx.cpp ${KFR_SRC})
-set_source_files_properties(multiarch_fir_sse2.cpp PROPERTIES COMPILE_FLAGS "-mno-avx -mno-sse3 -msse2")
-set_source_files_properties(multiarch_fir_avx.cpp PROPERTIES COMPILE_FLAGS -mavx)
+if (NOT ARM)
+ add_executable(multiarch multiarch.cpp multiarch_fir_sse2.cpp multiarch_fir_avx.cpp ${KFR_SRC})
+ set_source_files_properties(multiarch_fir_sse2.cpp PROPERTIES COMPILE_FLAGS "-mno-avx -mno-sse3 -msse2")
+ set_source_files_properties(multiarch_fir_avx.cpp PROPERTIES COMPILE_FLAGS -mavx)
+endif ()
if (NOT MSVC)
if (NOT ARCH_FLAGS)
@@ -57,27 +59,29 @@ add_executable(complex_test complex_test.cpp ${KFR_SRC})
add_executable(vec_test vec_test.cpp ${KFR_SRC})
add_executable(stat_test stat_test.cpp ${KFR_SRC})
-enable_testing()
+if (NOT IOS)
+ enable_testing()
-add_test(NAME basic_vector_test
- COMMAND ${PROJECT_BINARY_DIR}/tests/basic_vector_test)
-add_test(NAME intrinsic_test
- COMMAND ${PROJECT_BINARY_DIR}/tests/intrinsic_test)
-add_test(NAME fracdelay_test
- COMMAND ${PROJECT_BINARY_DIR}/tests/fracdelay_test)
-add_test(NAME conv_test
- COMMAND ${PROJECT_BINARY_DIR}/tests/conv_test)
-if (MPFR_FOUND)
- add_test(NAME transcendental_test
- COMMAND ${PROJECT_BINARY_DIR}/tests/transcendental_test)
+ add_test(NAME basic_vector_test
+ COMMAND ${PROJECT_BINARY_DIR}/tests/basic_vector_test)
+ add_test(NAME intrinsic_test
+ COMMAND ${PROJECT_BINARY_DIR}/tests/intrinsic_test)
+ add_test(NAME fracdelay_test
+ COMMAND ${PROJECT_BINARY_DIR}/tests/fracdelay_test)
+ add_test(NAME conv_test
+ COMMAND ${PROJECT_BINARY_DIR}/tests/conv_test)
+ if (MPFR_FOUND)
+ add_test(NAME transcendental_test
+ COMMAND ${PROJECT_BINARY_DIR}/tests/transcendental_test)
+ endif ()
+ add_test(NAME complex_test
+ COMMAND ${PROJECT_BINARY_DIR}/tests/complex_test)
+ add_test(NAME vec_test
+ COMMAND ${PROJECT_BINARY_DIR}/tests/vec_test)
+ add_test(NAME stat_test
+ COMMAND ${PROJECT_BINARY_DIR}/tests/stat_test)
+ add_test(NAME multiarch
+ COMMAND ${PROJECT_BINARY_DIR}/tests/multiarch)
+ add_test(NAME dft_test
+ COMMAND ${PROJECT_BINARY_DIR}/tests/dft_test)
endif ()
-add_test(NAME complex_test
- COMMAND ${PROJECT_BINARY_DIR}/tests/complex_test)
-add_test(NAME vec_test
- COMMAND ${PROJECT_BINARY_DIR}/tests/vec_test)
-add_test(NAME stat_test
- COMMAND ${PROJECT_BINARY_DIR}/tests/stat_test)
-add_test(NAME multiarch
- COMMAND ${PROJECT_BINARY_DIR}/tests/multiarch)
-add_test(NAME dft_test
- COMMAND ${PROJECT_BINARY_DIR}/tests/dft_test)