From cbb5b68d025b36d0db46cb38a959160c90fd691f Mon Sep 17 00:00:00 2001 From: wowario Date: Tue, 6 Apr 2021 20:52:37 +0300 Subject: [PATCH] move static logic down --- CMakeLists.txt | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 522423d..d0077bc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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)