diff options
author | saturneric <[email protected]> | 2024-04-28 17:43:39 +0000 |
---|---|---|
committer | saturneric <[email protected]> | 2024-04-28 17:43:39 +0000 |
commit | 4d71df71a7b420433ef8927a7b5b601ec26159be (patch) | |
tree | 1b3168a9f46d3071d99c598976e9140d6e654218 | |
parent | fix: --team-id line missing '\' (diff) | |
download | GpgFrontend-4d71df71a7b420433ef8927a7b5b601ec26159be.tar.gz GpgFrontend-4d71df71a7b420433ef8927a7b5b601ec26159be.zip |
feat: add the build mods only option for macos ci
-rw-r--r-- | .github/workflows/release.yml | 12 | ||||
-rw-r--r-- | CMakeLists.txt | 29 | ||||
-rw-r--r-- | src/CMakeLists.txt | 38 |
3 files changed, 52 insertions, 27 deletions
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4d265f4b..2b2ee1f0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -175,6 +175,13 @@ jobs: cmake --build ${{github.workspace}}/build --config {{$env.BUILD_TYPE}} -- -v if: matrix.os == 'ubuntu-20.04' + - name: Build Integrated Modules (macOS) + # Build your GpgFrontend with the given configuration + run: | + cmake -B ${{github.workspace}}/build-mods -G Ninja -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DGPGFRONTEND_BUILD_MODS_ONLY=On + cmake --build ${{github.workspace}}/build-mods --config {{$env.BUILD_TYPE}} -- -v + if: matrix.os == 'macos-11' || matrix.os == 'macos-12' + - name: Build & Export GpgFrontend (macOS) # Build your GpgFrontend with the given configuration run: | @@ -195,6 +202,11 @@ jobs: -exportPath ${{github.workspace}}/build/package/ if: matrix.os == 'macos-11' || matrix.os == 'macos-12' + - name: Copy Modules into Bundle (macOS) + run: | + cmake -E copy_directory ${GITHUB_WORKSPACE}/build-mods/artifacts/mods ${GITHUB_WORKSPACE}/build/package/GpgFrontend.app/Contents/PlugIns/mods + if: matrix.os == 'macos-11' || matrix.os == 'macos-12' + - name: Package & Sign App Bundle (macOS) run: | security -v unlock-keychain -p gpgfrontend diff --git a/CMakeLists.txt b/CMakeLists.txt index f8207965..82f3a280 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -28,6 +28,7 @@ cmake_minimum_required(VERSION 3.16) message(STATUS "Current Generator: ${CMAKE_GENERATOR}") if(CMAKE_GENERATOR STREQUAL "Xcode") set(CMAKE_USER_MAKE_RULES_OVERRIDE "${CMAKE_SOURCE_DIR}/cmake/FlagsOverridesXcode.cmake") + set(XCODE_BUILD 1) else() set(CMAKE_USER_MAKE_RULES_OVERRIDE "${CMAKE_SOURCE_DIR}/cmake/FlagsOverrides.cmake") endif() @@ -66,6 +67,8 @@ option(GPGFRONTEND_BUILD_TYPE_STABLE "Generate release version" ON) option(GPGFRONTEND_QT5_BUILD "Swith to Qt5 building mode" OFF) option(GPGFRONTEND_GENERATE_LINUX_INSTALL_SOFTWARE "Generate an installable version" OFF) +option(GPGFRONTEND_BUILD_MODS_ONLY "Build Modules Only" OFF) + option(GPGFRONTEND_XCODE_TEAM_ID "GpgFrontend Apple Team ID" "NONE") option(GPGFRONTEND_XOCDE_CODE_SIGN_IDENTITY "GpgFrontend Signing Certificate" "NONE") option(GPGFRONTEND_XOCDE_APPID "GpgFrontend Apple AppID" "NONE") @@ -93,6 +96,10 @@ if (GPGFRONTEND_BUILD_TYPE_TEST_ALL) set(GPGFRONTEND_BUILD_CONFIG "test_all") endif () +# Specify compilation mode +message(STATUS "Switch Build Configure STABLE_BUILD_APPLICATION") +set(STABLE_BUILD_APPLICATION 1) + # stable features if (GPGFRONTEND_BUILD_TYPE_STABLE) @@ -117,6 +124,17 @@ if (GPGFRONTEND_GENERATE_LINUX_INSTALL_SOFTWARE) set(LINUX_INSTALL_SOFTWARE 1) endif () +if (GPGFRONTEND_BUILD_MODS_ONLY) + set(GPGFRONTEND_BUILD_TYPE_TEST_CORE 0) + set(GPGFRONTEND_BUILD_TYPE_TEST_CORE_AND_COVERAGE 0) + set(GPGFRONTEND_BUILD_TYPE_TEST_UI 0) + set(GPGFRONTEND_BUILD_TYPE_TEST_ALL 0) + unset(GPGFRONTEND_BUILD_CONFIG) + + set(STABLE_BUILD_APPLICATION 0) + set(BUILD_MODS_ONLY 1) +endif() + # C++ # options for ccache @@ -179,7 +197,6 @@ endif() if (CMAKE_BUILD_TYPE STREQUAL "Release" AND APPLE) set(GPGFRONTEND_GENERATE_LINUX_INSTALL_SOFTWARE 0) set(LINUX_INSTALL_SOFTWARE 0) - set(XCODE_BUILD 1) set(GPGFRONTEND_BUILD_TYPE_TEST_CORE 0) set(GPGFRONTEND_BUILD_TYPE_TEST_CORE_AND_COVERAGE 0) @@ -187,13 +204,8 @@ if (CMAKE_BUILD_TYPE STREQUAL "Release" AND APPLE) set(GPGFRONTEND_BUILD_TYPE_TEST_ALL 0) unset(GPGFRONTEND_BUILD_CONFIG) - set(STABLE_BUILD_APPLICATION 1) endif () - -# Specify compilation mode -message(STATUS "Switch Build Configure STABLE_BUILD_APPLICATION") -set(STABLE_BUILD_APPLICATION 1) set(AppName GpgFrontend) # Get Git Information @@ -357,8 +369,11 @@ if (STABLE_BUILD_APPLICATION) set(BUILD_MODULE 1) set(BUILD_TEST 1) set(BUILD_APPLICATION 1) - set(BASIC_ENV_CONFIG 1) set(SUPPORT_MULTI_LANG 1) +elseif (BUILD_MODS_ONLY) + message("[+] Build Mods") + set(BUILD_CORE 1) + set(BUILD_MODULE 1) endif () # For instance in order to select the highest version one diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 34dd88e8..c4d8a56b 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -73,20 +73,29 @@ set(CMAKE_AUTOUIC ON) set(CMAKE_AUTORCC_OPTIONS "--compress;9") set(CMAKE_AUTOUIC_SEARCH_PATHS ${CMAKE_AUTOUIC_SEARCH_PATHS} ${CMAKE_SOURCE_DIR}/ui) +# Set Build Information +configure_file(${CMAKE_SOURCE_DIR}/src/GpgFrontend.h.in ${CMAKE_SOURCE_DIR}/src/GpgFrontend.h @ONLY) +configure_file(${CMAKE_SOURCE_DIR}/src/GpgFrontendBuildInfo.h.in ${CMAKE_SOURCE_DIR}/src/GpgFrontendBuildInfo.h @ONLY) +configure_file(${CMAKE_SOURCE_DIR}/src/GpgFrontendBuildInstallInfo.h.in ${CMAKE_SOURCE_DIR}/src/GpgFrontendBuildInstallInfo.h @ONLY) +configure_file(${CMAKE_SOURCE_DIR}/src/module/sdk/GFSDKBuildInfo.h.in ${CMAKE_SOURCE_DIR}/src/module/sdk/GFSDKBuildInfo.h @ONLY) +if (APPLE) + configure_file(${CMAKE_SOURCE_DIR}/resource/plist/ExportOptions.plist.in ${CMAKE_BINARY_DIR}/ExportOptions.plist @ONLY) +endif () + +# Set Runtime Output Directory +if (NOT XCODE_BUILD) + # Set Binary Output Path + set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/artifacts) +else () + # Set Binary Output Path + set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_BUILD_TYPE}) +endif () # configure for output path and resources if (BUILD_APPLICATION) aux_source_directory(. BASE_SOURCE) set(APP_ICON_RESOURCE_WINDOWS "${CMAKE_SOURCE_DIR}/gpgfrontend.rc") set_property(SOURCE gpgfrontend.rc APPEND PROPERTY OBJECT_DEPENDS ${CMAKE_SOURCE_DIR}/gpgfrontend.ico) - - if (NOT XCODE_BUILD) - # Set Binary Output Path - set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/artifacts) - else () - # Set Binary Output Path - set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_BUILD_TYPE}) - endif () endif () if (BUILD_CORE) @@ -135,17 +144,6 @@ if (BUILD_APPLICATION) endif () endif () -if (BASIC_ENV_CONFIG) - # Set Build Information - configure_file(${CMAKE_SOURCE_DIR}/src/GpgFrontend.h.in ${CMAKE_SOURCE_DIR}/src/GpgFrontend.h @ONLY) - configure_file(${CMAKE_SOURCE_DIR}/src/GpgFrontendBuildInfo.h.in ${CMAKE_SOURCE_DIR}/src/GpgFrontendBuildInfo.h @ONLY) - configure_file(${CMAKE_SOURCE_DIR}/src/GpgFrontendBuildInstallInfo.h.in ${CMAKE_SOURCE_DIR}/src/GpgFrontendBuildInstallInfo.h @ONLY) - configure_file(${CMAKE_SOURCE_DIR}/src/module/sdk/GFSDKBuildInfo.h.in ${CMAKE_SOURCE_DIR}/src/module/sdk/GFSDKBuildInfo.h @ONLY) - if (APPLE) - configure_file(${CMAKE_SOURCE_DIR}/resource/plist/ExportOptions.plist.in ${CMAKE_BINARY_DIR}/ExportOptions.plist @ONLY) - endif () -endif () - if (BUILD_APPLICATION) if (${CMAKE_BUILD_TYPE} STREQUAL "Release") if (APPLE) @@ -356,7 +354,7 @@ if (BUILD_APPLICATION) COMMAND ${CMAKE_COMMAND} -E rename "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/mods" "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/AppDir/usr/lib/mods" COMMENT "Copying Mods into App Image" ) - + # app bundle packing using xcode elseif (APPLE AND XCODE_BUILD) # standard app bundle packing |