Skip to content

Commit

Permalink
cmake: Add APPEND_{CPP,C,CXX,LD}FLAGS cache variables
Browse files Browse the repository at this point in the history
The content of those variables is appended to the each target flags
added by the build system.
  • Loading branch information
hebasto committed May 2, 2024
1 parent 8c74f93 commit 063d2f1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
7 changes: 7 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,13 @@ cmake_dependent_option(FUZZ "Build for fuzzing. Enabling this will disable all o

option(INSTALL_MAN "Install man pages." ON)

set(APPEND_CPPFLAGS "" CACHE STRING "Preprocessor flags that are appended to the flags added by the build system.")
set(APPEND_CFLAGS "" CACHE STRING "C compiler flags that are appended to the flags added by the build system.")
set(APPEND_CXXFLAGS "" CACHE STRING "(Objective) C++ compiler flags that are appended to the flags added by the build system.")
set(APPEND_LDFLAGS "" CACHE STRING "Linker flags that are appended to the flags added by the build system.")
string(APPEND CMAKE_CXX_COMPILE_OBJECT " ${APPEND_CPPFLAGS} ${APPEND_CXXFLAGS}")
string(APPEND CMAKE_CXX_LINK_EXECUTABLE " ${APPEND_LDFLAGS}")

set(configure_warnings)

include(CheckPIESupported)
Expand Down
1 change: 1 addition & 0 deletions cmake/optional_qt.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ if(WITH_GUI)
set(CMAKE_OBJCXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}")
set(CMAKE_OBJCXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}")
set(CMAKE_OBJCXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL}")
string(APPEND CMAKE_OBJCXX_COMPILE_OBJECT " ${APPEND_CPPFLAGS} ${APPEND_CXXFLAGS}")
endif()
else()
message(WARNING "Qt not found, disabling.\n"
Expand Down
1 change: 1 addition & 0 deletions cmake/secp256k1.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
enable_language(C)
set(CMAKE_C_STANDARD 90)
set(CMAKE_C_EXTENSIONS OFF)
string(APPEND CMAKE_C_COMPILE_OBJECT " ${APPEND_CPPFLAGS} ${APPEND_CFLAGS}")

include(CheckCSourceCompiles)
check_c_source_compiles("
Expand Down

0 comments on commit 063d2f1

Please sign in to comment.