aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfuzzard <fuzzard@kodi.tv>2022-09-30 15:21:01 +1000
committerCastagnaIT <gottardo.stefano.83@gmail.com>2022-09-30 09:06:40 +0200
commite61eb9b701afdec7b45ad82efc38f2b434712ecc (patch)
tree72f57c2d4d6cba3168e5c85603e2fccea016b96b
parent23279c62d2655db75ee2ddb3fcfe77cbcebeba3b (diff)
[cmake] BUILD_DEP_TARGET macro: Support RelwithDebInfo
-rw-r--r--cmake/scripts/common/ModuleHelpers.cmake20
1 files changed, 8 insertions, 12 deletions
diff --git a/cmake/scripts/common/ModuleHelpers.cmake b/cmake/scripts/common/ModuleHelpers.cmake
index e9657cea1e..c512e9558f 100644
--- a/cmake/scripts/common/ModuleHelpers.cmake
+++ b/cmake/scripts/common/ModuleHelpers.cmake
@@ -240,19 +240,15 @@ macro(BUILD_DEP_TARGET)
unset(${MODULE}_LIBRARY_RELEASE)
endif()
else()
- if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.20")
- list(APPEND CMAKE_ARGS "-DCMAKE_BUILD_TYPE=$<IF:$<CONFIG:Debug,RelWithDebInfo>,Debug,Release>")
+ # single config generator (ie Make, Ninja)
+ if(CMAKE_BUILD_TYPE)
+ list(APPEND CMAKE_ARGS "-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}")
else()
- # single config generator (ie Make, Ninja)
- if(CMAKE_BUILD_TYPE)
- list(APPEND CMAKE_ARGS "-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}")
- else()
- # Multi-config generators (eg VS, Xcode, Ninja Multi-Config) will not have CMAKE_BUILD_TYPE
- # Use config genex to generate the types
- # Potential issue if Build type isnt supported by lib project
- # eg lib supports Debug/Release, however users selects RelWithDebInfo in project
- list(APPEND CMAKE_ARGS "-DCMAKE_BUILD_TYPE=$<CONFIG>")
- endif()
+ # Multi-config generators (eg VS, Xcode, Ninja Multi-Config) will not have CMAKE_BUILD_TYPE
+ # Use config genex to generate the types
+ # Potential issue if Build type isnt supported by lib project
+ # eg lib supports Debug/Release, however users selects RelWithDebInfo in project
+ list(APPEND CMAKE_ARGS "-DCMAKE_BUILD_TYPE=$<CONFIG>")
endif()
endif()