Skip to content

Commit

Permalink
Fix the cache
Browse files Browse the repository at this point in the history
  • Loading branch information
zig-for authored Jul 11, 2022
1 parent 37f02dd commit ec63ab1
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 10 deletions.
11 changes: 3 additions & 8 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
Expand Down
7 changes: 7 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 4 additions & 1 deletion CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 4 additions & 0 deletions triplets/x64-windows-static-release.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
set(VCPKG_TARGET_ARCHITECTURE x64)
set(VCPKG_CRT_LINKAGE static)
set(VCPKG_LIBRARY_LINKAGE static)
set(VCPKG_BUILD_TYPE release)
2 changes: 1 addition & 1 deletion vcpkg.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@
},
"wxwidgets"
]
}
}

0 comments on commit ec63ab1

Please sign in to comment.