Skip to content

Commit

Permalink
Merge #1600: cmake: Introduce SECP256K1_APPEND_LDFLAGS variable
Browse files Browse the repository at this point in the history
421ed1b cmake: Introduce `SECP256K1_APPEND_LDFLAGS` variable (Hennadii Stepanov)

Pull request description:

ACKs for top commit:
  jonasnick:
    ACK 421ed1b

Tree-SHA512: 044b84b86a98e30268189dc92c4b8045e146451f3849a9863eb8f99490df53f1f02ae0fc74d74dc6ede0ea0c55653c142f409c77e1967505a085f31e4c472443
  • Loading branch information
jonasnick committed Sep 7, 2024
2 parents 1988855 + 421ed1b commit 2f2ccc4
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,14 @@ if(SECP256K1_APPEND_CFLAGS)
string(APPEND CMAKE_C_COMPILE_OBJECT " ${SECP256K1_APPEND_CFLAGS}")
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.")
if(SECP256K1_APPEND_LDFLAGS)
# 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_CREATE_SHARED_LIBRARY " ${SECP256K1_APPEND_LDFLAGS}")
string(APPEND CMAKE_C_LINK_EXECUTABLE " ${SECP256K1_APPEND_LDFLAGS}")
endif()

add_subdirectory(src)
if(SECP256K1_BUILD_EXAMPLES)
add_subdirectory(examples)
Expand Down Expand Up @@ -355,6 +363,9 @@ endif()
if(SECP256K1_APPEND_CFLAGS)
message("SECP256K1_APPEND_CFLAGS ............... ${SECP256K1_APPEND_CFLAGS}")
endif()
if(SECP256K1_APPEND_LDFLAGS)
message("SECP256K1_APPEND_LDFLAGS .............. ${SECP256K1_APPEND_LDFLAGS}")
endif()
message("")
if(print_msan_notice)
message(
Expand Down

0 comments on commit 2f2ccc4

Please sign in to comment.