summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2023-10-20 01:00:58 +1100
committerGitHub <noreply@github.com>2023-10-19 15:00:58 +0100
commitd994e6aea6d96e423004952a2fa8b02acf9d004d (patch)
tree0629a9f7a492f726729e77d2a35c0ff66210ece5
parent6e15590e98ca643d06eacc84adf161bcef705c0b (diff)
cmake: Fix error building without CMAKE_BUILD_TYPE being set (#3590)
* Fix error building without CMAKE_BUILD_TYPE being set This resolves the error building without a CMAKE_BUILD_TYPE. CMake Error at CMakeLists.txt:36 (string): string no output variable specified * CMake: convert CMake's build type to meson build type Fix error when the CMAKE_BUILD_TYPE variable isn't set & properly convert the build type to mesons build type.
-rwxr-xr-xCMakeLists.txt21
1 files changed, 19 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d9698d45..5429050b 100755
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -33,7 +33,24 @@ add_subdirectory("subprojects/udis86")
message(STATUS "Setting up wlroots")
include(ExternalProject)
-string(TOLOWER ${CMAKE_BUILD_TYPE} BUILDTYPE_LOWER)
+
+if(CMAKE_BUILD_TYPE)
+ string(TOLOWER ${CMAKE_BUILD_TYPE} BUILDTYPE_LOWER)
+ if(BUILDTYPE_LOWER STREQUAL "release")
+ # Pass.
+ elseif(BUILDTYPE_LOWER STREQUAL "debug")
+ # Pass.
+ elseif(BUILDTYPE_LOWER STREQUAL "relwithdebinfo")
+ set(BUILDTYPE_LOWER "debugoptimized")
+ elseif(BUILDTYPE_LOWER STREQUAL "minsizerel")
+ set(BUILDTYPE_LOWER "minsize")
+ else()
+ set(BUILDTYPE_LOWER "release")
+ endif()
+else()
+ set(BUILDTYPE_LOWER "release")
+endif()
+
ExternalProject_Add(
wlroots
PREFIX ${CMAKE_SOURCE_DIR}/subprojects/wlroots
@@ -230,4 +247,4 @@ protocol("unstable/text-input/text-input-unstable-v1.xml" "text-input-unstable-v
protocol("staging/cursor-shape/cursor-shape-v1.xml" "cursor-shape-v1" false)
# hyprctl
-add_subdirectory(hyprctl) \ No newline at end of file
+add_subdirectory(hyprctl)