From bac3f9dca11d364bc55beaf67e9c382b8cd48683 Mon Sep 17 00:00:00 2001 From: Jason Rhinelander Date: Mon, 3 Oct 2022 12:18:40 -0300 Subject: [PATCH] fix macos assemble_gui dependency The `sign` target on macos was not working properly -- the signing script would run before the build is finished. This was caused by cmake/macos.cmake having an `if(BUILD_GUI)`, but BUILD_GUI isn't defined as an option until cmake/gui.cmake, which hadn't been included yet where macos.cmake was included. This extracts just the `option(BUIL_GUI)` from gui.cmake into a separate gui-option.cmake file that we can load earlier to fix it. While here I also noticed the GUI_EXE setting was defined as an option, but isn't actually a boolean value, as an option, but isn't actually a boolean value, so fixed it by making it a `set(... CACHE FILEPATH ...)`. --- CMakeLists.txt | 2 ++ cmake/gui-option.cmake | 6 ++++++ cmake/gui.cmake | 11 ++--------- 3 files changed, 10 insertions(+), 9 deletions(-) create mode 100644 cmake/gui-option.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index ae7e094fa..8c2145e5e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -114,6 +114,8 @@ if (STATIC_LINK) message(STATUS "setting static library suffix search") endif() +include(cmake/gui-option.cmake) + include(cmake/solaris.cmake) include(cmake/win32.cmake) include(cmake/macos.cmake) diff --git a/cmake/gui-option.cmake b/cmake/gui-option.cmake new file mode 100644 index 000000000..323f201fa --- /dev/null +++ b/cmake/gui-option.cmake @@ -0,0 +1,6 @@ +set(default_build_gui OFF) +if(APPLE OR WIN32) + set(default_build_gui ON) +endif() + +option(BUILD_GUI "build electron gui from 'gui' submodule source" ${default_build_gui}) diff --git a/cmake/gui.cmake b/cmake/gui.cmake index fcb81b2fd..7bf8cc27b 100644 --- a/cmake/gui.cmake +++ b/cmake/gui.cmake @@ -1,22 +1,15 @@ -set(default_build_gui OFF) + set(default_gui_target pack) if(APPLE) - set(default_build_gui ON) set(default_gui_target macos:raw) elseif(WIN32) - set(default_build_gui ON) set(default_gui_target win32) + set(GUI_EXE "" CACHE FILEPATH "path to an externally built lokinet gui.exe") endif() -if(WIN32) - option(GUI_EXE "path to an externally built lokinet gui.exe" OFF) -endif() - -option(BUILD_GUI "build electron gui from 'gui' submodule source" ${default_build_gui}) set(GUI_YARN_TARGET "${default_gui_target}" CACHE STRING "yarn target for building the GUI") set(GUI_YARN_EXTRA_OPTS "" CACHE STRING "extra options to pass into the yarn build command") - if (BUILD_GUI) message(STATUS "Building lokinet-gui") # allow manually specifying yarn with -DYARN=