mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-04-29 14:59:39 -04:00
cmake: Move APPEND_*
variables logic to bitcoincore_enable_language
This change is required for the following commit.
This commit is contained in:
parent
6d55894a02
commit
8287a7670b
3 changed files with 14 additions and 11 deletions
|
@ -183,16 +183,6 @@ option(BUILD_FOR_FUZZING "Build for fuzzing. Enabling this will disable all othe
|
||||||
|
|
||||||
option(INSTALL_MAN "Install man pages." ON)
|
option(INSTALL_MAN "Install man pages." ON)
|
||||||
|
|
||||||
set(APPEND_CPPFLAGS "" CACHE STRING "Preprocessor 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.")
|
|
||||||
set(APPEND_CFLAGS "" CACHE STRING "C 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.")
|
|
||||||
set(APPEND_CXXFLAGS "" CACHE STRING "(Objective) C++ 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.")
|
|
||||||
set(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.")
|
|
||||||
# Appending to this low-level rule variables is the only way to
|
|
||||||
# guarantee that the flags appear at the end of the command line.
|
|
||||||
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)
|
set(configure_warnings)
|
||||||
|
|
||||||
include(CheckLinkerSupportsPIE)
|
include(CheckLinkerSupportsPIE)
|
||||||
|
|
|
@ -15,6 +15,20 @@ macro(bitcoincore_enable_language language)
|
||||||
set(CMAKE_PLATFORM_HAS_INSTALLNAME FALSE)
|
set(CMAKE_PLATFORM_HAS_INSTALLNAME FALSE)
|
||||||
endif()
|
endif()
|
||||||
enable_language(${language})
|
enable_language(${language})
|
||||||
|
|
||||||
|
set(_description "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.")
|
||||||
|
set(APPEND_CPPFLAGS "" CACHE STRING "Preprocessor ${_description}")
|
||||||
|
set(APPEND_LDFLAGS "" CACHE STRING "Linker ${_description}")
|
||||||
|
if("${language}" MATCHES "^C$")
|
||||||
|
set(APPEND_CFLAGS "" CACHE STRING "C compiler ${_description}")
|
||||||
|
endif()
|
||||||
|
if("${language}" MATCHES "^(CXX|OBJCXX)$")
|
||||||
|
set(APPEND_CXXFLAGS "" CACHE STRING "(Objective) C++ compiler ${_description}")
|
||||||
|
string(APPEND CMAKE_${language}_COMPILE_OBJECT " ${APPEND_CPPFLAGS} ${APPEND_CXXFLAGS}")
|
||||||
|
string(APPEND CMAKE_${language}_CREATE_SHARED_LIBRARY " ${APPEND_LDFLAGS}")
|
||||||
|
string(APPEND CMAKE_${language}_LINK_EXECUTABLE " ${APPEND_LDFLAGS}")
|
||||||
|
endif()
|
||||||
|
unset(_description)
|
||||||
endif()
|
endif()
|
||||||
unset(_enabled_languages)
|
unset(_enabled_languages)
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
|
@ -8,7 +8,6 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
|
||||||
set(CMAKE_OBJCXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}")
|
set(CMAKE_OBJCXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}")
|
||||||
set(CMAKE_OBJCXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}")
|
set(CMAKE_OBJCXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}")
|
||||||
set(CMAKE_OBJCXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL}")
|
set(CMAKE_OBJCXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL}")
|
||||||
string(APPEND CMAKE_OBJCXX_COMPILE_OBJECT " ${APPEND_CPPFLAGS} ${APPEND_CXXFLAGS}")
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
get_target_property(qt_lib_type Qt6::Core TYPE)
|
get_target_property(qt_lib_type Qt6::Core TYPE)
|
||||||
|
|
Loading…
Add table
Reference in a new issue