Skip to content

Commit

Permalink
cmake: Reimplement SECP256K1_APPEND_CFLAGS using Bitcoin Core approach
Browse files Browse the repository at this point in the history
  • Loading branch information
hebasto committed Jun 21, 2024
1 parent c2764db commit 4706be2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 16 deletions.
10 changes: 6 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -284,14 +284,16 @@ if(SECP256K1_BUILD_BENCHMARK OR SECP256K1_BUILD_TESTS OR SECP256K1_BUILD_EXHAUST
enable_testing()
endif()

set(SECP256K1_APPEND_CFLAGS "" CACHE STRING "Compiler flags that are added to the command line after all other flags added by the build system.")
include(AllTargetsCompileOptions)
set(SECP256K1_APPEND_CFLAGS "" CACHE STRING "Compiler 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_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}")
endif()

add_subdirectory(src)
all_targets_compile_options(src "${SECP256K1_APPEND_CFLAGS}")
if(SECP256K1_BUILD_EXAMPLES)
add_subdirectory(examples)
all_targets_compile_options(examples "${SECP256K1_APPEND_CFLAGS}")
endif()

message("\n")
Expand Down
12 changes: 0 additions & 12 deletions cmake/AllTargetsCompileOptions.cmake

This file was deleted.

0 comments on commit 4706be2

Please sign in to comment.