Skip to content

Commit d15ed35

Browse files
committed
Merge https://github.com/supertuxkart/stk-code into command-manager-prototype at 1.4-rc1
2 parents 4491111 + fdc4a19 commit d15ed35

File tree

2,080 files changed

+740638
-28161
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,080 files changed

+740638
-28161
lines changed

.github/workflows/windows.yml

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
strategy:
1414
fail-fast: true
1515
matrix:
16-
arch: [i686, x86_64, aarch64]
16+
arch: [i686, x86_64, armv7, aarch64]
1717
os: [windows-latest, ubuntu-latest]
1818
runs-on: ${{ matrix.os }}
1919
steps:
@@ -31,6 +31,8 @@ jobs:
3131
echo "cmake_arch=Win32" >> $GITHUB_ENV
3232
elif [ ${{ matrix.arch }} = "x86_64" ]; then
3333
echo "cmake_arch=x64" >> $GITHUB_ENV
34+
elif [ ${{ matrix.arch }} = "armv7" ]; then
35+
echo "cmake_arch=ARM" >> $GITHUB_ENV
3436
else
3537
echo "cmake_arch=ARM64" >> $GITHUB_ENV
3638
fi
@@ -83,8 +85,8 @@ jobs:
8385
sudo wget https://github.com/supertuxkart/dependencies/releases/download/preview/mxe_static_mingw.zip
8486
sudo unzip mxe_static_mingw.zip
8587
sudo rm mxe_static_mingw.zip
86-
- name: Install MinGW for aarch64
87-
if: ${{ matrix.os == 'ubuntu-latest' && matrix.arch == 'aarch64' }}
88+
- name: Install MinGW for armv7 or aarch64
89+
if: ${{ matrix.os == 'ubuntu-latest' && ( matrix.arch == 'armv7' || matrix.arch == 'aarch64' ) }}
8890
run: |
8991
cd /
9092
sudo wget https://github.com/mstorsjo/llvm-mingw/releases/download/20210423/llvm-mingw-20210423-msvcrt-ubuntu-18.04-x86_64.tar.xz
@@ -120,17 +122,17 @@ jobs:
120122
cd build
121123
cmake .. -G "Visual Studio 17 2022" -DCMAKE_SYSTEM_NAME=Windows -DCMAKE_SYSTEM_PROCESSOR=${{ matrix.arch }} -A ${{ env.cmake_arch }} -DCHECK_ASSETS=OFF
122124
- name: Configure bulid for MinGW (i686 or x86_64)
123-
if: ${{ matrix.os == 'ubuntu-latest' && matrix.arch != 'aarch64' }}
125+
if: ${{ matrix.os == 'ubuntu-latest' && matrix.arch != 'armv7' && matrix.arch != 'aarch64' }}
124126
run: |
125127
mkdir -p build
126128
cd build
127129
cmake .. -DCMAKE_TOOLCHAIN_FILE=../toolchain.cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCHECK_ASSETS=OFF -DUSE_DIRECTX=ON
128-
- name: Configure bulid for MinGW (aarch64)
129-
if: ${{ matrix.os == 'ubuntu-latest' && matrix.arch == 'aarch64' }}
130+
- name: Configure bulid for MinGW (armv7 or aarch64)
131+
if: ${{ matrix.os == 'ubuntu-latest' && ( matrix.arch == 'armv7' || matrix.arch == 'aarch64' ) }}
130132
run: |
131133
mkdir -p build
132134
cd build
133-
cmake .. -DLLVM_ARCH=aarch64 -DLLVM_PREFIX=/llvm-mingw -DCMAKE_TOOLCHAIN_FILE=../cmake/Toolchain-llvm-mingw.cmake -DCHECK_ASSETS=OFF -DUSE_DIRECTX=ON
135+
cmake .. -DLLVM_ARCH=${{ matrix.arch }} -DLLVM_PREFIX=/llvm-mingw -DCMAKE_TOOLCHAIN_FILE=../cmake/Toolchain-llvm-mingw.cmake -DCHECK_ASSETS=OFF -DUSE_DIRECTX=ON
134136
- name: Build for MSVC
135137
if: ${{ matrix.os == 'windows-latest' }}
136138
working-directory: build
@@ -238,11 +240,14 @@ jobs:
238240
mv tools/run_game.bat SuperTuxKart-${{ env.release_tag }}-win
239241
mkdir SuperTuxKart-${{ env.release_tag }}-win/stk-code/build-i686
240242
mkdir SuperTuxKart-${{ env.release_tag }}-win/stk-code/build-x86_64
243+
mkdir SuperTuxKart-${{ env.release_tag }}-win/stk-code/build-armv7
241244
mkdir SuperTuxKart-${{ env.release_tag }}-win/stk-code/build-aarch64
242245
mv i686 SuperTuxKart-${{ env.release_tag }}-win/stk-code/build-i686/bin
243246
mv x86_64 SuperTuxKart-${{ env.release_tag }}-win/stk-code/build-x86_64/bin
247+
mv armv7 SuperTuxKart-${{ env.release_tag }}-win/stk-code/build-armv7/bin
244248
mv aarch64 SuperTuxKart-${{ env.release_tag }}-win/stk-code/build-aarch64/bin
245249
# libwinpthread-1.dll is useless because we statically link
250+
rm -f SuperTuxKart-${{ env.release_tag }}-win/stk-code/build-armv7/bin/libwinpthread-1.dll
246251
rm -f SuperTuxKart-${{ env.release_tag }}-win/stk-code/build-aarch64/bin/libwinpthread-1.dll
247252
- name: Start packaging STK
248253
if: ${{ env.release_tag != '' }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,5 +89,6 @@ lib/openssl
8989
lib/harfbuzz
9090
lib/sdl2
9191
lib/mbedtls
92+
lib/astc-encoder
9293

9394
.DS_Store

CMakeLists.txt

Lines changed: 56 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,8 @@ endif()
106106

107107
if((UNIX AND NOT APPLE) AND NOT SERVER_ONLY)
108108
if((${CMAKE_SYSTEM_PROCESSOR} MATCHES "arm") OR
109-
(${CMAKE_SYSTEM_PROCESSOR} MATCHES "aarch64"))
109+
(${CMAKE_SYSTEM_PROCESSOR} MATCHES "aarch64") OR
110+
(${CMAKE_SYSTEM_PROCESSOR} MATCHES "riscv64"))
110111
option(USE_GLES2 "Use OpenGL ES2 renderer" ON)
111112
else()
112113
option(USE_GLES2 "Use OpenGL ES2 renderer" OFF)
@@ -165,6 +166,8 @@ if (CMAKE_GENERATOR_PLATFORM)
165166
endif()
166167
if(arch_lower MATCHES "arm64" OR arch_lower MATCHES "aarch64" OR ${CMAKE_GENERATOR} MATCHES "(ARM64)" OR ${BUILD_ARCH} MATCHES "(ARM64)")
167168
set(DEPENDENCIES "dependencies-win-aarch64")
169+
elseif(arch_lower MATCHES "armv7" OR arch_lower MATCHES "armv7" OR ${CMAKE_GENERATOR} MATCHES "(ARM)" OR ${BUILD_ARCH} MATCHES "(ARM)")
170+
set(DEPENDENCIES "dependencies-win-armv7")
168171
elseif(CMAKE_SIZEOF_VOID_P EQUAL 8)
169172
set(DEPENDENCIES "dependencies-win-x86_64")
170173
else()
@@ -259,9 +262,52 @@ else()
259262
endif()
260263

261264
if(NOT SERVER_ONLY)
265+
if(USE_SYSTEM_SQUISH)
266+
find_library(SQUISH_LIBRARY NAMES squish libsquish)
267+
find_path(SQUISH_INCLUDEDIR NAMES squish.h PATHS)
268+
endif()
269+
if (NOT SQUISH_LIBRARY OR NOT SQUISH_INCLUDEDIR)
270+
add_subdirectory("${PROJECT_SOURCE_DIR}/lib/libsquish")
271+
include_directories(BEFORE "${PROJECT_SOURCE_DIR}/lib/libsquish")
272+
SET(SQUISH_LIBRARY squish)
273+
else()
274+
include_directories("${SQUISH_INCLUDEDIR}")
275+
MESSAGE(STATUS "Use system libsquish: ${SQUISH_LIBRARY}")
276+
endif()
277+
endif()
278+
279+
if(NOT SERVER_ONLY)
280+
find_library(SHADERC_LIBRARY NAMES shaderc_shared libshaderc_shared)
281+
find_path(SHADERC_INCLUDEDIR NAMES shaderc/shaderc.hpp PATHS)
282+
if (NOT SHADERC_LIBRARY OR NOT SHADERC_INCLUDEDIR)
283+
set(SHADERC_SKIP_INSTALL ON CACHE INTERNAL "Skip installation" FORCE)
284+
set(SHADERC_SKIP_TESTS ON CACHE INTERNAL "Skip building tests" FORCE)
285+
set(SHADERC_SKIP_EXAMPLES ON CACHE INTERNAL "Skip building examples" FORCE)
286+
set(SHADERC_SKIP_COPYRIGHT_CHECK ON CACHE INTERNAL "Skip copyright check" FORCE)
287+
288+
set(SPIRV_HEADERS_SKIP_INSTALL ON CACHE INTERNAL "Skip install" FORCE)
289+
set(SPIRV_HEADERS_SKIP_EXAMPLES ON CACHE INTERNAL "Skip building examples" FORCE)
290+
291+
set(SKIP_SPIRV_TOOLS_INSTALL ON CACHE INTERNAL "Skip installation" FORCE)
292+
set(SPIRV_SKIP_TESTS ON CACHE INTERNAL "Skip tests" FORCE)
293+
set(SPIRV_SKIP_EXECUTABLES ON CACHE INTERNAL "Skip executables" FORCE)
294+
295+
set(ENABLE_GLSLANG_BINARIES OFF CACHE INTERNAL "Builds glslangValidator and spirv-remap" FORCE)
296+
set(ENABLE_CTEST OFF CACHE INTERNAL "Enable ctest" FORCE)
297+
298+
add_subdirectory("${PROJECT_SOURCE_DIR}/lib/shaderc")
299+
include_directories(BEFORE "${PROJECT_SOURCE_DIR}/lib/shaderc/libshaderc/include")
300+
SET(SHADERC_LIBRARY shaderc)
301+
message(STATUS "System shaderc not found, use the bundled one.")
302+
else()
303+
include_directories("${SHADERC_INCLUDEDIR}")
304+
MESSAGE(STATUS "Use system shaderc: ${SHADERC_LIBRARY}")
305+
endif()
306+
262307
add_subdirectory("${PROJECT_SOURCE_DIR}/lib/graphics_engine")
263-
include_directories(BEFORE "${PROJECT_SOURCE_DIR}/lib/graphics_engine/include")
264308
endif()
309+
# MiniGLM is there
310+
include_directories(BEFORE "${PROJECT_SOURCE_DIR}/lib/graphics_engine/include")
265311

266312
if (NOT SERVER_ONLY)
267313
# Add jpeg library
@@ -310,21 +356,6 @@ else()
310356
MESSAGE(STATUS "Use system libmcpp: ${MCPP_LIBRARY}")
311357
endif()
312358

313-
if(NOT SERVER_ONLY)
314-
if(USE_SYSTEM_SQUISH)
315-
find_library(SQUISH_LIBRARY NAMES squish libsquish)
316-
find_path(SQUISH_INCLUDEDIR NAMES squish.h PATHS)
317-
endif()
318-
if (NOT SQUISH_LIBRARY OR NOT SQUISH_INCLUDEDIR)
319-
add_subdirectory("${PROJECT_SOURCE_DIR}/lib/libsquish")
320-
include_directories(BEFORE "${PROJECT_SOURCE_DIR}/lib/libsquish")
321-
SET(SQUISH_LIBRARY squish)
322-
else()
323-
include_directories("${SQUISH_INCLUDEDIR}")
324-
MESSAGE(STATUS "Use system libsquish: ${SQUISH_LIBRARY}")
325-
endif()
326-
endif()
327-
328359
if (NOT SERVER_ONLY)
329360
# SDL2
330361
find_library(SDL2_LIBRARY NAMES SDL2 libSDL2)
@@ -365,7 +396,7 @@ if(USE_WIIUSE)
365396
if(WIIUSE_BUILD)
366397
add_subdirectory("${PROJECT_SOURCE_DIR}/lib/wiiuse")
367398
endif()
368-
include_directories(BEFORE "${PROJECT_SOURCE_DIR}/lib/wiiuse/src")
399+
include_directories(BEFORE "${PROJECT_SOURCE_DIR}/lib/wiiuse/src/include")
369400
set(WIIUSE_LIBRARIES "wiiuse" "bluetooth")
370401
endif()
371402
endif()
@@ -574,7 +605,7 @@ if(APPLE AND NOT IOS)
574605

575606
if(CMAKE_GENERATOR MATCHES "Xcode")
576607
add_custom_command(TARGET supertuxkart POST_BUILD
577-
COMMAND ln -f -s ${PROJECT_SOURCE_DIR}/data ${CMAKE_BINARY_DIR}/bin/\${CONFIGURATION}/supertuxkart.app/Contents/Resources)
608+
COMMAND ln -f -s ${PROJECT_SOURCE_DIR}/data ${CMAKE_BINARY_DIR}/\${CONFIGURATION}/supertuxkart.app/Contents/Resources)
578609
else()
579610
add_custom_command(TARGET supertuxkart POST_BUILD
580611
COMMAND ln -f -s ${PROJECT_SOURCE_DIR}/data ${CMAKE_BINARY_DIR}/bin/supertuxkart.app/Contents/Resources)
@@ -725,6 +756,10 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "SunOS")
725756
target_link_libraries(supertuxkart nsl socket vorbisfile)
726757
endif()
727758

759+
if (${CMAKE_SYSTEM_NAME} MATCHES "Haiku")
760+
target_link_libraries(supertuxkart be network vorbisfile)
761+
endif()
762+
728763
if (USE_DNS_C)
729764
target_link_libraries(supertuxkart dnsc)
730765
else()
@@ -769,7 +804,8 @@ if(NOT SERVER_ONLY)
769804
graphics_utils
770805
graphics_engine
771806
${SDL2_LIBRARY}
772-
tinygettext)
807+
tinygettext
808+
${SHADERC_LIBRARY})
773809
endif()
774810

775811
if(UNIX AND NOT APPLE)

INSTALL.md

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ location, specify `CMAKE_INSTALL_PREFIX` when running cmake, e.g.:
137137

138138
## Building SuperTuxKart on Windows
139139

140-
To Build SuperTuxKart on Windows, follow these instructions:
140+
To Build SuperTuxKart on Windows, first you need to install [Python](https://www.python.org/downloads/windows/) for [shaderc](https://github.com/google/shaderc) used by SuperTuxKart, after installing Python (if needed) follow these instructions:
141141

142142
1. Download and install Visual Studio from here: [Visual Studio - Download](https://www.visualstudio.com/downloads/). The free Visual Studio Community edition works fine. Remember to select "Desktop development with C++" in the installer.
143143
@@ -150,7 +150,7 @@ Open your file browser and find somewhere you want to put the development versio
150150
4. If you got the stable version, download the Windows dependencies package from [SuperTuxKart on GitHub - Dependencies Releases](https://github.com/supertuxkart/dependencies/releases), find the stk-code version there and download the `dependencies(arch).zip` as needed and unpack the archive into the `stk-code` directory.
151151
152152
5. If you got the development version go to SuperTuxKart-dev in your file browser, then visit [SuperTuxKart on GitHub - Dependencies latest preview release](https://github.com/supertuxkart/dependencies/releases/tag/preview)
153-
and unpack the archive into the `stk-code` directory. Download `i686` if you use Win32 generator of MSVC, `x86_64` for x64 and `aarch64` for ARM64.
153+
and unpack the archive into the `stk-code` directory. Download `i686` if you use Win32 generator of MSVC, `x86_64` for x64, `armv7` for ARM and `aarch64` for ARM64.
154154
155155
6. Download CMake from here: [CMake - download page](https://cmake.org/download/), install it; once CMake is installed, double click on the CMake icon on your desktop, and point it towards your `stk-code` directory in the 'Where is the source code' field, and point 'Where to build the binaries' to a new directory called `build` or `bld` inside the stk-code directory.
156156
@@ -180,7 +180,7 @@ Visual Studio 2013| 13
180180
2. Download a source package from either [SuperTuxKart on GitHub](https://github.com/supertuxkart/stk-code/releases) or [SuperTuxKart.net - Source Control](https://supertuxkart.net/Source_control)
181181
NOTE: the `stk-code` and `stk-assets` directories **must** be in the same directory, `stk-assets` is not needed if you download the full source tarball `(SuperTuxKart-version-src.tar.xz)`.
182182
3. Download the Windows dependencies package from [SuperTuxKart on GitHub - Dependencies latest preview release](https://github.com/supertuxkart/dependencies/releases/tag/preview)
183-
and unpack the archive into the `stk-code` directory. Download `i686` if you use Win32 generator of MSVC, `x86_64` for x64 and `aarch64` for ARM64.
183+
and unpack the archive into the `stk-code` directory. Download `i686` if you use Win32 generator of MSVC, `x86_64` for x64, `armv7` for ARM and `aarch64` for ARM64.
184184
4. Download CMake from here: [CMake - download page](https://cmake.org/download/); and install it. Navigate to the `stk-code` directory; and create an directory called "build":
185185
186186
```cmd
@@ -196,12 +196,34 @@ and unpack the archive into the `stk-code` directory. Download `i686` if you use
196196
197197
6. Now that CMake finished configuring and creating the necessary files for the build, run the build command in the same directory:
198198
199-
```cmd
200-
msbuild.exe SuperTuxKart.sln
201-
```
199+
```cmd
200+
msbuild.exe SuperTuxKart.sln
201+
```
202202
203203
SuperTuxKart can now be run as `bin\Debug\supertuxkart.exe` or `bin\Release\supertuxkart.exe`
204204
205+
## Building SuperTuxKart on Windows using LLVM MinGW
206+
207+
1. Get the LLVM Mingw archive [here](https://github.com/mstorsjo/llvm-mingw/releases/latest), get the `*-msvcrt-i686.zip or` `*-msvcrt-x86_64.zip` depending on whether you have an Intel / AMD 32 or 64-bit Windows. If you are using ARM64 Windows get the `*-msvcrt-i686.zip` should be fine (untested). After downloading extract it as `C:\llvm-mingw` so `C:\llvm-mingw` contains `bin`, `include`, `lib`, etc.
208+
2. Get Ninja [here](https://github.com/ninja-build/ninja/releases/latest), download the `ninja-win.zip` and extract the `ninja.exe` from the archive to `C:\llvm-mingw`. If you are not using Intel / AMD 64-bit Windows use [this link](https://packages.msys2.org/package/mingw-w64-i686-ninja) and extract `mingw32\bin\ninja.exe` inside the `tar.zst`.
209+
3. Download a source package from either [SuperTuxKart on GitHub](https://github.com/supertuxkart/stk-code/releases) or [SuperTuxKart.net - Source Control](https://supertuxkart.net/Source_control)
210+
NOTE: the `stk-code` and `stk-assets` directories **must** be in the same directory, `stk-assets` is not needed if you download the full source tarball `(SuperTuxKart-version-src.tar.xz)`. Also make sure they lie within the C drive.
211+
4. Download the Windows dependencies package from [SuperTuxKart on GitHub - Dependencies latest preview release](https://github.com/supertuxkart/dependencies/releases/tag/preview)
212+
and unpack the archive into the `stk-code` directory. Download `i686` if you compile for Intel / AMD 32-bit, `x86_64` for Intel / AMD 64-bit, `armv7` for ARM 32-bit and `aarch64` for ARM 64-bit version of Windows.
213+
6. Download CMake from here: [CMake - download page](https://cmake.org/download/), install it; once CMake is installed, double click on the CMake icon on your desktop, and point it towards your `stk-code` directory in the 'Where is the source code' field, and point 'Where to build the binaries' to a new directory called `build` inside the stk-code directory.
214+
7. Press the `Add Entry` button and add the values below:
215+
* Name: `LLVM_ARCH` Type: `STRING` Value: `i686`, `x86_64`, `armv7` or `aarch64`
216+
* Name: `LLVM_PREFIX` Type: `STRING` Value: `C:/llvm-mingw`
217+
* Name: `CMAKE_MAKE_PROGRAM` Type: `STRING` Value: `C:/llvm-mingw/ninja.exe`
218+
* Name: `USE_WIIUSE` Type: `BOOL` Value: `Empty (unchecked)`
219+
8. Press 'Configure'; CMake will ask you if it is OK to create the aforementioned directory, press `Yes`. Choose `Ninja` from `Specify the generator for this project`, choose `Specify toolchain file for cross-compiling` then press `Next`. Specify the toolchain file which is located in `stk-code\cmake\Toolchain-llvm-mingw.cmake` and press `Finish`. If no error appears then press 'Generate'
220+
9. Once inside the build directory using command line `cmd.exe` or PowerShell:
221+
```cmd
222+
C:\llvm-mingw\ninja.exe
223+
```
224+
225+
SuperTuxKart can now be run as `bin\supertuxkart.exe`.
226+
205227
## Building SuperTuxKart on macOS
206228
207229
### Getting Started

android/Android.mk

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,27 @@ include $(PREBUILT_STATIC_LIBRARY)
9393
include $(CLEAR_VARS)
9494

9595

96+
# shaderc
97+
LOCAL_MODULE := shaderc
98+
LOCAL_SRC_FILES := deps-$(TARGET_ARCH_ABI)/shaderc/libshaderc/libshaderc_combined.a
99+
include $(PREBUILT_STATIC_LIBRARY)
100+
include $(CLEAR_VARS)
101+
102+
103+
# libsquish
104+
LOCAL_MODULE := libsquish
105+
LOCAL_SRC_FILES := deps-$(TARGET_ARCH_ABI)/libsquish/libsquish.a
106+
include $(PREBUILT_STATIC_LIBRARY)
107+
include $(CLEAR_VARS)
108+
109+
110+
# astc-encoder
111+
LOCAL_MODULE := libastcenc
112+
LOCAL_SRC_FILES := deps-$(TARGET_ARCH_ABI)/astc-encoder/Source/libastcenc.a
113+
include $(PREBUILT_STATIC_LIBRARY)
114+
include $(CLEAR_VARS)
115+
116+
96117
# ifaddrs
97118
LOCAL_MODULE := ifaddrs
98119
LOCAL_PATH := .
@@ -153,7 +174,8 @@ LOCAL_MODULE := graphics_utils
153174
LOCAL_PATH := .
154175
LOCAL_CPP_FEATURES += rtti
155176
LOCAL_SRC_FILES := $(wildcard ../lib/graphics_utils/mipmap/*.c)
156-
LOCAL_CFLAGS := -I../lib/graphics_utils/mipmap
177+
LOCAL_CFLAGS := -I../lib/graphics_utils/mipmap \
178+
-I../lib/simd_wrapper
157179
ifeq ($(TARGET_ARCH_ABI), armeabi-v7a)
158180
LOCAL_ARM_NEON := false
159181
endif
@@ -167,12 +189,19 @@ LOCAL_PATH := .
167189
LOCAL_CPP_FEATURES += rtti exceptions
168190
LOCAL_SRC_FILES := $(wildcard ../lib/graphics_engine/src/*.c) \
169191
$(wildcard ../lib/graphics_engine/src/*.cpp)
170-
LOCAL_CFLAGS := -I../lib/graphics_engine/include \
171-
-I../lib/sdl2/include/ \
172-
-I../lib/irrlicht/include/
192+
LOCAL_CFLAGS := -DENABLE_LIBASTCENC \
193+
-I../lib/graphics_engine/include \
194+
-I../lib/graphics_utils \
195+
-I../lib/sdl2/include/ \
196+
-I../lib/bullet/src/ \
197+
-I../lib/irrlicht/include/ \
198+
-I../lib/shaderc/libshaderc/include \
199+
-I../lib/libsquish \
200+
-Ideps-$(TARGET_ARCH_ABI)/astc-encoder/Source
173201
ifeq ($(TARGET_ARCH_ABI), armeabi-v7a)
174202
LOCAL_ARM_NEON := false
175203
endif
204+
LOCAL_STATIC_LIBRARIES := shaderc libsquish libastcenc
176205
include $(BUILD_STATIC_LIBRARY)
177206
include $(CLEAR_VARS)
178207

android/build.gradle

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,17 @@ android
9898
cppFlags '-O0'
9999
}
100100
}
101+
ndk
102+
{
103+
if (project.getProperty('compile_arch') == 'all')
104+
{
105+
abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
106+
}
107+
else
108+
{
109+
abiFilters project.getProperty('compile_arch')
110+
}
111+
}
101112
}
102113

103114
release
@@ -111,6 +122,17 @@ android
111122
}
112123
}
113124
signingConfig signingConfigs.release
125+
ndk
126+
{
127+
if (project.getProperty('compile_arch') == 'all')
128+
{
129+
abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
130+
}
131+
else
132+
{
133+
abiFilters project.getProperty('compile_arch')
134+
}
135+
}
114136
}
115137
}
116138

@@ -119,7 +141,6 @@ android
119141
main
120142
{
121143
manifest.srcFile 'AndroidManifest.xml'
122-
jniLibs.srcDirs = ['libs']
123144
res.srcDirs = ['res']
124145
assets.srcDirs = ['assets']
125146
}

0 commit comments

Comments
 (0)