aboutsummaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorfuzzard <fuzzard@kodi.tv>2022-05-25 13:45:31 +1000
committerfuzzard <fuzzard@kodi.tv>2022-05-25 13:45:31 +1000
commit1e26c346e57bc92e2feb4e45ee00824f1bbb64f1 (patch)
tree607a7913a9bae3da008423999675be94aad63db2 /cmake
parente22e7394f3f648323ca7543939dfc40fa7015aa8 (diff)
[cmake] fixup buildtype after #21043
set default postfix for all android libs (similar to apple) if <MODULE>_RELEASE_TYPE is forced, remove the alternative <MODULE>_LIBRARY_<TYPE> build can now handle crossguid -dbg postfix, so allow it.
Diffstat (limited to 'cmake')
-rw-r--r--cmake/modules/FindCrossGUID.cmake9
-rw-r--r--cmake/modules/FindFmt.cmake3
-rw-r--r--cmake/modules/FindSpdlog.cmake3
-rw-r--r--cmake/scripts/android/ArchSetup.cmake2
-rw-r--r--cmake/scripts/common/ModuleHelpers.cmake7
5 files changed, 16 insertions, 8 deletions
diff --git a/cmake/modules/FindCrossGUID.cmake b/cmake/modules/FindCrossGUID.cmake
index 4783128765..f53570a980 100644
--- a/cmake/modules/FindCrossGUID.cmake
+++ b/cmake/modules/FindCrossGUID.cmake
@@ -18,11 +18,7 @@ if(ENABLE_INTERNAL_CROSSGUID)
set(MODULE_LC crossguid)
- # Temp: We force CMAKE_BUILD_TYPE to release, and makefile builds respect this
- # Multi config generators (eg VS, Xcode) dont, so handle debug postfix build/link for them only
- if(NOT (CMAKE_GENERATOR STREQUAL "Unix Makefiles" OR CMAKE_GENERATOR STREQUAL "Ninja"))
- set(CROSSGUID_DEBUG_POSTFIX "-dgb")
- endif()
+ set(CROSSGUID_DEBUG_POSTFIX "-dgb")
SETUP_BUILD_VARS()
@@ -39,9 +35,6 @@ if(ENABLE_INTERNAL_CROSSGUID)
set(PATCH_COMMAND ${PATCH_EXECUTABLE} -p1 -i ${CMAKE_SOURCE_DIR}/tools/depends/target/crossguid/001-fix-unused-function.patch
COMMAND ${PATCH_EXECUTABLE} -p1 -i ${CMAKE_SOURCE_DIR}/tools/depends/target/crossguid/002-disable-Wall-error.patch)
- # Force release build type. crossguid forces a debug postfix -dgb. may want to patch this
- set(CROSSGUID_BUILD_TYPE Release)
-
set(CMAKE_ARGS -DCROSSGUID_TESTS=OFF
-DDISABLE_WALL=ON)
diff --git a/cmake/modules/FindFmt.cmake b/cmake/modules/FindFmt.cmake
index 096f927ad6..066e0d3d5c 100644
--- a/cmake/modules/FindFmt.cmake
+++ b/cmake/modules/FindFmt.cmake
@@ -17,6 +17,9 @@ if(ENABLE_INTERNAL_FMT)
set(MODULE_LC fmt)
+ # fmt debug uses postfix d for all platforms
+ set(FMT_DEBUG_POSTFIX d)
+
SETUP_BUILD_VARS()
if(APPLE)
diff --git a/cmake/modules/FindSpdlog.cmake b/cmake/modules/FindSpdlog.cmake
index ae5c68aedb..a028f16fc0 100644
--- a/cmake/modules/FindSpdlog.cmake
+++ b/cmake/modules/FindSpdlog.cmake
@@ -18,6 +18,9 @@ if(ENABLE_INTERNAL_SPDLOG)
set(MODULE_LC spdlog)
+ # spdlog debug uses postfix d for all platforms
+ set(SPDLOG_DEBUG_POSTFIX d)
+
SETUP_BUILD_VARS()
if(APPLE)
diff --git a/cmake/scripts/android/ArchSetup.cmake b/cmake/scripts/android/ArchSetup.cmake
index 2fe85fe2f7..6c1e96de29 100644
--- a/cmake/scripts/android/ArchSetup.cmake
+++ b/cmake/scripts/android/ArchSetup.cmake
@@ -42,4 +42,6 @@ set(ENABLE_X11 OFF CACHE BOOL "" FORCE)
set(ENABLE_OPTICAL OFF CACHE BOOL "" FORCE)
set(ENABLE_MDNS OFF CACHE BOOL "" FORCE)
+set(DEBUG_POSTFIX d CACHE STRING "Debug library postfix.")
+
list(APPEND DEPLIBS android log jnigraphics mediandk)
diff --git a/cmake/scripts/common/ModuleHelpers.cmake b/cmake/scripts/common/ModuleHelpers.cmake
index a31286c0bb..32dc72c4e2 100644
--- a/cmake/scripts/common/ModuleHelpers.cmake
+++ b/cmake/scripts/common/ModuleHelpers.cmake
@@ -141,6 +141,13 @@ macro(BUILD_DEP_TARGET)
# if MODULE has set a manual build type, use it, otherwise use project build type
if(${MODULE}_BUILD_TYPE)
list(APPEND CMAKE_ARGS "-DCMAKE_BUILD_TYPE=${${MODULE}_BUILD_TYPE}")
+ # Build_type is forced, so unset the opposite <MODULE>_LIBRARY_<TYPE> to only give
+ # select_library_configurations one library name to choose from
+ if(${MODULE}_BUILD_TYPE STREQUAL "Release")
+ unset(${MODULE}_LIBRARY_DEBUG)
+ else()
+ unset(${MODULE}_LIBRARY_RELEASE)
+ endif()
else()
# single config generator (ie Make, Ninja)
if(CMAKE_BUILD_TYPE)