diff --git a/CMakeLists.txt b/CMakeLists.txt index 7be4f351a1830..ec635be8f6bd5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -167,6 +167,14 @@ 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_CREATE_SHARED_LIBRARY " ${APPEND_LDFLAGS}") +string(APPEND CMAKE_CXX_LINK_EXECUTABLE " ${APPEND_LDFLAGS}") + set(configure_warnings) include(CheckPIESupported) diff --git a/cmake/secp256k1.cmake b/cmake/secp256k1.cmake index 822aa9911a8cf..28bdfdf84878c 100644 --- a/cmake/secp256k1.cmake +++ b/cmake/secp256k1.cmake @@ -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(" diff --git a/src/qt/CMakeLists.txt b/src/qt/CMakeLists.txt index 63a3212218945..b9d86c7ab74bd 100644 --- a/src/qt/CMakeLists.txt +++ b/src/qt/CMakeLists.txt @@ -20,6 +20,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin") 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() function(import_plugins target)