Skip to content

Commit c4c5cf1

Browse files
committed
cmake: Fix passing APPEND_*FLAGS to secp256k1 subtree
1 parent eb540a2 commit c4c5cf1

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,11 @@ include(GetTargetInterface)
5252
# -fsanitize and related flags apply to both C++ and C,
5353
# so we can pass them down to libsecp256k1 as CFLAGS and LDFLAGS.
5454
get_target_interface(SECP256K1_APPEND_CFLAGS "" sanitize_interface COMPILE_OPTIONS)
55+
string(STRIP "${SECP256K1_APPEND_CFLAGS} ${APPEND_CPPFLAGS}" SECP256K1_APPEND_CFLAGS)
56+
string(STRIP "${SECP256K1_APPEND_CFLAGS} ${APPEND_CFLAGS}" SECP256K1_APPEND_CFLAGS)
5557
set(SECP256K1_APPEND_CFLAGS ${SECP256K1_APPEND_CFLAGS} CACHE STRING "" FORCE)
5658
get_target_interface(SECP256K1_APPEND_LDFLAGS "" sanitize_interface LINK_OPTIONS)
59+
string(STRIP "${SECP256K1_APPEND_LDFLAGS} ${APPEND_LDFLAGS}" SECP256K1_APPEND_LDFLAGS)
5760
set(SECP256K1_APPEND_LDFLAGS ${SECP256K1_APPEND_LDFLAGS} CACHE STRING "" FORCE)
5861
# We want to build libsecp256k1 with the most tested RelWithDebInfo configuration.
5962
enable_language(C)
@@ -75,7 +78,6 @@ set_target_properties(secp256k1 PROPERTIES
7578
EXCLUDE_FROM_ALL TRUE
7679
)
7780
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
78-
string(APPEND CMAKE_C_COMPILE_OBJECT " ${APPEND_CPPFLAGS} ${APPEND_CFLAGS}")
7981

8082
add_library(bitcoin_consensus STATIC EXCLUDE_FROM_ALL
8183
arith_uint256.cpp

0 commit comments

Comments
 (0)