cmake: Add cross-compiling support
To configure CMake for cross-compiling, use
`--toolchain depends/${HOST}/toolchain.cmake` command-line option.
This commit is contained in:
3 files changed
+29
-4
No files matched your search
@@ -479,6 +479,19 @@ else()
|
||||
)
|
||||
endif()
|
||||
|
||||
target_compile_definitions(core_interface INTERFACE ${DEPENDS_COMPILE_DEFINITIONS})
|
||||
target_compile_definitions(core_interface_relwithdebinfo INTERFACE ${DEPENDS_COMPILE_DEFINITIONS_RELWITHDEBINFO})
|
||||
target_compile_definitions(core_interface_debug INTERFACE ${DEPENDS_COMPILE_DEFINITIONS_DEBUG})
|
||||
|
||||
# If the {CXX,LD}FLAGS environment variables are defined during building depends
|
||||
# and configuring this build system, their content might be duplicated.
|
||||
if(DEFINED ENV{CXXFLAGS})
|
||||
deduplicate_flags(CMAKE_CXX_FLAGS)
|
||||
endif()
|
||||
if(DEFINED ENV{LDFLAGS})
|
||||
deduplicate_flags(CMAKE_EXE_LINKER_FLAGS)
|
||||
endif()
|
||||
|
||||
if(BUILD_TESTS)
|
||||
enable_testing()
|
||||
endif()
|
||||
@@ -538,6 +551,12 @@ message(" test_bitcoin-qt ..................... ${BUILD_GUI_TESTS}")
|
||||
message(" bench_bitcoin ....................... ${BUILD_BENCH}")
|
||||
message(" fuzz binary ......................... ${BUILD_FUZZ_BINARY}")
|
||||
message("")
|
||||
if(CMAKE_CROSSCOMPILING)
|
||||
set(cross_status "TRUE, for ${CMAKE_SYSTEM_NAME}, ${CMAKE_SYSTEM_PROCESSOR}")
|
||||
else()
|
||||
set(cross_status "FALSE")
|
||||
endif()
|
||||
message("Cross compiling ....................... ${cross_status}")
|
||||
message("C++ compiler .......................... ${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION}, ${CMAKE_CXX_COMPILER}")
|
||||
include(FlagsSummary)
|
||||
flags_summary()
|
||||
|
||||
Reference in new issue
Block a user