mirror of
https://github.com/AlexandreRouma/SDRPlusPlus.git
synced 2024-11-10 04:37:37 +01:00
Added proper cmake debug support
This commit is contained in:
parent
570b8dbd7c
commit
8f972ee0b2
@ -64,14 +64,26 @@ set(SDRPP_MODULE_CMAKE "${CMAKE_SOURCE_DIR}/sdrpp_module.cmake")
|
||||
set(SDRPP_CORE_ROOT "${CMAKE_SOURCE_DIR}/core/src/")
|
||||
|
||||
# Compiler flags
|
||||
if (MSVC)
|
||||
set(SDRPP_COMPILER_ARGS /O2 /Ob2 /std:c++17 /EHsc)
|
||||
elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||
set(SDRPP_COMPILER_ARGS -O3 -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup)
|
||||
else ()
|
||||
set(SDRPP_COMPILER_ARGS -O3 -std=c++17)
|
||||
endif ()
|
||||
set(SDRPP_MODULE_COMPILER_ARGS ${SDRPP_COMPILER_ARGS})
|
||||
if (${CMAKE_BUILD_TYPE} MATCHES "Debug")
|
||||
# Debug Flags
|
||||
if (MSVC)
|
||||
set(SDRPP_COMPILER_FLAGS /std:c++17 /EHsc)
|
||||
elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||
set(SDRPP_COMPILER_FLAGS -g -Og -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup)
|
||||
else ()
|
||||
set(SDRPP_COMPILER_FLAGS -g -Og -std=c++17)
|
||||
endif ()
|
||||
else()
|
||||
# Normal Flags
|
||||
if (MSVC)
|
||||
set(SDRPP_COMPILER_FLAGS /O2 /Ob2 /std:c++17 /EHsc)
|
||||
elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||
set(SDRPP_COMPILER_FLAGS -O3 -std=c++17 -Wno-unused-command-line-argument -undefined dynamic_lookup)
|
||||
else ()
|
||||
set(SDRPP_COMPILER_FLAGS -O3 -std=c++17)
|
||||
endif ()
|
||||
endif()
|
||||
set(SDRPP_MODULE_COMPILER_FLAGS ${SDRPP_COMPILER_FLAGS})
|
||||
|
||||
# Set a default install prefix
|
||||
if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
|
||||
@ -254,7 +266,7 @@ add_executable(sdrpp "src/main.cpp" "win32/resources.rc")
|
||||
target_link_libraries(sdrpp PRIVATE sdrpp_core)
|
||||
|
||||
# Compiler arguments
|
||||
target_compile_options(sdrpp PRIVATE ${SDRPP_COMPILER_ARGS})
|
||||
target_compile_options(sdrpp PRIVATE ${SDRPP_COMPILER_FLAGS})
|
||||
|
||||
# Copy dynamic libs over
|
||||
if (MSVC)
|
||||
|
@ -30,7 +30,7 @@ endif (OPT_BACKEND_ANDROID)
|
||||
add_library(sdrpp_core SHARED ${SRC} ${BACKEND_SRC})
|
||||
|
||||
# Set compiler options
|
||||
target_compile_options(sdrpp_core PRIVATE ${SDRPP_COMPILER_ARGS})
|
||||
target_compile_options(sdrpp_core PRIVATE ${SDRPP_COMPILER_FLAGS})
|
||||
|
||||
# Set the install prefix
|
||||
target_compile_definitions(sdrpp_core PUBLIC INSTALL_PREFIX="${CMAKE_INSTALL_PREFIX}")
|
||||
|
Loading…
Reference in New Issue
Block a user