Skip to content

Commit e84cbac

Browse files
committed
thanm: fix windows build error in github actions
maybe libjpeg-turbo can be replaced with ijg-libjpeg.
1 parent c076e74 commit e84cbac

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

.github/workflows/build.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,12 @@ jobs:
4949
mkdir bison
5050
cd bison
5151
7z x ../win_flex_bison-${{env.FLEXBISON_VER}}.zip
52+
- name: Integrate vcpkg
53+
run: vcpkg integrate install
54+
- name: Install libjpeg
55+
run: vcpkg install libjpeg-turbo:${{matrix.arch}}-windows-static
5256
- name: Configure CMake
53-
run: cmake -B build -A ${{matrix.arch == 'x86' && 'Win32' || matrix.arch}} -DBISON_EXECUTABLE=${{github.workspace}}/bison/win_bison.exe -DFLEX_EXECUTABLE=${{github.workspace}}/bison/win_flex.exe -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
57+
run: cmake -B build -A ${{matrix.arch == 'x86' && 'Win32' || matrix.arch}} -DBISON_EXECUTABLE=${{github.workspace}}/bison/win_bison.exe -DFLEX_EXECUTABLE=${{github.workspace}}/bison/win_flex.exe -DJPEG_INCLUDE_DIR=C:/vcpkg/packages/libjpeg-turbo_${{matrix.arch}}-windows-static/include/ -DJPEG_LIBRARY_RELEASE=C:/vcpkg/packages/libjpeg-turbo_${{matrix.arch}}-windows-static/lib/jpeg.lib -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
5458
- name: Build
5559
run: cmake --build build --config ${{env.BUILD_TYPE}}
5660
- name: Prepare Dist

INSTALL

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ Build requirements:
22
cmake >=3.14
33
flex >=2.5.31
44
bison >=3.6.4
5+
libjpeg >= 8.0
56
(optional) pkg-config
67
(optional) zlib
78
(optional) libpng

thanm/CMakeLists.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
find_package(BISON REQUIRED)
22
find_package(FLEX REQUIRED)
3+
find_package(JPEG REQUIRED)
34
bison_target(AnmParse anmparse.y ${CMAKE_CURRENT_BINARY_DIR}/anmparse.c COMPILE_FLAGS ${BISON_FLAGS})
45
flex_target(AnmScan anmscan.l ${CMAKE_CURRENT_BINARY_DIR}/anmscan.c)
56
add_flex_bison_dependency(AnmScan AnmParse)
@@ -8,7 +9,7 @@ add_executable(thanm
89
thanm.c image.c anmmap.c reg.c expr.c
910
thanm.h image.h anmmap.h reg.h expr.h
1011
)
11-
target_include_directories(thanm PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR})
12-
target_link_libraries(thanm PRIVATE util $<$<BOOL:${PNG_FOUND}>:PNG::PNG> math setargv thtk_warning jpeg)
12+
target_include_directories(thanm PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} ${JPEG_INCLUDE_DIR})
13+
target_link_libraries(thanm PRIVATE util $<$<BOOL:${PNG_FOUND}>:PNG::PNG> math setargv thtk_warning ${JPEG_LIBRARY_RELEASE})
1314
install(TARGETS thanm)
1415
install(FILES thanm.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)

0 commit comments

Comments
 (0)