jami
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH v2] build: Guard against potential unset CMAKE_BUILD_TYPE.


From: Maxim Cournoyer
Subject: [PATCH v2] build: Guard against potential unset CMAKE_BUILD_TYPE.
Date: Tue, 9 Jan 2024 09:30:51 -0500

This would fail the build with the error:

  CMake Error at tests/CMakeLists.txt:74 (string):
    string no output variable specified

* tests/CMakeLists.txt [CMAKE_BUILD_TYPE]: Make BUILD_TYPE variable
assignment conditional.

---

Changes in v2:
 - Do not dereference BUILD_TYPE variable

 tests/CMakeLists.txt | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index d50908cf..253d6e5a 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -71,7 +71,9 @@ else()
     set(PTHREAD_LIB pthread)
 endif()
 
-string(TOUPPER ${CMAKE_BUILD_TYPE} BUILD_TYPE)
+if(CMAKE_BUILD_TYPE)
+    string(TOUPPER ${CMAKE_BUILD_TYPE} BUILD_TYPE)
+endif()
 
 set(QML_TESTS_SOURCE_FILES
     ${CMAKE_SOURCE_DIR}/tests/qml/main.cpp

base-commit: a4300308dc8d03d59f620bb5fed753df5cf31ed9
-- 
2.41.0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]