diff options
author | tastytea | 2020-05-19 19:32:34 +0200 |
---|---|---|
committer | tastytea | 2020-05-19 19:32:34 +0200 |
commit | c2bc1b5e7b417c434d327c4f9f45d86ca3a62de8 (patch) | |
tree | 9f3f21db22b733f321c8fd4cf96325011da49034 | |
parent | 3c23f6d1a0b10fb83b02f7f68f33737a4a220791 (diff) | |
download | mastodonpp-c2bc1b5e7b417c434d327c4f9f45d86ca3a62de8.tar mastodonpp-c2bc1b5e7b417c434d327c4f9f45d86ca3a62de8.tar.gz mastodonpp-c2bc1b5e7b417c434d327c4f9f45d86ca3a62de8.zip |
Only use add_compile_definitions with CMake >= 3.12.
-rw-r--r-- | CMakeLists.txt | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index ddd51df..43b12f9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,8 +11,12 @@ set(CMAKE_BUILD_TYPE "Release" CACHE STRING "The type of build.") option(BUILD_SHARED_LIBS "Build shared libraries." YES) # Not every non-debug build type adds -DNDEBUG. -if(NOT CMAKE_BUILD_TYPE MATCHES "Debug") - add_compile_definitions(NDEBUG) +if(NOT ${CMAKE_BUILD_TYPE} MATCHES "Debug") + if(${CMAKE_VERSION} VERSION_LESS 3.12) + add_definitions("-DNDEBUG") + else() + add_compile_definitions("NDEBUG") + endif() endif() project(mastodonpp |