From ddad328eca747306e594b74db9118085021b20b2 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Fri, 5 Jul 2019 10:17:28 +0200 Subject: cmake: use `add_compile_options' --- cmake/opentrack-platform.cmake | 2 +- compat/CMakeLists.txt | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/cmake/opentrack-platform.cmake b/cmake/opentrack-platform.cmake index 04b220f6..dae934e1 100644 --- a/cmake/opentrack-platform.cmake +++ b/cmake/opentrack-platform.cmake @@ -92,7 +92,7 @@ IF(CMAKE_SYSTEM_NAME STREQUAL "Linux") endif() if(CMAKE_COMPILER_IS_GNUCXX AND NOT APPLE) - set(CMAKE_CXX_FLAGS "-fuse-cxa-atexit ${CMAKE_CXX_FLAGS}") + add_compile_options(-fuse-cxa-atexit) if(LINUX) # assume binutils add_link_options(-Wl,--exclude-libs,ALL) diff --git a/compat/CMakeLists.txt b/compat/CMakeLists.txt index 5ef9ab67..fb498fb6 100644 --- a/compat/CMakeLists.txt +++ b/compat/CMakeLists.txt @@ -1,3 +1,7 @@ +if(CMAKE_COMPILER_IS_GNUCXX) + add_compile_options(-fno-lto -fno-fast-math -fno-finite-math-only -O0) +endif() + otr_module(compat NO-COMPAT BIN) if(NOT WIN32 AND NOT APPLE) @@ -7,8 +11,3 @@ endif() if(WIN32) target_link_libraries(${self} strmiids) endif() - -if(CMAKE_COMPILER_IS_GNUCXX) - set_property(SOURCE nan.cpp APPEND_STRING PROPERTY - COMPILE_FLAGS "-fno-lto -fno-fast-math -fno-finite-math-only -O0 ") -endif() -- cgit v1.2.3