move static logic down

pull/39/head
wowario 3 years ago
parent ac096e5dc1
commit cbb5b68d02
No known key found for this signature in database
GPG Key ID: 24DCBE762DE9C111

@ -51,22 +51,6 @@ endif()
check_include_file(sys/prctl.h HAVE_SYS_PRCTL_H)
check_symbol_exists(prctl "sys/prctl.h" HAVE_PRCTL)
if(STATIC)
message(STATUS "Initiating static build, turning on manual submodules")
set(MANUAL_SUBMODULES 1)
# monero-project/unbound:monero has a fix for static builds, however, it's not merged in Monero yet, because
# it breaks their buildbot, since that still uses openssl 1.1.0 and we use openssl 1.1.1g. We need to
# manually set the unbound submodule the right commit that has the fix.
# This only works with -DMANUAL_SUBMODULES=1
message(STATUS "applying unbound static build fix contrib/unbound_static.patch")
execute_process(COMMAND bash -c "git -C ${CMAKE_SOURCE_DIR}/external/wownero/external/unbound apply ${CMAKE_SOURCE_DIR}/contrib/unbound_static.patch")
set(Boost_USE_STATIC_LIBS ON)
set(Boost_USE_STATIC_RUNTIME ON)
add_definitions(-DMONERO_GUI_STATIC)
endif()
function (add_c_flag_if_supported flag var)
string(REPLACE "-" "_" supported ${flag}_c)
check_c_compiler_flag(${flag} ${supported})
@ -134,6 +118,21 @@ set_property(TARGET wallet_merged PROPERTY FOLDER "external/wownero")
get_directory_property(ARCH_WIDTH DIRECTORY "external/wownero" DEFINITION ARCH_WIDTH)
get_directory_property(UNBOUND_LIBRARY DIRECTORY "external/wownero" DEFINITION UNBOUND_LIBRARY)
if(STATIC)
message(STATUS "Initiating static build, turning on manual submodules")
set(MANUAL_SUBMODULES 1)
# monero-project/unbound:monero has a fix for static builds, however, it's not merged in Monero yet, because
# it breaks their buildbot, since that still uses openssl 1.1.0 and we use openssl 1.1.1g. We need to
# manually set the unbound submodule the right commit that has the fix.
# This only works with -DMANUAL_SUBMODULES=1
message("\n${BoldYellow}applying unbound static build fix contrib/unbound_static.patch\n${ResetColor}")
execute_process(COMMAND bash -c "git -C ${CMAKE_SOURCE_DIR}/external/wownero/external/unbound apply ${CMAKE_SOURCE_DIR}/contrib/unbound_static.patch")
set(Boost_USE_STATIC_LIBS ON)
set(Boost_USE_STATIC_RUNTIME ON)
add_definitions(-DMONERO_GUI_STATIC)
endif()
include(CMakePackageConfigHelpers)
include(VersionWownero)

Loading…
Cancel
Save