From debc50dbeb5f98569132d3e13823913019bc389c Mon Sep 17 00:00:00 2001 From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Date: Fri, 13 Dec 2024 11:13:34 +0000 Subject: [PATCH] cmake: Fix passing `SECP256K1_APPEND_CFLAGS` to clang-cl This change also makes the compile invocation string more natural by ensuring flags do not follow source files. --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d42d7e178a..d962853e99 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -285,7 +285,7 @@ if(NOT CMAKE_GENERATOR MATCHES "Visual Studio") if(SECP256K1_APPEND_CFLAGS) # Appending to this low-level rule variable is the only way to # guarantee that the flags appear at the end of the command line. - string(APPEND CMAKE_C_COMPILE_OBJECT " ${SECP256K1_APPEND_CFLAGS}") + string(REPLACE "" " ${SECP256K1_APPEND_CFLAGS}" CMAKE_C_COMPILE_OBJECT "${CMAKE_C_COMPILE_OBJECT}") endif() set(SECP256K1_APPEND_LDFLAGS "" CACHE STRING "Linker flags that are appended to the command line after all other flags added by the build system. This variable is intended for debugging and special builds.")