diff options
author | Saturneric <[email protected]> | 2022-01-13 03:01:08 +0000 |
---|---|---|
committer | Saturneric <[email protected]> | 2022-01-13 03:48:10 +0000 |
commit | 90c07542e859b741b100fcb0cc5c081e1e8b2c14 (patch) | |
tree | 819726dbf7cfa9dfa78b121df6d7407d890bfe12 | |
parent | <chore>(project, resource, ci): fix ci of debug.yml (diff) | |
download | GpgFrontend-90c07542e859b741b100fcb0cc5c081e1e8b2c14.tar.gz GpgFrontend-90c07542e859b741b100fcb0cc5c081e1e8b2c14.zip |
<chore>(project, resource, ci): fix ci of debug.yml & release.yml
1. Adjust the ci configuration file for Linux, macOS and Windows.
2. Fixed the problem of OpenSSL under macOS.
3. Use atexit instead of on_exit to solve macOS compatibility issues.
Diffstat (limited to '')
-rw-r--r-- | .github/workflows/debug.yml | 12 | ||||
-rw-r--r-- | .github/workflows/release.yml | 65 | ||||
-rw-r--r-- | src/before_exit.cpp | 4 | ||||
-rw-r--r-- | src/main.cpp | 4 | ||||
-rw-r--r-- | src/ui/CMakeLists.txt | 11 |
5 files changed, 30 insertions, 66 deletions
diff --git a/.github/workflows/debug.yml b/.github/workflows/debug.yml index 496e42a7..190997ae 100644 --- a/.github/workflows/debug.yml +++ b/.github/workflows/debug.yml @@ -94,16 +94,6 @@ jobs: pacman --noconfirm -S --needed mingw-w64-x86_64-gpgme mingw-w64-x86_64-gnupg if: matrix.os == 'windows-latest' - - name: Build GpgME (Windows) - shell: msys2 {0} - run: | - git clone https://github.com/saturneric/gpgme - cd gpgme - ./autogen.sh - ./configure --enable-maintainer-mode --enable-static=yes --disable-gpg-test --enable-languages=cpp LDFLAGS="-static" && make -j2 - make install - if: matrix.os == 'windows-latest' - - name: Build GpgFrontend (Linux) # Build your GpgFrontend with the given configuration run: | @@ -125,7 +115,7 @@ jobs: mkdir build && cd build cmake -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DGPGFRONTEND_BUILD_TYPE_TEST_UI=ON .. # Build your program with the given configuration - cmake --build . --config ${{env.BUILD_TYPE}} -- -v + cmake --build . --config ${{env.BUILD_TYPE}} -- -j 2 if: matrix.os == 'windows-latest' - name: Get Short SHA of Commit diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 63ccfbe3..400b62de 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -63,12 +63,12 @@ jobs: - name: Install Dependence (macOS) run: | - brew install cmake git autoconf automake qt@5 gcc texinfo gettext libgpg-error libassuan gpgme openssl - brew install boost libconfig gettext + brew install cmake git autoconf automake qt@5 gcc texinfo gettext gpgme [email protected] + brew install boost libconfig gettext ninja brew unlink gettext && brew link --force gettext brew link qt@5 brew link gcc - brew link openssl --force + brew link [email protected] --force if: matrix.os == 'macos-10.15' - name: Cache Qt @@ -95,58 +95,25 @@ jobs: - name: Set up Dependence (Windows) shell: msys2 {0} run: | - pacman --noconfirm -S --needed mingw-w64-x86_64-gcc mingw-w64-x86_64-make mingw-w64-x86_64-cmake autoconf automake mingw-w64-x86_64-gpgme - pacman --noconfirm -S --needed make texinfo mingw-w64-x86_64-libconfig mingw-w64-x86_64-boost mingw-w64-x86_64-gnupg gettext-devel libintl msys2-runtime-devel - pacman --noconfirm -S --needed mingw-w64-x86_64-qt5 + pacman --noconfirm -S --needed mingw-w64-x86_64-gcc mingw-w64-x86_64-make mingw-w64-x86_64-cmake autoconf + pacman --noconfirm -S --needed make texinfo mingw-w64-x86_64-libconfig mingw-w64-x86_64-boost automake + pacman --noconfirm -S --needed mingw-w64-x86_64-qt5 libintl msys2-runtime-devel gettext-devel + pacman --noconfirm -S --needed mingw-w64-x86_64-gpgme mingw-w64-x86_64-gnupg if: matrix.os == 'windows-latest' - - name: Build gpg-error (Linux) + - name: Build GpgFrontend (Linux) + # Build your GpgFrontend with the given configuration run: | - cd ${{github.workspace}}/third_party/libgpg-error - ./autogen.sh - ./configure --enable-maintainer-mode --enable-static=yes && make -j2 - sudo make install - cd ${{github.workspace}} + cmake -B ${{github.workspace}}/build -G Ninja -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} + cmake --build ${{github.workspace}}/build --config {{$env.BUILD_TYPE}} -- -v if: matrix.os == 'ubuntu-18.04' - - name: Build assuan (Linux) + - name: Build GpgFrontend (macOS) + # Build your GpgFrontend with the given configuration run: | - cd ${{github.workspace}}/third_party/libassuan - ./autogen.sh - ./configure --enable-maintainer-mode --enable-static=yes && make -j2 - sudo make install - cd ${{github.workspace}} - if: matrix.os == 'ubuntu-18.04' - - - name: Build GpgME (Linux & macOS) - run: | - cd ${{github.workspace}}/third_party/gpgme - ./autogen.sh - ./configure --enable-maintainer-mode --enable-static=yes --enable-languages=cpp && make -j2 - sudo make install - cd ${{github.workspace}} - if: matrix.os == 'ubuntu-18.04' || matrix.os == 'macos-10.15' - - - name: Build GpgME (Windows) - shell: msys2 {0} - run: | - git clone https://github.com/saturneric/gpgme - cd gpgme - ./autogen.sh - ./configure --enable-maintainer-mode --enable-static=yes --disable-gpg-test --enable-languages=cpp LDFLAGS="-static" && make -j2 - make install - if: matrix.os == 'windows-latest' - - - name: Configure CMake - # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. - # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type - run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DGPGFRONTEND_BUILD_TYPE_STABLE=ON - if: matrix.os == 'ubuntu-18.04' || matrix.os == 'macos-10.15' - - - name: Build GpgFrontend - # Build your program with the given configuration - run: cmake --build ${{github.workspace}}/build --config {{$env.BUILD_TYPE}} -- -j 2 - if: matrix.os == 'ubuntu-18.04' || matrix.os == 'macos-10.15' + cmake -B ${{github.workspace}}/build -G Ninja -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DOPENSSL_ROOT_DIR=/usr/local/opt/[email protected] + cmake --build ${{github.workspace}}/build --config {{$env.BUILD_TYPE}} -- -v + if: matrix.os == 'macos-10.15' - name: Build & Sign App Bundle (macOS) run: | diff --git a/src/before_exit.cpp b/src/before_exit.cpp index 53878758..074db049 100644 --- a/src/before_exit.cpp +++ b/src/before_exit.cpp @@ -24,7 +24,7 @@ #include "ui/settings/GlobalSettingStation.h" -void before_exit(int status, void *arg) { - LOG(INFO) << "called exit status" << status; +void before_exit() { + LOG(INFO) << "called"; GpgFrontend::UI::GlobalSettingStation::GetInstance().ResetRootCerts(); } diff --git a/src/main.cpp b/src/main.cpp index 06edc084..fef03eb8 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -41,7 +41,7 @@ extern void init_logging(); extern void init_certs(); extern void init_locale(); extern void handle_signal(int sig); -extern void before_exit(int status, void* arg); +extern void before_exit(); int main(int argc, char* argv[]) { // Register Signals @@ -50,7 +50,7 @@ int main(int argc, char* argv[]) { signal(SIGILL, handle_signal); // clean something before exit - on_exit(before_exit, nullptr); + atexit(before_exit); // Qt Q_INIT_RESOURCE(gpgfrontend); diff --git a/src/ui/CMakeLists.txt b/src/ui/CMakeLists.txt index 2b18e971..4db300da 100644 --- a/src/ui/CMakeLists.txt +++ b/src/ui/CMakeLists.txt @@ -32,9 +32,16 @@ target_link_libraries(${GPGFRONTEND_UI_LIB_NAME} # link Qt target_link_libraries(${GPGFRONTEND_UI_LIB_NAME} Qt5::Network Qt5::PrintSupport Qt5::Widgets Qt5::Test Qt5::Core) + # link vmime -target_link_libraries(${GPGFRONTEND_UI_LIB_NAME} - gpgfrontend_vmime anl ssl crypto) +if (APPLE) + target_link_libraries(${GPGFRONTEND_UI_LIB_NAME} + gpgfrontend_vmime ssl crypto) +else () + target_link_libraries(${GPGFRONTEND_UI_LIB_NAME} + gpgfrontend_vmime anl ssl crypto) +endif () + # link easyloggingpp target_link_libraries(${GPGFRONTEND_UI_LIB_NAME} easyloggingpp) |