Skip to content

Commit 4b114a2

Browse files
committed
Initial commit
0 parents  commit 4b114a2

20 files changed

+1875
-0
lines changed

.gitattributes

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
###############################################################################
2+
# Set default behavior to automatically normalize line endings.
3+
###############################################################################
4+
* text=auto
5+
6+
###############################################################################
7+
# Set default behavior for command prompt diff.
8+
#
9+
# This is need for earlier builds of msysgit that does not have it on by
10+
# default for csharp files.
11+
# Note: This is only used by command line
12+
###############################################################################
13+
#*.cs diff=csharp
14+
15+
###############################################################################
16+
# Set the merge driver for project and solution files
17+
#
18+
# Merging from the command prompt will add diff markers to the files if there
19+
# are conflicts (Merging from VS is not affected by the settings below, in VS
20+
# the diff markers are never inserted). Diff markers may cause the following
21+
# file extensions to fail to load in VS. An alternative would be to treat
22+
# these files as binary and thus will always conflict and require user
23+
# intervention with every merge. To do so, just uncomment the entries below
24+
###############################################################################
25+
#*.sln merge=binary
26+
#*.csproj merge=binary
27+
#*.vbproj merge=binary
28+
#*.vcxproj merge=binary
29+
#*.vcproj merge=binary
30+
#*.dbproj merge=binary
31+
#*.fsproj merge=binary
32+
#*.lsproj merge=binary
33+
#*.wixproj merge=binary
34+
#*.modelproj merge=binary
35+
#*.sqlproj merge=binary
36+
#*.wwaproj merge=binary
37+
38+
###############################################################################
39+
# behavior for image files
40+
#
41+
# image files are treated as binary by default.
42+
###############################################################################
43+
#*.jpg binary
44+
#*.png binary
45+
#*.gif binary
46+
47+
###############################################################################
48+
# diff behavior for common document formats
49+
#
50+
# Convert binary document formats to text before diffing them. This feature
51+
# is only available from the command line. Turn it on by uncommenting the
52+
# entries below.
53+
###############################################################################
54+
#*.doc diff=astextplain
55+
#*.DOC diff=astextplain
56+
#*.docx diff=astextplain
57+
#*.DOCX diff=astextplain
58+
#*.dot diff=astextplain
59+
#*.DOT diff=astextplain
60+
#*.pdf diff=astextplain
61+
#*.PDF diff=astextplain
62+
#*.rtf diff=astextplain
63+
#*.RTF diff=astextplain

.github/workflows/msvc.yml

Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
1+
# This workflow uses actions that are not certified by GitHub.
2+
# They are provided by a third-party and are governed by
3+
# separate terms of service, privacy policy, and support
4+
# documentation.
5+
6+
name: MSVC
7+
8+
on:
9+
workflow_dispatch:
10+
push:
11+
tags: ["v*"]
12+
13+
env:
14+
PROJECT_NAME: ifsjpeglicm
15+
16+
permissions:
17+
contents: write
18+
19+
jobs:
20+
build:
21+
strategy:
22+
matrix:
23+
arch: ["x86", "x64"]
24+
runs-on: windows-latest
25+
26+
steps:
27+
- name: Checkout
28+
uses: actions/checkout@v4
29+
30+
- name: Set Variables
31+
run: |
32+
if ("${{matrix.arch}}" -eq "x86")
33+
{
34+
echo "MSVC_ARCH=Win32" >> $env:GITHUB_ENV
35+
echo "SPI_EXT=spi" >> $env:GITHUB_ENV
36+
}
37+
else
38+
{
39+
echo "MSVC_ARCH=x64" >> $env:GITHUB_ENV
40+
echo "SPI_EXT=sph" >> $env:GITHUB_ENV
41+
}
42+
43+
- name: Show Variables
44+
run: |
45+
echo "env env.MSVC_ARCH ${{env.MSVC_ARCH}}"
46+
echo "env env.SPI_EXT ${{env.SPI_EXT}}"
47+
48+
- name: Setup cmake
49+
uses: jwlawson/actions-setup-cmake@v2
50+
51+
- name: Check cmake version
52+
run: cmake --version
53+
54+
- name: Add msbuild to PATH
55+
uses: microsoft/setup-msbuild@v2
56+
57+
- name: Checkout jpegli
58+
run: .\build_checkout_jpegli.cmd
59+
60+
- name: Bulid jpegli
61+
run: |
62+
cd jpegli
63+
64+
cmake -G "Visual Studio 17 2022" -A ${{env.MSVC_ARCH}} `
65+
-B "build_release" `
66+
-DCMAKE_INSTALL_PREFIX="out_release" `
67+
-DCMAKE_BUILD_TYPE=Release `
68+
-DCMAKE_MSVC_RUNTIME_LIBRARY="MultiThreaded$<$<CONFIG:Debug>:Debug>" `
69+
-DBUILD_TESTING=OFF `
70+
-DJPEGXL_ENABLE_JNI=OFF `
71+
-DJPEGXL_ENABLE_SJPEG=OFF `
72+
-DJPEGXL_ENABLE_OPENEXR=OFF `
73+
-DJPEGXL_ENABLE_BENCHMARK=OFF `
74+
-DJPEGXL_STATIC=ON
75+
76+
cmake --build "build_release" --config Release --target install
77+
78+
- name: Build spi
79+
working-directory: ${{env.GITHUB_WORKSPACE}}
80+
run: |
81+
New-Item ".\include\${{env.MSVC_ARCH}}\lib\jpegli\" -ItemType Directory -ErrorAction SilentlyContinue
82+
New-Item ".\include\${{env.MSVC_ARCH}}\lib\base\" -ItemType Directory -ErrorAction SilentlyContinue
83+
84+
Copy-Item -Path ".\jpegli\build_release\lib\include\jpegli\*.h" -Destination ".\include\${{env.MSVC_ARCH}}\"
85+
Copy-Item -Path ".\jpegli\lib\jpegli\common.h" -Destination ".\include\${{env.MSVC_ARCH}}\lib\jpegli\"
86+
Copy-Item -Path ".\jpegli\lib\jpegli\decode.h" -Destination ".\include\${{env.MSVC_ARCH}}\lib\jpegli\"
87+
Copy-Item -Path ".\jpegli\lib\jpegli\types.h" -Destination ".\include\${{env.MSVC_ARCH}}\lib\jpegli\"
88+
Copy-Item -Path ".\jpegli\lib\base\include_jpeglib.h" -Destination ".\include\${{env.MSVC_ARCH}}\lib\base\"
89+
90+
New-Item ".\lib\${{env.MSVC_ARCH}}\Release\" -ItemType Directory -ErrorAction SilentlyContinue
91+
92+
$hwy = Get-ChildItem -Path ".\jpegli\build_release\" -Recurse -File -Filter "hwy.lib" | Select-Object -First 1 -ExpandProperty FullName
93+
Copy-Item -Path "$hwy" -Destination ".\lib\${{env.MSVC_ARCH}}\Release\"
94+
$jpegli = Get-ChildItem -Path ".\jpegli\build_release\" -Recurse -File -Filter "jpegli-static.lib" | Select-Object -First 1 -ExpandProperty FullName
95+
Copy-Item -Path "$jpegli" -Destination ".\lib\${{env.MSVC_ARCH}}\Release\"
96+
97+
#Get-ChildItem ".\lib\" -Recurse
98+
99+
msbuild /m /p:Platform=${{matrix.arch}} /p:Configuration=Release .
100+
101+
- name: Create a zip file
102+
run: |
103+
New-Item ".\${{env.PROJECT_NAME}}\" -ItemType Director
104+
Copy-Item -Path ".\out\${{env.MSVC_ARCH}}\Release\${{env.PROJECT_NAME}}.${{env.SPI_EXT}}" -Destination ".\${{env.PROJECT_NAME}}\"
105+
106+
if("${{matrix.arch}}" -eq "x64")
107+
{
108+
Copy-Item -Path ".\jpegli\LICENSE" -Destination ".\${{env.PROJECT_NAME}}\LICENSE_jpegli"
109+
Copy-Item -Path ".\LICENSE" -Destination ".\${{env.PROJECT_NAME}}\LICENSE_${{env.PROJECT_NAME}}"
110+
}
111+
112+
- name: Upload Artifact
113+
uses: actions/upload-artifact@v4
114+
with:
115+
name: ${{matrix.arch}}
116+
path: .\${{env.PROJECT_NAME}}\
117+
retention-days: 1
118+
overwrite: true
119+
120+
Release:
121+
runs-on: ubuntu-latest
122+
needs: build
123+
if: startsWith(github.ref, 'refs/tags/')
124+
125+
steps:
126+
- name: Download All Artifacts
127+
uses: actions/download-artifact@v4
128+
with:
129+
path: ${{env.PROJECT_NAME}}
130+
merge-multiple: true
131+
132+
- name: Create a zip
133+
run: |
134+
ls -l ./${{env.PROJECT_NAME}}/
135+
zip -j ${{env.PROJECT_NAME}} ./${{env.PROJECT_NAME}}/*
136+
ls -l
137+
zipinfo ./${{env.PROJECT_NAME}}.zip
138+
139+
- name: Release
140+
uses: softprops/action-gh-release@v2
141+
if: startsWith(github.ref, 'refs/tags/')
142+
with:
143+
name: Release ${{github.ref_name}}
144+
body: |
145+
## Release notes
146+
files: ${{env.PROJECT_NAME}}.zip
147+

0 commit comments

Comments
 (0)