Skip to content

Commit

Permalink
support for windows xp
Browse files Browse the repository at this point in the history
  • Loading branch information
devseed committed Nov 22, 2024
1 parent 3bb84fe commit e836db9
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 5 deletions.
44 changes: 42 additions & 2 deletions .github/workflows/build_win.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ env:
MINGWSDK: /opt/mingwsdk

jobs:
build_mingw:
build_llvmmingw:
strategy:
matrix:
arch: [{prefix: i686, suffix: x86}, {prefix: x86_64, suffix: x64}]
Expand All @@ -21,7 +21,7 @@ jobs:

- name: init enviroment
run: |
sudo apt-get -y install p7zip-full git make cmake
sudo apt-get -y -qq install p7zip-full git make cmake
curl -fsSL https://github.com/mstorsjo/llvm-mingw/releases/download/20240619/llvm-mingw-20240619-msvcrt-ubuntu-20.04-x86_64.tar.xz -o /tmp/llvm-mingw.tar.xz
tar xf /tmp/llvm-mingw.tar.xz -C /tmp
_tmppath=/tmp/llvm-mingw-20240619-msvcrt-ubuntu-20.04-x86_64
Expand All @@ -43,6 +43,46 @@ jobs:
mv build/TileViewer.exe TileViewer_${{ github.ref_name }}_${{ matrix.arch.suffix }}_win.exe
fi
- name: create release
uses: ncipollo/release-action@v1
if: github.event_name == 'push'
with:
artifacts: "TileViewer_*.exe"
allowUpdates: "true"
token: ${{ secrets.GITHUB_TOKEN }}

build_mingw:
strategy:
matrix:
arch: [{prefix: i686, suffix: x86_xp}]

runs-on: ubuntu-22.04 # 24.04 gcc-13 might not worked ?
steps:
- uses: actions/checkout@v4

- name: init enviroment
run: |
sudo apt-get -y -qq install p7zip-full git make cmake
sudo apt-get -y -qq install mingw-w64
${{ matrix.arch.prefix }}-w64-mingw32-gcc --version
- name: build ${{ matrix.arch.suffix }}
run: |
mkdir build
export PATH=${MINGWSDK}/bin:$PATH
export CC=${{ matrix.arch.prefix }}-w64-mingw32-gcc
export CXX=${{ matrix.arch.prefix }}-w64-mingw32-g++
export WINDRES=${{ matrix.arch.prefix }}-w64-mingw32-windres
export BUILD_DIR=build
export BUILD_TYPE=MinSizeRel
bash script/build_mingw.sh
- name: prepare release
run: |
if [[ ! "${{ github.ref_name }}" =~ "merge" ]]; then
mv build/TileViewer.exe TileViewer_${{ github.ref_name }}_${{ matrix.arch.suffix }}_win.exe
fi
- name: create release
uses: ncipollo/release-action@v1
if: github.event_name == 'push'
Expand Down
10 changes: 7 additions & 3 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ For example, to built plugin `asset/png.c`
mkdir -p build_mingw64/plugin
. script/fetch_depend.sh
fetch_stb
gcc -g -Idepend/stb-lastest -Isrc -fPIC -shared asset/plugin/util_png.c -fvisibility=hidden -o build_mingw64/plugin/util_png.dll
gcc -g -Idepend/stb-lastest -Isrc -fPIC -fvisibility=hidden -static-libgcc -shared asset/plugin/util_png.c -o build_mingw64/plugin/util_png.dll
```

### (3) Lua plugin
Expand Down Expand Up @@ -274,6 +274,9 @@ sh -c "export CC=i686-w64-mingw32-clang BUILD_DIR=$(pwd)/build_mingw32 BUILD_TYP

# linux mingw x64 debug
export CC=x86_64-w64-mingw32-gcc CXX=x86_64-w64-mingw32-g++ WINDRES=x86_64-w64-mingw32-windres BUILD_DIR=build_mingw64 && bash script/build_mingw.sh

# linux mingw x86 release
export CC=i686-w64-mingw32-gcc CXX=i686-w64-mingw32-g++ WINDRES=i686-w64-mingw32-windres BUILD_DIR=build_mingw32 && BUILD_TYPE=MinSizeRel && bash script/build_mingw.sh
```

### (2) Linux
Expand Down Expand Up @@ -354,6 +357,8 @@ chmod +x script/*.sh
## Roadmap

* Core
* [x] redirect log message to log window
* [x] implement command lines
* [x] decoder interface with different plugin (builtin, lua, C)
* [x] plugin built-in decoder, 2|4|8bpp, 16bpp(rgb565), 24bpp(rgb888), 32bpp(rgba8888) ([v0.1](https://github.com/YuriSizuku/TileViewer/releases/tag/v0.2))
* [x] plugin lua decoder api implement ([v0.2](https://github.com/YuriSizuku/TileViewer/releases/tag/v0.2))
Expand All @@ -368,12 +373,11 @@ chmod +x script/*.sh
* [ ] color palette load, save editor (partly sovled by plugin)

* Build
* [x] redirect log message to log window
* [x] implement command lines
* [x] use github action to auto build ([v0.1](https://github.com/YuriSizuku/TileViewer/releases/tag/v0.1))
* [x] llvm-mingw compile (x86, x64) ([v0.1](https://github.com/YuriSizuku/TileViewer/releases/tag/v0.1))
* [x] linux compile (x86, x64) ([v0.1.2](https://github.com/YuriSizuku/TileViewer/releases/tag/v0.1.2))
* [x] linux cross compile by docker (arm32, arm64) ([v0.1.3](https://github.com/YuriSizuku/TileViewer/releases/tag/v0.1.2))
* [x] windows xp support (by i686-w64-mingw32-gcc, llvm-mingw not worked, because of tls ? ) ([v0.3.3.2](https://github.com/YuriSizuku/TileViewer/releases/tag/v0.3.3.2))
* [x] mac local compile (contributed by [TomJinW](https://github.com/TomJinW))

## Issues
Expand Down

0 comments on commit e836db9

Please sign in to comment.