Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move self-hosted dependencies to external folder #909

Merged
merged 25 commits into from
May 28, 2024
Merged
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
dd54f59
Move basisu to external folder
MathiasMagnus May 14, 2024
84f4b7a
Update scripts for basisu move
MathiasMagnus May 14, 2024
ea8163f
Update .gitignore for basisu move
MathiasMagnus May 14, 2024
8793601
Update dep5 for basisu move
MathiasMagnus May 14, 2024
193cce1
Move astc-encoder to external folder
MathiasMagnus May 14, 2024
fdeaad3
Update scripts for astc-encoder move
MathiasMagnus May 14, 2024
8b53c49
Update dep5 for astc-encoder move
MathiasMagnus May 14, 2024
e287cc2
Move cxxopts to external folder
MathiasMagnus May 14, 2024
a7c9bd5
Update scripts for cxxopts move
MathiasMagnus May 14, 2024
4551d55
Update README for cxxopts move
MathiasMagnus May 14, 2024
0a73ccd
Update dep5 for cxxopts move
MathiasMagnus May 14, 2024
713af76
Move fmt to external folder
MathiasMagnus May 14, 2024
9f4d208
Update scripts for fmt move
MathiasMagnus May 14, 2024
4b5d24f
Move dfdutils to external folder
MathiasMagnus May 14, 2024
80e31f0
Update scripts for dfdutils move
MathiasMagnus May 14, 2024
4ba0574
Update dep5 for dfdutils move
MathiasMagnus May 14, 2024
069699a
Move etcdec to external folder
MathiasMagnus May 14, 2024
d6af6fa
Update scripts for etcdec move
MathiasMagnus May 14, 2024
3f40369
Fix glloadtests on Windows
MathiasMagnus May 14, 2024
71520e4
Fix Emscripten build
MathiasMagnus May 16, 2024
6151f99
Fix ISO C++ conformance
MathiasMagnus May 16, 2024
4311d43
Fix vkloadtests on Windows
MathiasMagnus May 17, 2024
e64e7f9
Add missing dep5 coverage
MathiasMagnus May 17, 2024
fe1eeb3
Various Reuse fixes
MathiasMagnus May 21, 2024
6a79bb2
Fix Emscripten build
MathiasMagnus May 27, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
12 changes: 7 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,15 @@
/include/imdebug.h

# /lib/
/lib/astc-encoder/.gitmodules
/lib/astc-encoder/Source/GoogleTest
/lib/basisu/bin_osx
/lib/basisu/bin
/lib/basisu/build
/lib/src

# /external/
/external/astc-encoder/.gitmodules
/external/astc-encoder/Source/GoogleTest
/external/basisu/bin_osx
/external/basisu/bin
/external/basisu/build

# /testimages/
/testimages/*.png
/testimages/Thumbs.db
Expand Down
22 changes: 11 additions & 11 deletions .reuse/dep5
Original file line number Diff line number Diff line change
Expand Up @@ -70,48 +70,48 @@ Files: */*.json
Copyright: 2017-2020 Mark Callow
License: Apache-2.0

Files: lib/astc-encoder/Docs/* lib/astc-encoder/Test/* lib/astc-encoder/jenkins/* lib/astc-encoder/.gitattributes lib/astc-encoder/.gitignore lib/astc-encoder/.gitmodules lib/astc-encoder/.pylintrc lib/astc-encoder/README.md lib/astc-encoder/Utils/Example/README.md
Files: external/basisu/Docs/* external/basisu/Test/* external/basisu/jenkins/* external/basisu/.gitattributes external/basisu/.gitignore external/basisu/.gitmodules external/basisu/.pylintrc external/basisu/README.md external/basisu/Utils/Example/README.md
Copyright: 2020-2021 Arm Limited
License: Apache-2.0

Files: lib/astc-encoder/.gitrepo
Files: external/basisu/.gitrepo
Copyright: 2021 Mark Callow
License: Apache-2.0

Files: lib/astc-encoder/Source/stb_image*.h
Files: external/basisu/Source/stb_image*.h
Copyright: 2017 Sean Barrett
License: MIT

Files: lib/astc-encoder/Source/tinyexr.h
Files: external/basisu/Source/tinyexr.h
Copyright: 2014-2019 Syoyo Fujita and many contributors
License: BSD-3-Clause

Files: lib/astc-encoder/Source/wuffs-v0.3.c
Files: external/basisu/Source/wuffs-v0.3.c
Copyright: 2022 The Wuffs Authors.
License: Apache-2.0

# We have asked Binomial about REUSE compliance for their repo, see https://github.com/BinomialLLC/basis_universal/issues/165
Files: lib/basisu/*
Files: external/basisu/*
Copyright: 2019-2020 Binomial LLC
License: Apache-2.0

Files: lib/basisu/apg_bmp.* lib/basisu/CMakeLists.txt lib/basisu/webgl/transcoder/CMakeLists.txt
Files: external/basisu/apg_bmp.* external/basisu/CMakeLists.txt external/basisu/webgl/transcoder/CMakeLists.txt
Copyright: 2019 Anton Gerdelan
License: Apache-2.0

Files: lib/basisu/basisu_astc_decomp.*
Files: external/basisu/basisu_astc_decomp.*
Copyright: 2016 The Android Open Source Project
License: Apache-2.0

Files: tools/imageio/png.imageio/lodepng.*
Copyright: 2005-2019 Lode Vandevenne
License: Zlib

Files: lib/dfdutils/vulkan/*
Files: external/dfdutils/vulkan/*
Copyright: 2015-2020 The Khronos Group Inc.
License: Apache-2.0

Files: lib/dfdutils/.gitrepo
Files: external/dfdutils/.gitrepo
Copyright: 2019-2020 The Khronos Group Inc
License: Apache-2.0

Expand Down Expand Up @@ -205,6 +205,6 @@ Files: other_projects/fmt/*
Copyright: 2012 - present Victor Zverovich
License: MIT

Files: other_projects/cxxopts/*
Files: external/cxxopts/*
Copyright: 2014-2022 Jarryd Beck
License: MIT
165 changes: 83 additions & 82 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,12 @@ endif()
if(BASISU_SUPPORT_OPENCL AND WIN32 AND NOT OpenCL_FOUND)
# To avoid fiddly setting up of OpenCL on Windows CI VMs, use copy in repo.
set(OpenCL_INCLUDE_DIR
"${CMAKE_CURRENT_SOURCE_DIR}/lib/basisu/opencl"
"${CMAKE_CURRENT_SOURCE_DIR}/external/basisu/opencl"
# FORCE to override *-NOTFOUND set by the failed find.
CACHE PATH "" FORCE
)
set(OpenCL_LIBRARY
"${CMAKE_CURRENT_SOURCE_DIR}/lib/basisu/opencl/lib/OpenCL64.lib"
"${CMAKE_CURRENT_SOURCE_DIR}/external/basisu/opencl/lib/OpenCL64.lib"
CACHE FILEPATH "" FORCE
)
set(OpenCL_INCLUDE_DIRS ${OpenCL_INCLUDE_DIR})
Expand Down Expand Up @@ -300,7 +300,7 @@ else()
endif()

# To improve output determinism enable precise floating point operations globally
# This code was based on lib/astc-encoder/Source/cmake_core.cmake
# This code was based on external/astc-encoder/Source/cmake_core.cmake

# For Visual Studio prior to 2022 (compiler < 19.30) /fp:strict
# For Visual Studio 2022 (compiler >= 19.30) /fp:precise
Expand Down Expand Up @@ -356,26 +356,26 @@ set(KTX_MAIN_SRC
lib/basis_sgd.h
lib/basis_transcode.cpp
lib/miniz_wrapper.cpp
lib/basisu/transcoder/basisu_containers.h
lib/basisu/transcoder/basisu_containers_impl.h
lib/basisu/transcoder/basisu_file_headers.h
lib/basisu/transcoder/basisu_transcoder_internal.h
lib/basisu/transcoder/basisu_transcoder_uastc.h
lib/basisu/transcoder/basisu_transcoder.cpp
lib/basisu/transcoder/basisu_transcoder.h
lib/basisu/transcoder/basisu.h
lib/basisu/zstd/zstd.c
external/basisu/transcoder/basisu_containers.h
external/basisu/transcoder/basisu_containers_impl.h
external/basisu/transcoder/basisu_file_headers.h
external/basisu/transcoder/basisu_transcoder_internal.h
external/basisu/transcoder/basisu_transcoder_uastc.h
external/basisu/transcoder/basisu_transcoder.cpp
external/basisu/transcoder/basisu_transcoder.h
external/basisu/transcoder/basisu.h
external/basisu/zstd/zstd.c
lib/checkheader.c
lib/dfdutils/createdfd.c
lib/dfdutils/colourspaces.c
lib/dfdutils/dfd.h
lib/dfdutils/interpretdfd.c
lib/dfdutils/printdfd.c
lib/dfdutils/queries.c
lib/dfdutils/vk2dfd.c
lib/dfdutils/vk2dfd.inl
lib/dfdutils/vulkan/vk_platform.h
lib/dfdutils/vulkan/vulkan_core.h
external/dfdutils/createdfd.c
external/dfdutils/colourspaces.c
external/dfdutils/dfd.h
external/dfdutils/interpretdfd.c
external/dfdutils/printdfd.c
external/dfdutils/queries.c
external/dfdutils/vk2dfd.c
external/dfdutils/vk2dfd.inl
external/dfdutils/vulkan/vk_platform.h
external/dfdutils/vulkan/vulkan_core.h
lib/etcunpack.cxx
lib/filestream.c
lib/filestream.h
Expand Down Expand Up @@ -406,48 +406,48 @@ set(KTX_MAIN_SRC

if (KTX_FEATURE_ETC_UNPACK)
list(APPEND KTX_MAIN_SRC
lib/etcdec.cxx
external/etcdec/etcdec.cxx
)
endif()

set(BASISU_ENCODER_CXX_SRC
lib/basisu/encoder/basisu_backend.cpp
lib/basisu/encoder/basisu_backend.h
lib/basisu/encoder/basisu_basis_file.cpp
lib/basisu/encoder/basisu_basis_file.h
lib/basisu/encoder/basisu_bc7enc.cpp
lib/basisu/encoder/basisu_bc7enc.h
lib/basisu/encoder/basisu_comp.cpp
lib/basisu/encoder/basisu_comp.h
lib/basisu/encoder/basisu_enc.cpp
lib/basisu/encoder/basisu_enc.h
lib/basisu/encoder/basisu_etc.cpp
lib/basisu/encoder/basisu_etc.h
lib/basisu/encoder/basisu_frontend.cpp
lib/basisu/encoder/basisu_frontend.h
lib/basisu/encoder/basisu_gpu_texture.cpp
lib/basisu/encoder/basisu_gpu_texture.h
lib/basisu/encoder/basisu_kernels_declares.h
lib/basisu/encoder/basisu_kernels_imp.h
lib/basisu/encoder/basisu_kernels_sse.cpp
lib/basisu/encoder/basisu_miniz.h
lib/basisu/encoder/basisu_opencl.cpp
lib/basisu/encoder/basisu_opencl.h
lib/basisu/encoder/basisu_pvrtc1_4.cpp
lib/basisu/encoder/basisu_pvrtc1_4.h
lib/basisu/encoder/basisu_resample_filters.cpp
lib/basisu/encoder/basisu_resampler_filters.h
lib/basisu/encoder/basisu_resampler.cpp
lib/basisu/encoder/basisu_resampler.h
lib/basisu/encoder/basisu_ssim.cpp
lib/basisu/encoder/basisu_ssim.h
lib/basisu/encoder/basisu_uastc_enc.cpp
lib/basisu/encoder/basisu_uastc_enc.h
lib/basisu/encoder/cppspmd_flow.h
lib/basisu/encoder/cppspmd_math.h
lib/basisu/encoder/cppspmd_math_declares.h
lib/basisu/encoder/cppspmd_sse.h
lib/basisu/encoder/cppspmd_type_aliases.h
external/basisu/encoder/basisu_backend.cpp
external/basisu/encoder/basisu_backend.h
external/basisu/encoder/basisu_basis_file.cpp
external/basisu/encoder/basisu_basis_file.h
external/basisu/encoder/basisu_bc7enc.cpp
external/basisu/encoder/basisu_bc7enc.h
external/basisu/encoder/basisu_comp.cpp
external/basisu/encoder/basisu_comp.h
external/basisu/encoder/basisu_enc.cpp
external/basisu/encoder/basisu_enc.h
external/basisu/encoder/basisu_etc.cpp
external/basisu/encoder/basisu_etc.h
external/basisu/encoder/basisu_frontend.cpp
external/basisu/encoder/basisu_frontend.h
external/basisu/encoder/basisu_gpu_texture.cpp
external/basisu/encoder/basisu_gpu_texture.h
external/basisu/encoder/basisu_kernels_declares.h
external/basisu/encoder/basisu_kernels_imp.h
external/basisu/encoder/basisu_kernels_sse.cpp
external/basisu/encoder/basisu_miniz.h
external/basisu/encoder/basisu_opencl.cpp
external/basisu/encoder/basisu_opencl.h
external/basisu/encoder/basisu_pvrtc1_4.cpp
external/basisu/encoder/basisu_pvrtc1_4.h
external/basisu/encoder/basisu_resample_filters.cpp
external/basisu/encoder/basisu_resampler_filters.h
external/basisu/encoder/basisu_resampler.cpp
external/basisu/encoder/basisu_resampler.h
external/basisu/encoder/basisu_ssim.cpp
external/basisu/encoder/basisu_ssim.h
external/basisu/encoder/basisu_uastc_enc.cpp
external/basisu/encoder/basisu_uastc_enc.h
external/basisu/encoder/cppspmd_flow.h
external/basisu/encoder/cppspmd_math.h
external/basisu/encoder/cppspmd_math_declares.h
external/basisu/encoder/cppspmd_sse.h
external/basisu/encoder/cppspmd_type_aliases.h
)

if(KTX_FEATURE_GL_UPLOAD)
Expand All @@ -473,7 +473,7 @@ elseif(APPLE_MAC_OS OR LINUX)
endif()

set(KTX_BASISU_INCLUDE_DIRS
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/lib/basisu/transcoder>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/external/basisu/transcoder>
)

# Main library
Expand Down Expand Up @@ -562,10 +562,10 @@ macro(common_libktx_settings target enable_write library_type)
$<INSTALL_INTERFACE:include>
PRIVATE
${KTX_BASISU_INCLUDE_DIRS}
$<INSTALL_INTERFACE:lib/basisu/transcoder>
external

$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/lib/basisu/zstd>
$<INSTALL_INTERFACE:lib/basisu/zstd>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/external/basisu/zstd>
$<INSTALL_INTERFACE:external/basisu/zstd>

$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/utils>
$<INSTALL_INTERFACE:utils>
Expand Down Expand Up @@ -706,8 +706,8 @@ macro(common_libktx_settings target enable_write library_type)
target_include_directories(
${target}
PRIVATE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/lib/dfdutils>
$<INSTALL_INTERFACE:lib/dfdutils>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/external/dfdutils>
$<INSTALL_INTERFACE:external/dfdutils>
)

get_target_property( KTX_PUBLIC_HEADER ${target} PUBLIC_HEADER )
Expand Down Expand Up @@ -735,8 +735,8 @@ macro(common_libktx_settings target enable_write library_type)
target_include_directories(
${target}
PRIVATE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/lib/basisu>
$<INSTALL_INTERFACE:lib/basisu>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/external/basisu>
$<INSTALL_INTERFACE:external/basisu>
$<$<BOOL:${BASISU_SUPPORT_OPENCL}>:${OpenCL_INCLUDE_DIRS}>
)
target_compile_definitions(
Expand Down Expand Up @@ -817,7 +817,7 @@ elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
PROPERTIES COMPILE_OPTIONS "-Wno-sign-compare;-Wno-unused-variable;-Wno-class-memaccess;-Wno-misleading-indentation;-Wno-extra;-Wno-deprecated-copy;-Wno-parentheses;-Wno-strict-aliasing"
)
set_source_files_properties(
lib/basisu/transcoder/basisu_transcoder.cpp
external/basisu/transcoder/basisu_transcoder.cpp
PROPERTIES COMPILE_OPTIONS "-Wno-sign-compare;-Wno-unused-function;-Wno-unused-variable;-Wno-class-memaccess;-Wno-maybe-uninitialized"
)
if (${CMAKE_CXX_COMPILER_VERSION} VERSION_GREATER_EQUAL "11")
Expand All @@ -827,11 +827,11 @@ elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
# the facts that we have never seen a crash and version 12 no
# longer raises the warnings.
get_source_file_property(cur_options
lib/basisu/encoder/basisu_comp.cpp
external/basisu/encoder/basisu_comp.cpp
COMPILE_OPTIONS
)
set_source_files_properties(
lib/basisu/encoder/basisu_comp.cpp
external/basisu/encoder/basisu_comp.cpp
PROPERTIES COMPILE_OPTIONS "${cur_options};-Wno-stringop-overflow"
)
endif()
Expand All @@ -842,7 +842,7 @@ elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
# line 326, where the error is raised, to be > the array length.
# Also we have never seen any crashes.
set_source_files_properties(
lib/basisu/encoder/basisu_uastc_enc.cpp
external/basisu/encoder/basisu_uastc_enc.cpp
PROPERTIES COMPILE_OPTIONS "-Wno-stringop-overflow"
)
endif()
Expand All @@ -867,11 +867,11 @@ elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
endif()
# BEWARE: set_source_files_properties is not additive; it replaces.
if (${clang_version} VERSION_GREATER_EQUAL "12.0.0")
set_source_files_properties( lib/basisu/encoder/basisu_kernels_sse.cpp
set_source_files_properties( external/basisu/encoder/basisu_kernels_sse.cpp
PROPERTIES COMPILE_OPTIONS "-Wno-unused-parameter;-Wno-deprecated-copy;-Wno-uninitialized-const-reference"
)
else()
set_source_files_properties( lib/basisu/encoder/basisu_kernels_sse.cpp
set_source_files_properties( external/basisu/encoder/basisu_kernels_sse.cpp
PROPERTIES COMPILE_OPTIONS "-Wno-unused-parameter"
)
endif()
Expand All @@ -883,11 +883,11 @@ elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
PROPERTIES COMPILE_OPTIONS "-Wno-sign-compare;-Wno-unused-variable;-Wno-unused-parameter;-Wno-deprecated-copy-with-user-provided-copy"
)
set_source_files_properties(
lib/basisu/transcoder/basisu_transcoder.cpp
external/basisu/transcoder/basisu_transcoder.cpp
PROPERTIES COMPILE_OPTIONS "-Wno-sign-compare;-Wno-unused-function;-Wno-unused-variable"
)
set_source_files_properties(
lib/basisu/zstd/zstd.c
external/basisu/zstd/zstd.c
PROPERTIES COMPILE_OPTIONS "-Wno-unused-function"
)
endif()
Expand All @@ -900,10 +900,10 @@ endif()
# target to retrieve these from the ktx target are not available until
# v18 and we still need to work with v16 in the Emscripten Docker image.
get_source_file_property(transcoder_options
lib/basisu/transcoder/basisu_transcoder.cpp
external/basisu/transcoder/basisu_transcoder.cpp
COMPILE_OPTIONS
)
get_source_file_property(zstd_options lib/basisu/zstd/zstd.c COMPILE_OPTIONS)
get_source_file_property(zstd_options external/basisu/zstd/zstd.c COMPILE_OPTIONS)

if(EMSCRIPTEN)
set(
Expand Down Expand Up @@ -948,7 +948,8 @@ if(EMSCRIPTEN)
target_include_directories( msc_basis_transcoder_js
PRIVATE
lib
lib/basisu/transcoder
external
external/basisu/transcoder
)

# Re-use ktx's compile options
Expand Down Expand Up @@ -1074,7 +1075,7 @@ endif()

# astcenc
set(ASTCENC_CLI OFF) # Only build as library not the CLI astcencoder
add_subdirectory(lib/astc-encoder)
add_subdirectory(external/astc-encoder)
set_property(TARGET ${ASTCENC_LIB_TARGET} PROPERTY POSITION_INDEPENDENT_CODE ON)

if(KTX_FEATURE_STATIC_LIBRARY AND APPLE)
Expand All @@ -1100,10 +1101,10 @@ endif()
if((KTX_FEATURE_TOOLS OR KTX_FEATURE_TESTS) AND NOT TARGET fmt::fmt)
set(FMT_INSTALL OFF)
set(FMT_SYSTEM_HEADERS ON)
add_subdirectory(other_projects/fmt)
add_subdirectory(external/fmt)
endif()
if(KTX_FEATURE_TOOLS AND NOT TARGET cxxopts::cxxopts)
add_subdirectory(other_projects/cxxopts)
add_subdirectory(external/cxxopts)
endif()

# Tools
Expand Down
Loading