Update libktx, use binary version on Android build
This commit is contained in:
+5
-5
@@ -29,6 +29,7 @@ option(WIVRN_USE_SYSTEM_OPENXR "Use system OpenXR headers" ON)
|
|||||||
option(WIVRN_USE_SYSTEMD "Use libsystemd" ON)
|
option(WIVRN_USE_SYSTEMD "Use libsystemd" ON)
|
||||||
option(WIVRN_COMPRESS_GLB "Compress textures in GLB files with gltf-transform" OFF)
|
option(WIVRN_COMPRESS_GLB "Compress textures in GLB files with gltf-transform" OFF)
|
||||||
option(WIVRN_USE_ANDROID_VALIDATION_LAYER "Download the android version of the Vulkan validation layer" OFF)
|
option(WIVRN_USE_ANDROID_VALIDATION_LAYER "Download the android version of the Vulkan validation layer" OFF)
|
||||||
|
option(WIVRN_USE_ANDROID_BIN_LIBKTX "Download the prebuilt libktx for android" OFF)
|
||||||
option(WIVRN_BUILD_CLIENT "Build WiVRn client" OFF)
|
option(WIVRN_BUILD_CLIENT "Build WiVRn client" OFF)
|
||||||
option(WIVRN_BUILD_SERVER "Build WiVRn server" ON)
|
option(WIVRN_BUILD_SERVER "Build WiVRn server" ON)
|
||||||
option(WIVRN_BUILD_SERVER_LIBRARY "Build OpenXR library for WiVRn server" ${WIVRN_BUILD_SERVER})
|
option(WIVRN_BUILD_SERVER_LIBRARY "Build OpenXR library for WiVRn server" ${WIVRN_BUILD_SERVER})
|
||||||
@@ -245,11 +246,10 @@ FetchContent_Declare(spdlog EXCLUDE_FROM_ALL SYSTEM URL https://github.co
|
|||||||
URL_HASH SHA256=15a04e69c222eb6c01094b5c7ff8a249b36bb22788d72519646fb85feb267e67)
|
URL_HASH SHA256=15a04e69c222eb6c01094b5c7ff8a249b36bb22788d72519646fb85feb267e67)
|
||||||
FetchContent_Declare(stb EXCLUDE_FROM_ALL SYSTEM URL https://github.com/nothings/stb/archive/013ac3beddff3dbffafd5177e7972067cd2b5083.zip
|
FetchContent_Declare(stb EXCLUDE_FROM_ALL SYSTEM URL https://github.com/nothings/stb/archive/013ac3beddff3dbffafd5177e7972067cd2b5083.zip
|
||||||
URL_HASH SHA256=b7f476902bbef1b30f8ecc2d9d95c459c32302c8b559d09b589b5955463b7af8)
|
URL_HASH SHA256=b7f476902bbef1b30f8ecc2d9d95c459c32302c8b559d09b589b5955463b7af8)
|
||||||
file(GLOB LIBKTX_PATCHES CONFIGURE_DEPENDS patches/libktx/*)
|
set(KTX_VERSION "4.4.2")
|
||||||
set(KTX_GIT_VERSION_FULL "v4.4.0")
|
set(KTX_VERSION_FULL "v${KTX_VERSION}")
|
||||||
FetchContent_Declare(libktx EXCLUDE_FROM_ALL SYSTEM URL https://github.com/KhronosGroup/KTX-Software/archive/refs/tags/${KTX_GIT_VERSION_FULL}.tar.gz
|
FetchContent_Declare(libktx EXCLUDE_FROM_ALL SYSTEM URL https://github.com/KhronosGroup/KTX-Software/archive/refs/tags/${KTX_VERSION_FULL}.tar.gz
|
||||||
URL_HASH SHA256=3585d76edcdcbe3a671479686f8c81c1c10339f419e4b02a9a6f19cc6e4e0612
|
URL_HASH SHA256=9412cb45045a503005acd47d98f9e8b47154634a50b4df21e17a1dfa8971d323
|
||||||
PATCH_COMMAND ${CMAKE_CURRENT_LIST_DIR}/patches/apply.sh ${LIBKTX_PATCHES}
|
|
||||||
)
|
)
|
||||||
FetchContent_Declare(implot EXCLUDE_FROM_ALL SYSTEM URL https://github.com/epezent/implot/archive/3da8bd34299965d3b0ab124df743fe3e076fa222.zip
|
FetchContent_Declare(implot EXCLUDE_FROM_ALL SYSTEM URL https://github.com/epezent/implot/archive/3da8bd34299965d3b0ab124df743fe3e076fa222.zip
|
||||||
URL_HASH SHA256=e9b439a94aa6f09fcf12ed9c2cd784efe5e99e96242122aa683e690b29f7a59f)
|
URL_HASH SHA256=e9b439a94aa6f09fcf12ed9c2cd784efe5e99e96242122aa683e690b29f7a59f)
|
||||||
|
|||||||
@@ -127,6 +127,7 @@ android {
|
|||||||
'-DCMAKE_EXPORT_COMPILE_COMMANDS=ON',
|
'-DCMAKE_EXPORT_COMPILE_COMMANDS=ON',
|
||||||
'-DWIVRN_USE_SYSTEM_BOOST=OFF',
|
'-DWIVRN_USE_SYSTEM_BOOST=OFF',
|
||||||
'-DWIVRN_USE_SYSTEM_FREETYPE=OFF',
|
'-DWIVRN_USE_SYSTEM_FREETYPE=OFF',
|
||||||
|
'-DWIVRN_USE_ANDROID_BIN_LIBKTX=ON',
|
||||||
'-DWIVRN_BUILD_CLIENT=ON',
|
'-DWIVRN_BUILD_CLIENT=ON',
|
||||||
'-DWIVRN_BUILD_SERVER=OFF',
|
'-DWIVRN_BUILD_SERVER=OFF',
|
||||||
'-DWIVRN_BUILD_SERVER_LIBRARY=OFF',
|
'-DWIVRN_BUILD_SERVER_LIBRARY=OFF',
|
||||||
|
|||||||
+14
-1
@@ -11,7 +11,20 @@ set(SPIRV_REFLECT_EXECUTABLE OFF)
|
|||||||
set(SPIRV_REFLECT_STATIC_LIB ON)
|
set(SPIRV_REFLECT_STATIC_LIB ON)
|
||||||
set(SPIRV_REFLECT_INSTALL OFF)
|
set(SPIRV_REFLECT_INSTALL OFF)
|
||||||
|
|
||||||
FetchContent_MakeAvailable(simdjson spdlog glm fastgltf imgui stb implot uni-algo entt libktx spirv-reflect)
|
FetchContent_MakeAvailable(simdjson spdlog glm fastgltf imgui stb implot uni-algo entt spirv-reflect)
|
||||||
|
if(ANDROID AND WIVRN_USE_ANDROID_BIN_LIBKTX)
|
||||||
|
file(DOWNLOAD
|
||||||
|
https://github.com/KhronosGroup/KTX-Software/releases/download/${KTX_VERSION_FULL}/KTX-Software-${KTX_VERSION}-Android.zip
|
||||||
|
${CMAKE_BINARY_DIR}/KTX-Software-${KTX_VERSION}-Android.zip
|
||||||
|
EXPECTED_HASH SHA256=9f84a395f37a185e2e21e77cfd3893e67271b616edf5feb39125f09ab4c06b29
|
||||||
|
)
|
||||||
|
file(ARCHIVE_EXTRACT INPUT ${CMAKE_BINARY_DIR}/KTX-Software-${KTX_VERSION}-Android.zip DESTINATION ${CMAKE_BINARY_DIR})
|
||||||
|
add_library(ktx INTERFACE)
|
||||||
|
target_link_libraries(ktx INTERFACE ${CMAKE_BINARY_DIR}/KTX-Software-${KTX_VERSION}-Android/${ANDROID_ABI}/lib/libktx.so)
|
||||||
|
target_include_directories(ktx INTERFACE ${CMAKE_BINARY_DIR}/KTX-Software-${KTX_VERSION}-Android/${ANDROID_ABI}/include)
|
||||||
|
else()
|
||||||
|
FetchContent_MakeAvailable(libktx)
|
||||||
|
endif()
|
||||||
|
|
||||||
include(FreetypeHarfbuzz)
|
include(FreetypeHarfbuzz)
|
||||||
include(CompileGLSL)
|
include(CompileGLSL)
|
||||||
|
|||||||
@@ -1,49 +0,0 @@
|
|||||||
From f3f6b3b6988a9bc13448b720f17ed3543da7600e Mon Sep 17 00:00:00 2001
|
|
||||||
From: alex <alexge50.x@gmail.com>
|
|
||||||
Date: Wed, 16 Apr 2025 06:36:45 +0100
|
|
||||||
Subject: [PATCH] GCC14/C++23 compatibility fix (#1014)
|
|
||||||
MIME-Version: 1.0
|
|
||||||
Content-Type: text/plain; charset=UTF-8
|
|
||||||
Content-Transfer-Encoding: 8bit
|
|
||||||
|
|
||||||
Fixes the following error, when compiling with GCC 14, using
|
|
||||||
`-std=c++23`:
|
|
||||||
|
|
||||||
```
|
|
||||||
<>/basisu/encoder/basisu_kernels_sse.cpp:41:
|
|
||||||
<>/basisu/encoder/cppspmd_sse.h: In member function ‘cppspmd_sse41::spmd_kernel::vfloat& cppspmd_sse41::spmd_kernel::store(vfloat&&, const vfloat&)’:
|
|
||||||
<>/basisu/encoder/cppspmd_sse.h:496:24: error: cannot bind non-const lvalue reference of type ‘cppspmd_sse41::spmd_kernel::vfloat&’ to an rvalue of type ‘cppspmd_sse41::spmd_kernel::vfloat’
|
|
||||||
496 | return dst;
|
|
||||||
| ^~~
|
|
||||||
<>/basisu/encoder/cppspmd_sse.h: In member function ‘cppspmd_sse41::spmd_kernel::vfloat& cppspmd_sse41::spmd_kernel::store_all(vfloat&&, const vfloat&)’:
|
|
||||||
<>/basisu/encoder/cppspmd_sse.h:508:24: error: cannot bind non-const lvalue reference of type ‘cppspmd_sse41::spmd_kernel::vfloat&’ to an rvalue of type ‘cppspmd_sse41::spmd_kernel::vfloat’
|
|
||||||
508 | return dst;
|
|
||||||
| ^~~
|
|
||||||
|
|
||||||
```
|
|
||||||
---
|
|
||||||
external/basisu/encoder/cppspmd_sse.h | 4 ++--
|
|
||||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/external/basisu/encoder/cppspmd_sse.h b/external/basisu/encoder/cppspmd_sse.h
|
|
||||||
index 030824b7d0..0c77a2d8c7 100644
|
|
||||||
--- a/external/basisu/encoder/cppspmd_sse.h
|
|
||||||
+++ b/external/basisu/encoder/cppspmd_sse.h
|
|
||||||
@@ -493,7 +493,7 @@ struct spmd_kernel
|
|
||||||
CPPSPMD_FORCE_INLINE vfloat& store(vfloat&& dst, const vfloat& src)
|
|
||||||
{
|
|
||||||
dst.m_value = blendv_mask_ps(dst.m_value, src.m_value, _mm_castsi128_ps(m_exec.m_mask));
|
|
||||||
- return dst;
|
|
||||||
+ return { dst };
|
|
||||||
}
|
|
||||||
|
|
||||||
CPPSPMD_FORCE_INLINE vfloat& store_all(vfloat& dst, const vfloat& src)
|
|
||||||
@@ -505,7 +505,7 @@ struct spmd_kernel
|
|
||||||
CPPSPMD_FORCE_INLINE vfloat& store_all(vfloat&& dst, const vfloat& src)
|
|
||||||
{
|
|
||||||
dst.m_value = src.m_value;
|
|
||||||
- return dst;
|
|
||||||
+ return { dst };
|
|
||||||
}
|
|
||||||
|
|
||||||
// Linear ref to floats
|
|
||||||
Reference in New Issue
Block a user