From edc412c2cdcf2a42efb94ea20e0dca9f23859b79 Mon Sep 17 00:00:00 2001 From: xiaoyifang Date: Wed, 14 Dec 2022 18:00:15 +0800 Subject: [PATCH 1/2] github: cmake build action fix macos ,windows build error --- .github/workflows/cmake build test.yml | 5 +++-- CMakeLists.txt | 9 +++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cmake build test.yml b/.github/workflows/cmake build test.yml index da10e665..e6844679 100644 --- a/.github/workflows/cmake build test.yml +++ b/.github/workflows/cmake build test.yml @@ -76,8 +76,9 @@ jobs: - name: Run build-wrapper run: | - cmake . -DCMAKE_BUILD_TYPE=Release - cmake --build . + mkdir build_dir + cmake -S . -B build_dir -DCMAKE_BUILD_TYPE=Release + cmake --build build_dir --parallel 7 --config Release job3: name: macos Build and analyze runs-on: macos-12 diff --git a/CMakeLists.txt b/CMakeLists.txt index bf136187..770536d1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,7 +12,11 @@ if(UNIX AND NOT APPLE) endif() if (APPLE) + if(WITH_EPWING_SUPPORT) add_subdirectory(thirdparty/eb) + endif() + + include_directories(/usr/local/include /opt/homebrew/include) endif () project(goldendict @@ -477,6 +481,9 @@ if(MSVC) target_include_directories(${CMAKE_PROJECT_NAME} PUBLIC ${CMAKE_SOURCE_DIR}/winlibs/include/ ) + + set_property(TARGET ${CMAKE_PROJECT_NAME} PROPERTY + MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>DLL") endif() target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE @@ -491,7 +498,9 @@ target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE ) if(APPLE) + if(WITH_EPWING_SUPPORT) target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE eb) + endif() endif() if(UNIX) From b1e888cf18dabc900928ac4759077f7df7b19921 Mon Sep 17 00:00:00 2001 From: xiaoyifang Date: Thu, 15 Dec 2022 10:49:49 +0800 Subject: [PATCH 2/2] github: cmake build action ,windows runtime library --- .github/workflows/cmake build test.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cmake build test.yml b/.github/workflows/cmake build test.yml index e6844679..68886c46 100644 --- a/.github/workflows/cmake build test.yml +++ b/.github/workflows/cmake build test.yml @@ -76,9 +76,8 @@ jobs: - name: Run build-wrapper run: | - mkdir build_dir - cmake -S . -B build_dir -DCMAKE_BUILD_TYPE=Release - cmake --build build_dir --parallel 7 --config Release + cmake -S . -DCMAKE_BUILD_TYPE=Release + cmake --build . --config Release job3: name: macos Build and analyze runs-on: macos-12