From ec63ab1c54a749d6f4bbc4737cfd6c36bd13664a Mon Sep 17 00:00:00 2001 From: zig-for Date: Mon, 11 Jul 2022 02:28:31 -0700 Subject: [PATCH] Fix the cache --- .github/workflows/cmake.yml | 11 +++-------- CMakeLists.txt | 7 +++++++ CMakePresets.json | 5 ++++- triplets/x64-windows-static-release.cmake | 4 ++++ vcpkg.json | 2 +- 5 files changed, 19 insertions(+), 10 deletions(-) create mode 100644 triplets/x64-windows-static-release.cmake diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 55365dd..62bad44 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -14,22 +14,17 @@ env: jobs: build: runs-on: windows-latest - defaults: - run: - working-directory: C:/ steps: - uses: actions/checkout@v2 with: submodules: true + - run: mkdir C:/lukka-vcpkg # Install latest CMake. - uses: lukka/get-cmake@latest - name: Restore artifacts, or setup vcpkg (do not install any package) uses: lukka/run-vcpkg@v10 with: - # This is the default location of the directory containing vcpkg sources. - # Change it to the right location if needed. - vcpkgDirectory: 'C:/vcpkg' - + vcpkgDirectory: 'C:/lukka-vcpkg' # If not using a submodule for vcpkg sources, this specifies which commit # id must be checkout from a Git repo. It must not set if using a submodule # for vcpkg. @@ -52,7 +47,7 @@ jobs: # This is the default path to the CMakeLists.txt along side the # CMakePresets.json. Change if you need have CMakeLists.txt and CMakePresets.json # located elsewhere. - cmakeListsTxtPath: '${{ github.workspace }}/CMakeLists.txt' + # cmakeListsTxtPath: 'C:/snfm/CMakeLists.txt' # This is the name of the CMakePresets.json's configuration to use to generate # the project files. This configuration leverages the vcpkg.cmake toolchain file to diff --git a/CMakeLists.txt b/CMakeLists.txt index d8765c4..b2e9ca8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,6 +7,13 @@ project(snfm) set ( Protobuf_USE_STATIC_LIBS ON ) find_package(Protobuf REQUIRED) find_package(gRPC CONFIG REQUIRED) + +# Force wxwidgets to turn off debug build +set(wxWidgets_USE_DEBUG OFF) +# Workaround issue where wxwidgets can't find a release only build with the above flag +message(STATUS "WXWIDGETS DIR "${wxWidgets_LIB_DIR}) +set(wxWidgets_LIB_DIR ${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib) +message(STATUS "new WXWIDGETS DIR "${wxWidgets_LIB_DIR}) find_package(wxWidgets REQUIRED COMPONENTS core base) set(CMAKE_CXX_STANDARD 20) diff --git a/CMakePresets.json b/CMakePresets.json index af561d9..be6b824 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -15,7 +15,10 @@ "value": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake", "type": "FILEPATH" }, - "VCPKG_TARGET_TRIPLET": "x64-windows-static" + "VCPKG_TARGET_TRIPLET": "x64-windows-static-release" + }, + "environment": { + "VCPKG_OVERLAY_TRIPLETS": "${sourceDir}/triplets" }, "condition": { "type": "equals", diff --git a/triplets/x64-windows-static-release.cmake b/triplets/x64-windows-static-release.cmake new file mode 100644 index 0000000..4289491 --- /dev/null +++ b/triplets/x64-windows-static-release.cmake @@ -0,0 +1,4 @@ +set(VCPKG_TARGET_ARCHITECTURE x64) +set(VCPKG_CRT_LINKAGE static) +set(VCPKG_LIBRARY_LINKAGE static) +set(VCPKG_BUILD_TYPE release) diff --git a/vcpkg.json b/vcpkg.json index 663477f..2fce84d 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -12,4 +12,4 @@ }, "wxwidgets" ] -} \ No newline at end of file +}