diff --git a/identity/CMakeLists.txt b/identity/CMakeLists.txt index f58757a02..b8997539a 100644 --- a/identity/CMakeLists.txt +++ b/identity/CMakeLists.txt @@ -59,9 +59,7 @@ else () target_compile_options(IotIdentity-cpp PRIVATE -Wall -Wno-long-long -pedantic -Werror) endif () -if (CMAKE_BUILD_TYPE STREQUAL "" OR CMAKE_BUILD_TYPE MATCHES Debug) - target_compile_definitions(IotIdentity-cpp PRIVATE "-DDEBUG_BUILD") -endif () +target_compile_definitions(IotIdentity-cpp $<$:DEBUG_BUILD>) if (BUILD_SHARED_LIBS) target_compile_definitions(IotIdentity-cpp PUBLIC "-DAWS_IOTIDENTITY_USE_IMPORT_EXPORT") diff --git a/jobs/CMakeLists.txt b/jobs/CMakeLists.txt index 4059f09fa..d0371b69f 100644 --- a/jobs/CMakeLists.txt +++ b/jobs/CMakeLists.txt @@ -59,9 +59,7 @@ else () target_compile_options(IotJobs-cpp PRIVATE -Wall -Wno-long-long -pedantic -Werror) endif () -if (CMAKE_BUILD_TYPE STREQUAL "" OR CMAKE_BUILD_TYPE MATCHES Debug) - target_compile_definitions(IotJobs-cpp PRIVATE "-DDEBUG_BUILD") -endif () +target_compile_definitions(IotJobs-cpp $<$:DEBUG_BUILD>) if (BUILD_SHARED_LIBS) target_compile_definitions(IotJobs-cpp PUBLIC "-DAWS_IOTJOBS_USE_IMPORT_EXPORT") diff --git a/shadow/CMakeLists.txt b/shadow/CMakeLists.txt index 96797b391..1a3345762 100644 --- a/shadow/CMakeLists.txt +++ b/shadow/CMakeLists.txt @@ -59,9 +59,7 @@ else () target_compile_options(IotShadow-cpp PRIVATE -Wall -Wno-long-long -pedantic -Werror) endif () -if (CMAKE_BUILD_TYPE STREQUAL "" OR CMAKE_BUILD_TYPE MATCHES Debug) - target_compile_definitions(IotShadow-cpp PRIVATE "-DDEBUG_BUILD") -endif () +target_compile_definitions(IotShadow-cpp $<$:DEBUG_BUILD>) if (BUILD_SHARED_LIBS) target_compile_definitions(IotShadow-cpp PUBLIC "-DAWS_IOTSHADOW_USE_IMPORT_EXPORT")