Only use add_compile_definitions with CMake >= 3.12.

This commit is contained in:
tastytea 2020-05-19 19:32:34 +02:00
parent 3c23f6d1a0
commit c2bc1b5e7b
Signed by: tastytea
GPG Key ID: CFC39497F1B26E07

View File

@ -11,8 +11,12 @@ set(CMAKE_BUILD_TYPE "Release" CACHE STRING "The type of build.")
option(BUILD_SHARED_LIBS "Build shared libraries." YES) option(BUILD_SHARED_LIBS "Build shared libraries." YES)
# Not every non-debug build type adds -DNDEBUG. # Not every non-debug build type adds -DNDEBUG.
if(NOT CMAKE_BUILD_TYPE MATCHES "Debug") if(NOT ${CMAKE_BUILD_TYPE} MATCHES "Debug")
add_compile_definitions(NDEBUG) if(${CMAKE_VERSION} VERSION_LESS 3.12)
add_definitions("-DNDEBUG")
else()
add_compile_definitions("NDEBUG")
endif()
endif() endif()
project(mastodonpp project(mastodonpp