Skip to content

Commit aaeea19

Browse files
committed
Update CI for x64
1 parent 36e3884 commit aaeea19

File tree

2 files changed

+39
-16
lines changed

2 files changed

+39
-16
lines changed

.github/workflows/main.yml

+28-12
Original file line numberDiff line numberDiff line change
@@ -5,50 +5,66 @@ jobs:
55
strategy:
66
matrix:
77
include:
8-
- platform: win32
8+
- platform: x64
99
os: windows-latest
10-
triplet: x86-windows
11-
# - platform: x64
12-
# os: windows-latest
13-
# triplet: x64-windows
10+
triplet: x64-windows
1411
runs-on: ${{ matrix.os }}
1512
env:
1613
VCPKG_DEFAULT_TRIPLET: ${{ matrix.triplet }}
1714
VCPKG_INSTALLED_DIR: ${{ github.workspace }}/vcpkg_installed/
1815
DEPS_DIR: ${{ github.workspace }}/vcpkg_installed/${{ matrix.triplet }}
16+
INST_DIR: ${{ github.workspace }}/install-prefix
1917
steps:
2018
- name: Checkout
2119
uses: actions/checkout@v2
2220
with:
2321
submodules: "recursive"
22+
2423
- name: run-vcpkg
2524
uses: lukka/run-vcpkg@v10
2625
with:
2726
vcpkgJsonGlob: "./vcpkg.json"
2827
runVcpkgInstall: true
28+
2929
- name: Setup MSBuild
3030
uses: microsoft/setup-msbuild@v1
31-
- name: Check dependencies
32-
run: "ls ${{ env.DEPS_DIR }}"
31+
32+
- name: Obtain and run CMake
33+
uses: threeal/[email protected]
34+
with:
35+
source-dir: "."
36+
build-dir: "build"
37+
generator: "Visual Studio 17 2022"
38+
options: CMAKE_TOOLCHAIN_FILE=vcpkg/scripts/buildsystems/vcpkg.cmake CMAKE_INSTALL_PREFIX="${{ env.INST_DIR }}"
39+
3340
- name: Build DLL
34-
run: "msbuild SimpleGraphic.vcxproj /p:configuration=release /p:platform=${{ matrix.platform }}"
41+
run: "cmake --build build --config Release -t INSTALL"
42+
3543
- name: Archive DLL
3644
uses: actions/upload-artifact@v3
3745
with:
3846
name: SimpleGraphic-${{ matrix.triplet }}.dll
39-
path: "${{ github.workspace }}/Release/SimpleGraphic.dll"
47+
path: "${{ env.INST_DIR }}/SimpleGraphic.dll"
48+
4049
- name: Archive DLL symbols
4150
uses: actions/upload-artifact@v3
4251
with:
4352
name: SimpleGraphic-${{ matrix.triplet }}.pdb
44-
path: "${{ github.workspace }}/Release/SimpleGraphic.pdb"
53+
path: "${{ github.workspace }}/build/Release/SimpleGraphic.pdb"
54+
4555
- name: Archive dependency DLLs
4656
uses: actions/upload-artifact@v3
4757
with:
4858
name: SimpleGraphic-${{ matrix.triplet }}-deps.dll
49-
path: "${{ env.DEPS_DIR }}/bin/*.dll"
59+
path: |
60+
${{ env.INST_DIR }}/*.dll
61+
!${{ env.INST_DIR }}/SimpleGraphic.dll
62+
5063
- name: Archive dependency DLL symbols
5164
uses: actions/upload-artifact@v3
5265
with:
5366
name: SimpleGraphic-${{ matrix.triplet }}-deps.pdb
54-
path: "${{ env.DEPS_DIR }}/bin/*.pdb"
67+
path: |
68+
${{ env.DEPS_DIR }}/bin/*.pdb
69+
${{ github.workspace }}/build/Release/lzip.pdb
70+
${{ github.workspace }}/build/Release/lcurl.pdb

CMakeLists.txt

+11-4
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
1-
project(SimpleGraphic C CXX)
21
cmake_minimum_required(VERSION 3.15)
2+
project(SimpleGraphic C CXX)
33
set(CMAKE_CXX_STANDARD_REQUIRED ON)
44
set(CMAKE_CXX_STANDARD 17)
55

66
if (APPLE)
77
enable_language(OBJCXX)
88
endif ()
99

10+
if (MSVC)
11+
add_compile_options("/Zi")
12+
add_link_options("/DEBUG")
13+
endif ()
14+
1015
list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake")
1116

1217
include(${PROJECT_SOURCE_DIR}/vcpkg/scripts/buildsystems/vcpkg.cmake)
@@ -75,7 +80,6 @@ add_library(SimpleGraphic SHARED
7580
${SIMPLEGRAPHIC_SOURCES}
7681
${SIMPLEGRAPHIC_PLATFORM_SOURCES}
7782
)
78-
7983
target_compile_definitions(SimpleGraphic
8084
PRIVATE
8185
"UNICODE"
@@ -186,8 +190,11 @@ install(FILES $<TARGET_RUNTIME_DLLS:SimpleGraphic> DESTINATION ".")
186190
install(TARGETS SimpleGraphic RUNTIME DESTINATION ".")
187191

188192
if (WIN32)
189-
find_file(LUAJIT_DLL NAMES "lua51.dll" PATHS "${CMAKE_BINARY_DIR}" REQUIRED)
190-
find_file(ZLIB_DLL NAMES "zlib1.dll" PATHS "${CMAKE_BINARY_DIR}" REQUIRED)
193+
if (DEFINED ENV{DEPS_DIR})
194+
set(DEPS_BIN_DIR ${DEPS_DIR}/bin)
195+
endif ()
196+
find_file(LUAJIT_DLL NAMES "lua51.dll" PATHS "${CMAKE_BINARY_DIR}" ${DEPS_BIN_DIR} REQUIRED)
197+
find_file(ZLIB_DLL NAMES "zlib1.dll" PATHS "${CMAKE_BINARY_DIR}" ${DEPS_BIN_DIR} REQUIRED)
191198
install(FILES ${LUAJIT_DLL} ${ZLIB_DLL} DESTINATION ".")
192199
endif ()
193200

0 commit comments

Comments
 (0)