summaryrefslogtreecommitdiff
path: root/protocols/Telegram/tdlib/td
diff options
context:
space:
mode:
authorSergey Ponomarev <stokito@gmail.com>2024-09-07 10:23:31 +0300
committerGeorge Hazan <george.hazan@gmail.com>2024-09-07 12:44:33 +0300
commitd3524123a9c24610176f238002887e2034a61685 (patch)
tree5f18322f0680b80904ce8596d90051aab006a5d9 /protocols/Telegram/tdlib/td
parent88aa2752d994043599f9662b9fa2b629f07058c2 (diff)
cmake: enquote variable in string(REPLACE) macros
If a var is empty then the cmake reports an error: string sub-command REPLACE requires at least four arguments
Diffstat (limited to 'protocols/Telegram/tdlib/td')
-rw-r--r--protocols/Telegram/tdlib/td/CMake/AddCXXCompilerFlag.cmake4
1 files changed, 2 insertions, 2 deletions
diff --git a/protocols/Telegram/tdlib/td/CMake/AddCXXCompilerFlag.cmake b/protocols/Telegram/tdlib/td/CMake/AddCXXCompilerFlag.cmake
index 6fb615a1f7..2162dadb26 100644
--- a/protocols/Telegram/tdlib/td/CMake/AddCXXCompilerFlag.cmake
+++ b/protocols/Telegram/tdlib/td/CMake/AddCXXCompilerFlag.cmake
@@ -21,14 +21,14 @@ include(CheckCXXCompilerFlag)
function(mangle_compiler_flag FLAG OUTPUT)
string(TOUPPER "HAVE_CXX_FLAG_${FLAG}" SANITIZED_FLAG)
- string(REPLACE "+" "X" SANITIZED_FLAG ${SANITIZED_FLAG})
+ string(REPLACE "+" "X" SANITIZED_FLAG "${SANITIZED_FLAG}")
string(REGEX REPLACE "[^A-Za-z_0-9]" "_" SANITIZED_FLAG ${SANITIZED_FLAG})
string(REGEX REPLACE "_+" "_" SANITIZED_FLAG ${SANITIZED_FLAG})
set(${OUTPUT} "${SANITIZED_FLAG}" PARENT_SCOPE)
endfunction(mangle_compiler_flag)
function(add_cxx_compiler_flag FLAG)
- string(REPLACE "-Wno-" "-W" MAIN_FLAG ${FLAG})
+ string(REPLACE "-Wno-" "-W" MAIN_FLAG "${FLAG}")
mangle_compiler_flag("${MAIN_FLAG}" MANGLED_FLAG_NAME)
if (DEFINED CMAKE_REQUIRED_FLAGS)
set(OLD_CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}")