@@ -52,14 +52,16 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
5252set (CMAKE_CXX_EXTENSIONS OFF )
5353
5454set (configure_warnings)
55- if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.14)
56- include (CheckPIESupported)
57- check_pie_supported(OUTPUT_VARIABLE check_pie_output LANGUAGES CXX)
58- if (NOT CMAKE_CXX_LINK_PIE_SUPPORTED)
59- list (APPEND configure_warnings "PIE link options are not supported for executable targets: ${check_pie_output} ." )
55+ if (NOT CMAKE_CROSSCOMPILING )
56+ if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.14)
57+ include (CheckPIESupported)
58+ check_pie_supported(OUTPUT_VARIABLE check_pie_output LANGUAGES CXX)
59+ if (NOT CMAKE_CXX_LINK_PIE_SUPPORTED)
60+ list (APPEND configure_warnings "PIE link options are not supported for executable targets: ${check_pie_output} ." )
61+ endif ()
62+ else ()
63+ list (APPEND configure_warnings "No PIE options will be passed to a linker for executable targets." )
6064 endif ()
61- else ()
62- list (APPEND configure_warnings "No PIE options will be passed to a linker for executable targets." )
6365endif ()
6466set (CMAKE_POSITION_INDEPENDENT_CODE ON )
6567
@@ -98,6 +100,10 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
98100 add_compile_definitions (MAC_OSX)
99101endif ()
100102
103+ if (CMAKE_CROSSCOMPILING AND DEPENDS_ALLOW_HOST_PACKAGES)
104+ list (APPEND CMAKE_FIND_ROOT_PATH "${CMAKE_SYSTEM_PREFIX_PATH} " )
105+ endif ()
106+
101107include (AddThreadsIfNeeded)
102108add_threads_if_needed()
103109
@@ -127,6 +133,12 @@ message("=================")
127133message ("Executables:" )
128134message (" bitcoind ............................ ${BUILD_DAEMON} " )
129135message ("" )
136+ if (CMAKE_CROSSCOMPILING )
137+ set (cross_status "TRUE, for ${CMAKE_SYSTEM_NAME} , ${CMAKE_SYSTEM_PROCESSOR} " )
138+ else ()
139+ set (cross_status "FALSE" )
140+ endif ()
141+ message ("Cross compiling ....................... ${cross_status} " )
130142get_directory_property (definitions COMPILE_DEFINITIONS )
131143string (REPLACE ";" " " definitions "${definitions} " )
132144message ("Preprocessor defined macros ........... ${definitions} " )
0 commit comments