Skip to content

Commit

Permalink
add shell scripts to build texconv with libjpeg and libpng
Browse files Browse the repository at this point in the history
  • Loading branch information
matyalatte committed Mar 17, 2024
1 parent 4a2cd59 commit 1ce0930
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 6 deletions.
13 changes: 10 additions & 3 deletions .github/workflows/build_all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-20.04, macos-11]
use_libs: [false, true]
runs-on: ${{ matrix.os }}
needs: setup
steps:
Expand All @@ -98,11 +99,18 @@ jobs:
git submodule update --init --recursive
bash shell_scripts/get_sal.sh
- name: build shared library
- name: build texconv
if: matrix.use_libs == false
run: |
bash shell_scripts/build.sh
bash shell_scripts/build_as_exe.sh
- name: build texconv with libjpeg and libpng
if: matrix.use_libs == true
run: |
bash shell_scripts/build_with_jpg_png.sh
bash shell_scripts/build_as_exe_with_jpg_png.sh
- name: Copy files
run: |
mkdir -p ../release/${{ env.ZIP_NAME }}
Expand All @@ -122,6 +130,5 @@ jobs:
with:
upload_url: ${{ needs.setup.outputs.url }}
asset_path: ../release/${{ env.ZIP_NAME }}.tar.bz2
asset_name: ${{ env.ZIP_NAME }}${{ needs.setup.outputs.version }}-${{ runner.os }}.tar.bz2
asset_name: ${{ env.ZIP_NAME }}${{ needs.setup.outputs.version }}-${{ runner.os }}${{ ((matrix.use_libs == false) && '-no-dep') || '' }}.tar.bz2
asset_content_type: application/zip

1 change: 1 addition & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
v0.4.0
- Updated DirectXTex to March 2023 release.
- Supported jpg and png on Unix/Linux systems.

v0.3.0
- Updated DirectXTex to Sept2023 release.
Expand Down
9 changes: 6 additions & 3 deletions options.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,15 @@ if(TEXCONV_USE_ALL)
set(TEXCONV_USE_TEXASSEMBLE ON)
endif()

# disable windows options
# disable options for windows
if(NOT WIN32)
set(TEXCONV_USE_WIC OFF)
set(TEXCONV_NO_GPU_CODEC ON)
set(ENABLE_LIBJPEG_SUPPORT OFF)
set(ENABLE_LIBPNG_SUPPORT OFF)
endif()

if(APPLE)
# support macOS 10.15 or later
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.15" CACHE STRING "" FORCE)
endif()

# show variables
Expand Down
21 changes: 21 additions & 0 deletions shell_scripts/build_as_exe_with_jpg_png.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash
# Builds executables with cmake.
# texconv and texassemble will be generated in ./Texconv-Custom-DLL/

pushd $(dirname "$0")/../
mkdir build_exe
cd build_exe
cmake \
-D CMAKE_BUILD_TYPE=Release\
-D BUILD_DX11=OFF\
-D BUILD_DX12=OFF\
-D CMAKE_POSITION_INDEPENDENT_CODE=ON\
-D TEXCONV_BUILD_AS_EXE=ON\
-D TEXCONV_USE_ALL=ON\
-D ENABLE_LIBJPEG_SUPPORT=ON\
-D ENABLE_LIBPNG_SUPPORT=ON\
../
cmake --build .
cp bin/texconv ../
cp bin/texassemble ../
popd
19 changes: 19 additions & 0 deletions shell_scripts/build_with_jpg_png.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash
# Builds texconv with cmake.
# libtexconv.so or libtexconv.dylib will be generated in ./Texconv-Custom-DLL/

pushd $(dirname "$0")/../
mkdir build
cd build
cmake \
-D CMAKE_BUILD_TYPE=Release\
-D BUILD_DX11=OFF\
-D BUILD_DX12=OFF\
-D CMAKE_POSITION_INDEPENDENT_CODE=ON\
-D TEXCONV_USE_ALL=ON\
-D ENABLE_LIBJPEG_SUPPORT=ON\
-D ENABLE_LIBPNG_SUPPORT=ON\
../
cmake --build .
cp lib/libtexconv.* ../
popd

0 comments on commit 1ce0930

Please sign in to comment.