From 45644758217d2c257bb934c461a42d9f6066125b Mon Sep 17 00:00:00 2001 From: AlexandreRouma Date: Sun, 3 Oct 2021 01:13:15 +0200 Subject: [PATCH] Reworked cmake compiler arguments --- CMakeLists.txt | 6 +++--- airspy_source/CMakeLists.txt | 6 +++--- airspyhf_source/CMakeLists.txt | 6 +++--- audio_sink/CMakeLists.txt | 6 +++--- bladerf_source/CMakeLists.txt | 6 +++--- core/CMakeLists.txt | 11 ++++++----- demo_module/CMakeLists.txt | 6 +++--- discord_integration/CMakeLists.txt | 6 +++--- falcon9_decoder/CMakeLists.txt | 6 +++--- file_source/CMakeLists.txt | 6 +++--- frequency_manager/CMakeLists.txt | 6 +++--- hackrf_source/CMakeLists.txt | 6 +++--- limesdr_source/CMakeLists.txt | 6 +++--- m17_decoder/CMakeLists.txt | 6 +++--- meteor_demodulator/CMakeLists.txt | 6 +++--- network_sink/CMakeLists.txt | 6 +++--- new_portaudio_sink/CMakeLists.txt | 8 +++++--- plutosdr_source/CMakeLists.txt | 6 +++--- portaudio_sink/CMakeLists.txt | 9 ++++++--- radio/CMakeLists.txt | 6 +++--- recorder/CMakeLists.txt | 6 +++--- rigctl_server/CMakeLists.txt | 6 +++--- rtl_sdr_source/CMakeLists.txt | 6 +++--- rtl_tcp_source/CMakeLists.txt | 6 +++--- scanner/CMakeLists.txt | 6 +++--- sddc_source/CMakeLists.txt | 6 +++--- sdrplay_source/CMakeLists.txt | 6 +++--- soapy_source/CMakeLists.txt | 6 +++--- spyserver_source/CMakeLists.txt | 6 +++--- weather_sat_decoder/CMakeLists.txt | 6 +++--- 30 files changed, 98 insertions(+), 92 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6d1e028e..8dfd699a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -46,11 +46,11 @@ option(OPT_BUILD_RIGCTL_SERVER "Rigctl backend for controlling SDR++ with softwa # Compiler arguments for each platform if (MSVC) - set(CMAKE_CXX_FLAGS "-O2 /std:c++17 /EHsc") + add_compile_options(/O2 /std:c++17 /EHsc) elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") - set(CMAKE_CXX_FLAGS "-O3 -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup") + add_compile_options(-O3 -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup) else () - set(CMAKE_CXX_FLAGS "-O3 -std=c++17") + add_compile_options(-O3 -std=c++17) endif () # Core of SDR++ diff --git a/airspy_source/CMakeLists.txt b/airspy_source/CMakeLists.txt index 9f6a08a2..2c277b9d 100644 --- a/airspy_source/CMakeLists.txt +++ b/airspy_source/CMakeLists.txt @@ -2,11 +2,11 @@ cmake_minimum_required(VERSION 3.13) project(airspy_source) if (MSVC) - set(CMAKE_CXX_FLAGS "-O2 /std:c++17 /EHsc") + add_compile_options(/O2 /std:c++17 /EHsc) elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") - set(CMAKE_CXX_FLAGS "-O3 -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup") + add_compile_options(-O3 -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup) else () - set(CMAKE_CXX_FLAGS "-O3 -std=c++17") + add_compile_options(-O3 -std=c++17) endif () include_directories("src/") diff --git a/airspyhf_source/CMakeLists.txt b/airspyhf_source/CMakeLists.txt index e917c2e4..e978bb09 100644 --- a/airspyhf_source/CMakeLists.txt +++ b/airspyhf_source/CMakeLists.txt @@ -2,11 +2,11 @@ cmake_minimum_required(VERSION 3.13) project(airspyhf_source) if (MSVC) - set(CMAKE_CXX_FLAGS "-O2 /std:c++17 /EHsc") + add_compile_options(/O2 /std:c++17 /EHsc) elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") - set(CMAKE_CXX_FLAGS "-O3 -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup") + add_compile_options(-O3 -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup) else () - set(CMAKE_CXX_FLAGS "-O3 -std=c++17") + add_compile_options(-O3 -std=c++17) endif () include_directories("src/") diff --git a/audio_sink/CMakeLists.txt b/audio_sink/CMakeLists.txt index d391e1a2..b12fe065 100644 --- a/audio_sink/CMakeLists.txt +++ b/audio_sink/CMakeLists.txt @@ -2,11 +2,11 @@ cmake_minimum_required(VERSION 3.13) project(audio_sink) if (MSVC) - set(CMAKE_CXX_FLAGS "-O2 /std:c++17 /EHsc") + add_compile_options(/O2 /std:c++17 /EHsc) elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") - set(CMAKE_CXX_FLAGS "-O3 -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup") + add_compile_options(-O3 -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup) else () - set(CMAKE_CXX_FLAGS "-O3 -std=c++17") + add_compile_options(-O3 -std=c++17) endif () file(GLOB SRC "src/*.cpp") diff --git a/bladerf_source/CMakeLists.txt b/bladerf_source/CMakeLists.txt index 71543c77..2d2501e4 100644 --- a/bladerf_source/CMakeLists.txt +++ b/bladerf_source/CMakeLists.txt @@ -2,11 +2,11 @@ cmake_minimum_required(VERSION 3.13) project(bladerf_source) if (MSVC) - set(CMAKE_CXX_FLAGS "-O2 /std:c++17 /EHsc") + add_compile_options(/O2 /std:c++17 /EHsc) elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") - set(CMAKE_CXX_FLAGS "-O3 -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup") + add_compile_options(-O3 -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup) else () - set(CMAKE_CXX_FLAGS "-O3 -std=c++17") + add_compile_options(-O3 -std=c++17) endif () include_directories("src/") diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt index be791bec..ba8ddbb4 100644 --- a/core/CMakeLists.txt +++ b/core/CMakeLists.txt @@ -1,19 +1,19 @@ cmake_minimum_required(VERSION 3.13) project(sdrpp_core) +add_subdirectory("libcorrect/") + # Set compiler options if (MSVC) - set(CMAKE_CXX_FLAGS "-O2 /std:c++17 /EHsc") + add_compile_options(/O2 /std:c++17 /EHsc) set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") - set(CMAKE_CXX_FLAGS "-O3 -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup") + add_compile_options(-O3 -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup) else () - set(CMAKE_CXX_FLAGS "-O3 -std=c++17") + add_compile_options(-O3 -std=c++17) endif () add_definitions(-DSDRPP_IS_CORE) -add_subdirectory("libcorrect/") - # Main code file(GLOB_RECURSE SRC "src/*.cpp" "src/*.c") @@ -96,6 +96,7 @@ else() endif () if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") + # TODO: Replace with add_compile_options? set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static") set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libgcc -static-libstdc++") endif () diff --git a/demo_module/CMakeLists.txt b/demo_module/CMakeLists.txt index f3e17c57..e3cdc25e 100644 --- a/demo_module/CMakeLists.txt +++ b/demo_module/CMakeLists.txt @@ -2,11 +2,11 @@ cmake_minimum_required(VERSION 3.13) project(demo) if (MSVC) - set(CMAKE_CXX_FLAGS "-O2 /std:c++17 /EHsc") + add_compile_options(/O2 /std:c++17 /EHsc) elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") - set(CMAKE_CXX_FLAGS "-O3 -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup") + add_compile_options(-O3 -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup) else () - set(CMAKE_CXX_FLAGS "-O3 -std=c++17") + add_compile_options(-O3 -std=c++17) endif () file(GLOB SRC "src/*.cpp") diff --git a/discord_integration/CMakeLists.txt b/discord_integration/CMakeLists.txt index e1d511d1..5773c68f 100644 --- a/discord_integration/CMakeLists.txt +++ b/discord_integration/CMakeLists.txt @@ -2,11 +2,11 @@ cmake_minimum_required(VERSION 3.13) project(discord_integration) if (MSVC) - set(CMAKE_CXX_FLAGS "-O2 /std:c++17 /EHsc") + add_compile_options(/O2 /std:c++17 /EHsc) elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") - set(CMAKE_CXX_FLAGS "-O3 -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup -fPIC") + add_compile_options(-O3 -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup) else () - set(CMAKE_CXX_FLAGS "-O3 -std=c++17 -fPIC") + add_compile_options(-O3 -std=c++17) endif () add_subdirectory("discord-rpc") diff --git a/falcon9_decoder/CMakeLists.txt b/falcon9_decoder/CMakeLists.txt index cbd2a1df..2ddcce9a 100644 --- a/falcon9_decoder/CMakeLists.txt +++ b/falcon9_decoder/CMakeLists.txt @@ -2,11 +2,11 @@ cmake_minimum_required(VERSION 3.13) project(falcon9_decoder) if (MSVC) - set(CMAKE_CXX_FLAGS "-O2 /std:c++17 /EHsc") + add_compile_options(/O2 /std:c++17 /EHsc) elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") - set(CMAKE_CXX_FLAGS "-O3 -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup") + add_compile_options(-O3 -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup) else () - set(CMAKE_CXX_FLAGS "-O3 -std=c++17") + add_compile_options(-O3 -std=c++17) endif () file(GLOB_RECURSE SRC "src/*.cpp" "src/*.c") diff --git a/file_source/CMakeLists.txt b/file_source/CMakeLists.txt index 9c991d62..a30673f8 100644 --- a/file_source/CMakeLists.txt +++ b/file_source/CMakeLists.txt @@ -2,11 +2,11 @@ cmake_minimum_required(VERSION 3.13) project(file_source) if (MSVC) - set(CMAKE_CXX_FLAGS "-O2 /std:c++17 /EHsc") + add_compile_options(/O2 /std:c++17 /EHsc) elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") - set(CMAKE_CXX_FLAGS "-O3 -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup") + add_compile_options(-O3 -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup) else () - set(CMAKE_CXX_FLAGS "-O3 -std=c++17") + add_compile_options(-O3 -std=c++17) endif () include_directories("src/") diff --git a/frequency_manager/CMakeLists.txt b/frequency_manager/CMakeLists.txt index 5d33a5f8..dfd3c101 100644 --- a/frequency_manager/CMakeLists.txt +++ b/frequency_manager/CMakeLists.txt @@ -2,11 +2,11 @@ cmake_minimum_required(VERSION 3.13) project(frequency_manager) if (MSVC) - set(CMAKE_CXX_FLAGS "-O2 /std:c++17 /EHsc") + add_compile_options(/O2 /std:c++17 /EHsc) elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") - set(CMAKE_CXX_FLAGS "-O3 -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup") + add_compile_options(-O3 -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup) else () - set(CMAKE_CXX_FLAGS "-O3 -std=c++17") + add_compile_options(-O3 -std=c++17) endif () include_directories("src/" "../radio/src") diff --git a/hackrf_source/CMakeLists.txt b/hackrf_source/CMakeLists.txt index ebee7b68..3b9d1eea 100644 --- a/hackrf_source/CMakeLists.txt +++ b/hackrf_source/CMakeLists.txt @@ -2,11 +2,11 @@ cmake_minimum_required(VERSION 3.13) project(hackrf_source) if (MSVC) - set(CMAKE_CXX_FLAGS "-O2 /std:c++17 /EHsc") + add_compile_options(/O2 /std:c++17 /EHsc) elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") - set(CMAKE_CXX_FLAGS "-O3 -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup") + add_compile_options(-O3 -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup) else () - set(CMAKE_CXX_FLAGS "-O3 -std=c++17") + add_compile_options(-O3 -std=c++17) endif () include_directories("src/") diff --git a/limesdr_source/CMakeLists.txt b/limesdr_source/CMakeLists.txt index b40e5cbd..1019a766 100644 --- a/limesdr_source/CMakeLists.txt +++ b/limesdr_source/CMakeLists.txt @@ -2,11 +2,11 @@ cmake_minimum_required(VERSION 3.13) project(limesdr_source) if (MSVC) - set(CMAKE_CXX_FLAGS "-O2 /std:c++17 /EHsc") + add_compile_options(/O2 /std:c++17 /EHsc) elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") - set(CMAKE_CXX_FLAGS "-O3 -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup") + add_compile_options(-O3 -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup) else () - set(CMAKE_CXX_FLAGS "-O3 -std=c++17") + add_compile_options(-O3 -std=c++17) endif () include_directories("src/") diff --git a/m17_decoder/CMakeLists.txt b/m17_decoder/CMakeLists.txt index b397f835..3e9ec747 100644 --- a/m17_decoder/CMakeLists.txt +++ b/m17_decoder/CMakeLists.txt @@ -2,11 +2,11 @@ cmake_minimum_required(VERSION 3.13) project(m17_decoder) if (MSVC) - set(CMAKE_CXX_FLAGS "-O2 /std:c++17 /EHsc") + add_compile_options(/O2 /std:c++17 /EHsc) elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") - set(CMAKE_CXX_FLAGS "-O3 -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup") + add_compile_options(-O3 -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup) else () - set(CMAKE_CXX_FLAGS "-O3 -std=c++17") + add_compile_options(-O3 -std=c++17) endif () file(GLOB_RECURSE SRC "src/*.cpp" "src/*.c") diff --git a/meteor_demodulator/CMakeLists.txt b/meteor_demodulator/CMakeLists.txt index 797690ad..1875eb3c 100644 --- a/meteor_demodulator/CMakeLists.txt +++ b/meteor_demodulator/CMakeLists.txt @@ -2,11 +2,11 @@ cmake_minimum_required(VERSION 3.13) project(meteor_demodulator) if (MSVC) - set(CMAKE_CXX_FLAGS "-O2 /std:c++17 /EHsc") + add_compile_options(/O2 /std:c++17 /EHsc) elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") - set(CMAKE_CXX_FLAGS "-O3 -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup") + add_compile_options(-O3 -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup) else () - set(CMAKE_CXX_FLAGS "-O3 -std=c++17") + add_compile_options(-O3 -std=c++17) endif () file(GLOB_RECURSE SRC "src/*.cpp" "src/*.c") diff --git a/network_sink/CMakeLists.txt b/network_sink/CMakeLists.txt index 11eb015a..5473374d 100644 --- a/network_sink/CMakeLists.txt +++ b/network_sink/CMakeLists.txt @@ -2,11 +2,11 @@ cmake_minimum_required(VERSION 3.13) project(network_sink) if (MSVC) - set(CMAKE_CXX_FLAGS "-O2 /std:c++17 /EHsc") + add_compile_options(/O2 /std:c++17 /EHsc) elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") - set(CMAKE_CXX_FLAGS "-O3 -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup") + add_compile_options(-O3 -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup) else () - set(CMAKE_CXX_FLAGS "-O3 -std=c++17") + add_compile_options(-O3 -std=c++17) endif () file(GLOB SRC "src/*.cpp") diff --git a/new_portaudio_sink/CMakeLists.txt b/new_portaudio_sink/CMakeLists.txt index 2105577a..9adfa574 100644 --- a/new_portaudio_sink/CMakeLists.txt +++ b/new_portaudio_sink/CMakeLists.txt @@ -2,9 +2,11 @@ cmake_minimum_required(VERSION 3.13) project(new_portaudio_sink) if (MSVC) - set(CMAKE_CXX_FLAGS "-O2 /std:c++17 /EHsc") -else() - set(CMAKE_CXX_FLAGS "-O3 -std=c++17 -fpermissive") + add_compile_options(/O2 /std:c++17 /EHsc) +elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") + add_compile_options(-O3 -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup) +else () + add_compile_options(-O3 -std=c++17 -fpermissive) endif (MSVC) file(GLOB SRC "src/*.cpp") diff --git a/plutosdr_source/CMakeLists.txt b/plutosdr_source/CMakeLists.txt index c6f62ced..ef6c048b 100644 --- a/plutosdr_source/CMakeLists.txt +++ b/plutosdr_source/CMakeLists.txt @@ -2,11 +2,11 @@ cmake_minimum_required(VERSION 3.13) project(plutosdr_source) if (MSVC) - set(CMAKE_CXX_FLAGS "-O2 /std:c++17 /EHsc") + add_compile_options(/O2 /std:c++17 /EHsc) elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") - set(CMAKE_CXX_FLAGS "-O3 -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup") + add_compile_options(-O3 -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup) else () - set(CMAKE_CXX_FLAGS "-O3 -std=c++17") + add_compile_options(-O3 -std=c++17) endif () include_directories("src/") diff --git a/portaudio_sink/CMakeLists.txt b/portaudio_sink/CMakeLists.txt index 2dc49670..f2558168 100644 --- a/portaudio_sink/CMakeLists.txt +++ b/portaudio_sink/CMakeLists.txt @@ -2,11 +2,14 @@ cmake_minimum_required(VERSION 3.13) project(audio_sink) if (MSVC) - set(CMAKE_CXX_FLAGS "-O2 /std:c++17 /EHsc") -else() - set(CMAKE_CXX_FLAGS "-O3 -std=c++17 -fpermissive") + add_compile_options(/O2 /std:c++17 /EHsc) +elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") + add_compile_options(-O3 -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup) +else () + add_compile_options(-O3 -std=c++17 -fpermissive) endif (MSVC) + file(GLOB SRC "src/*.cpp") include_directories("src/") diff --git a/radio/CMakeLists.txt b/radio/CMakeLists.txt index 2e88d612..a99136ae 100644 --- a/radio/CMakeLists.txt +++ b/radio/CMakeLists.txt @@ -2,11 +2,11 @@ cmake_minimum_required(VERSION 3.13) project(radio) if (MSVC) - set(CMAKE_CXX_FLAGS "-O2 /std:c++17 /EHsc") + add_compile_options(/O2 /std:c++17 /EHsc) elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") - set(CMAKE_CXX_FLAGS "-O3 -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup") + add_compile_options(-O3 -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup) else () - set(CMAKE_CXX_FLAGS "-O3 -std=c++17") + add_compile_options(-O3 -std=c++17) endif () file(GLOB SRC "src/*.cpp") diff --git a/recorder/CMakeLists.txt b/recorder/CMakeLists.txt index 83767028..1b8d56c6 100644 --- a/recorder/CMakeLists.txt +++ b/recorder/CMakeLists.txt @@ -2,11 +2,11 @@ cmake_minimum_required(VERSION 3.13) project(recorder) if (MSVC) - set(CMAKE_CXX_FLAGS "-O2 /std:c++17 /EHsc") + add_compile_options(/O2 /std:c++17 /EHsc) elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") - set(CMAKE_CXX_FLAGS "-O3 -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup") + add_compile_options(-O3 -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup) else () - set(CMAKE_CXX_FLAGS "-O3 -std=c++17") + add_compile_options(-O3 -std=c++17) endif () file(GLOB SRC "src/*.cpp") diff --git a/rigctl_server/CMakeLists.txt b/rigctl_server/CMakeLists.txt index 5c81e77a..f50085b7 100644 --- a/rigctl_server/CMakeLists.txt +++ b/rigctl_server/CMakeLists.txt @@ -2,11 +2,11 @@ cmake_minimum_required(VERSION 3.13) project(rigctl_server) if (MSVC) - set(CMAKE_CXX_FLAGS "-O2 /std:c++17 /EHsc") + add_compile_options(/O2 /std:c++17 /EHsc) elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") - set(CMAKE_CXX_FLAGS "-O3 -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup") + add_compile_options(-O3 -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup) else () - set(CMAKE_CXX_FLAGS "-O3 -std=c++17") + add_compile_options(-O3 -std=c++17) endif () file(GLOB SRC "src/*.cpp") diff --git a/rtl_sdr_source/CMakeLists.txt b/rtl_sdr_source/CMakeLists.txt index 43ea7dbb..1dbf7c7d 100644 --- a/rtl_sdr_source/CMakeLists.txt +++ b/rtl_sdr_source/CMakeLists.txt @@ -2,11 +2,11 @@ cmake_minimum_required(VERSION 3.13) project(rtl_sdr_source) if (MSVC) - set(CMAKE_CXX_FLAGS "-O2 /std:c++17 /EHsc") + add_compile_options(/O2 /std:c++17 /EHsc) elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") - set(CMAKE_CXX_FLAGS "-O3 -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup") + add_compile_options(-O3 -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup) else () - set(CMAKE_CXX_FLAGS "-O3 -std=c++17") + add_compile_options(-O3 -std=c++17) endif () include_directories("src/") diff --git a/rtl_tcp_source/CMakeLists.txt b/rtl_tcp_source/CMakeLists.txt index 739f0b66..d968f453 100644 --- a/rtl_tcp_source/CMakeLists.txt +++ b/rtl_tcp_source/CMakeLists.txt @@ -2,11 +2,11 @@ cmake_minimum_required(VERSION 3.13) project(rtl_tcp_source) if (MSVC) - set(CMAKE_CXX_FLAGS "-O2 /std:c++17 /EHsc") + add_compile_options(/O2 /std:c++17 /EHsc) elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") - set(CMAKE_CXX_FLAGS "-O3 -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup") + add_compile_options(-O3 -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup) else () - set(CMAKE_CXX_FLAGS "-O3 -std=c++17") + add_compile_options(-O3 -std=c++17) endif () include_directories("src/") diff --git a/scanner/CMakeLists.txt b/scanner/CMakeLists.txt index 3678d0f9..804fac0a 100644 --- a/scanner/CMakeLists.txt +++ b/scanner/CMakeLists.txt @@ -2,11 +2,11 @@ cmake_minimum_required(VERSION 3.13) project(scanner) if (MSVC) - set(CMAKE_CXX_FLAGS "-O2 /std:c++17 /EHsc") + add_compile_options(/O2 /std:c++17 /EHsc) elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") - set(CMAKE_CXX_FLAGS "-O3 -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup") + add_compile_options(-O3 -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup) else () - set(CMAKE_CXX_FLAGS "-O3 -std=c++17") + add_compile_options(-O3 -std=c++17) endif () file(GLOB SRC "src/*.cpp") diff --git a/sddc_source/CMakeLists.txt b/sddc_source/CMakeLists.txt index 559af307..a74e268a 100644 --- a/sddc_source/CMakeLists.txt +++ b/sddc_source/CMakeLists.txt @@ -2,11 +2,11 @@ cmake_minimum_required(VERSION 3.13) project(sddc_source) if (MSVC) - set(CMAKE_CXX_FLAGS "-O2 /std:c++17 /EHsc") + add_compile_options(/O2 /std:c++17 /EHsc) elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") - set(CMAKE_CXX_FLAGS "-O3 -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup") + add_compile_options(-O3 -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup) else () - set(CMAKE_CXX_FLAGS "-O3 -std=c++17") + add_compile_options(-O3 -std=c++17) endif () include_directories("src/" "src/libsddc/" "src/libsddc/Core/" "src/libsddc/Core/pffft/" "src/libsddc/libsddc/") diff --git a/sdrplay_source/CMakeLists.txt b/sdrplay_source/CMakeLists.txt index 17bac2d3..9cbe4fba 100644 --- a/sdrplay_source/CMakeLists.txt +++ b/sdrplay_source/CMakeLists.txt @@ -2,11 +2,11 @@ cmake_minimum_required(VERSION 3.13) project(sdrplay_source) if (MSVC) - set(CMAKE_CXX_FLAGS "-O2 /std:c++17 /EHsc") + add_compile_options(/O2 /std:c++17 /EHsc) elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") - set(CMAKE_CXX_FLAGS "-O3 -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup") + add_compile_options(-O3 -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup) else () - set(CMAKE_CXX_FLAGS "-O3 -std=c++17") + add_compile_options(-O3 -std=c++17) endif () include_directories("src/") diff --git a/soapy_source/CMakeLists.txt b/soapy_source/CMakeLists.txt index 7b08d715..dfffb0af 100644 --- a/soapy_source/CMakeLists.txt +++ b/soapy_source/CMakeLists.txt @@ -2,11 +2,11 @@ cmake_minimum_required(VERSION 3.13) project(soapy_source) if (MSVC) - set(CMAKE_CXX_FLAGS "-O2 /std:c++17 /EHsc") + add_compile_options(/O2 /std:c++17 /EHsc) elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") - set(CMAKE_CXX_FLAGS "-O3 -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup") + add_compile_options(-O3 -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup) else () - set(CMAKE_CXX_FLAGS "-O3 -std=c++17") + add_compile_options(-O3 -std=c++17) endif () file(GLOB SRC "src/*.cpp") diff --git a/spyserver_source/CMakeLists.txt b/spyserver_source/CMakeLists.txt index 4f4232a2..28bd1ec2 100644 --- a/spyserver_source/CMakeLists.txt +++ b/spyserver_source/CMakeLists.txt @@ -2,11 +2,11 @@ cmake_minimum_required(VERSION 3.13) project(spyserver_source) if (MSVC) - set(CMAKE_CXX_FLAGS "-O2 /std:c++17 /EHsc") + add_compile_options(/O2 /std:c++17 /EHsc) elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") - set(CMAKE_CXX_FLAGS "-O3 -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup") + add_compile_options(-O3 -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup) else () - set(CMAKE_CXX_FLAGS "-O3 -std=c++17") + add_compile_options(-O3 -std=c++17) endif () include_directories("src/") diff --git a/weather_sat_decoder/CMakeLists.txt b/weather_sat_decoder/CMakeLists.txt index e41506a3..0f1e296d 100644 --- a/weather_sat_decoder/CMakeLists.txt +++ b/weather_sat_decoder/CMakeLists.txt @@ -2,11 +2,11 @@ cmake_minimum_required(VERSION 3.13) project(weather_sat_decoder) if (MSVC) - set(CMAKE_CXX_FLAGS "-O2 /std:c++17 /EHsc") + add_compile_options(/O2 /std:c++17 /EHsc) elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") - set(CMAKE_CXX_FLAGS "-O3 -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup") + add_compile_options(-O3 -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup) else () - set(CMAKE_CXX_FLAGS "-O3 -std=c++17") + add_compile_options(-O3 -std=c++17) endif () file(GLOB_RECURSE SRC "src/*.cpp" "src/*.c")