### Texconv Command-Line Conversion Examples Source: https://context7.com/matyalatte/texconv-custom-dll/llms.txt Demonstrates various command-line operations for texconv, including converting between formats, applying compression, generating mipmaps, and resizing textures. These examples are suitable for scripting and batch processing. ```bash # Windows mkdir outdir texconv.exe -ft tga -o outdir -y -- input.dds # Linux/macOS mkdir outdir ./texconv -ft tga -o outdir -y -- input.dds # Output: outdir/input.tga ``` ```bash # Requires Windows build with DirectX 11/12 support texconv.exe -f BC7_UNORM -o compressed -y -- texture.png # Force CPU compression (cross-platform) ./texconv -f BC7_UNORM -nogpu -o compressed -y -- texture.png ``` ```bash # Generate full mipmap chain and resize to 512x512 ./texconv -m 0 -w 512 -h 512 -o processed -y -- large_texture.dds # Apply specific mipmap filter ./texconv -m 10 -if CUBIC -o mipmapped -y -- texture.dds ``` -------------------------------- ### Install Build Tools Source: https://github.com/matyalatte/texconv-custom-dll/blob/main/CMakeLists.txt Installs the compiled tool executables to the binary directory when `BUILD_TOOLS` is enabled and not using a VCPKG toolchain. ```cmake if(BUILD_TOOLS AND (NOT VCPKG_TOOLCHAIN)) foreach(t IN LISTS TOOL_EXES) install(TARGETS ${t} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) endforeach() endif() ``` -------------------------------- ### C++ Texconv with Manual COM Initialization Source: https://context7.com/matyalatte/texconv-custom-dll/llms.txt A C++ example demonstrating how to manually initialize and uninitialize the COM library when using texconv on Windows. This is useful for scenarios requiring fine-grained control over COM object lifecycles, especially in multi-threaded applications or when performing numerous conversions in a batch. ```c++ typedef int (*init_com_func)(); typedef void (*uninit_com_func)(); void batch_conversion_with_com() { #ifdef _WIN32 HMODULE lib = LoadLibraryA("texconv.dll"); auto init_com = (init_com_func)GetProcAddress(lib, "init_com"); auto uninit_com = (uninit_com_func)GetProcAddress(lib, "uninit_com"); auto texconv = (texconv_func)GetProcAddress(lib, "texconv"); // Initialize COM once for multiple conversions int com_result = init_com(); // Returns: 0 = success, 1 = already initialized, // -2147417850 = initialized with single-thread mode if (com_result == 0 || com_result == 1) { // Perform multiple conversions without re-initializing COM for (const auto& file : texture_files) { std::vector args = { (wchar_t*)L"-ft", (wchar_t*)L"dds", (wchar_t*)L"-o", (wchar_t*)L"batch_output", (wchar_t*)L"-y", (wchar_t*)L"--", (wchar_t*)file.c_str() }; wchar_t err_buf[512]; texconv(args.size(), args.data(), false, false, true, err_buf, 512); } // Cleanup COM after all conversions uninit_com(); } FreeLibrary(lib); #endif } ``` -------------------------------- ### Configure LibJPEG Support Source: https://github.com/matyalatte/texconv-custom-dll/blob/main/CMakeLists.txt Finds the LibJPEG library if enabled and links it to the project. Requires LibJPEG to be installed and discoverable by CMake. ```cmake if(ENABLE_LIBJPEG_SUPPORT) find_package(JPEG REQUIRED) target_link_libraries(${PROJECT_NAME} PUBLIC JPEG::JPEG) endif() ``` -------------------------------- ### Configure LibPNG Support Source: https://github.com/matyalatte/texconv-custom-dll/blob/main/CMakeLists.txt Finds the LibPNG library if enabled and links it to the project. Requires LibPNG to be installed and discoverable by CMake. ```cmake if(ENABLE_LIBPNG_SUPPORT) find_package(PNG REQUIRED) target_link_libraries(${PROJECT_NAME} PUBLIC PNG::PNG) endif() ``` -------------------------------- ### Texture Assembly using texassemble C/C++ Source: https://context7.com/matyalatte/texconv-custom-dll/llms.txt Demonstrates how to assemble cubemaps from individual image files using the texassemble function from Texconv-Custom-DLL. This C/C++ example shows dynamic library loading and argument preparation for creating a cubemap DDS file from six input images (e.g., PNG). Requires texassemble support to be enabled during build. ```c++ // Requires: cmake -DTEXCONV_USE_TEXASSEMBLE=ON typedef int (*texassemble_func)(int argc, wchar_t* argv[], bool verbose, bool init_com, wchar_t* err_buf, int err_buf_size); void create_cubemap() { LibHandle lib = dlopen("./libtexconv.so", RTLD_LAZY); auto texassemble = (texassemble_func)dlsym(lib, "texassemble"); // Assemble 6 faces into a cubemap DDS std::vector args = { (wchar_t*)L"cube", (wchar_t*)L"-o", (wchar_t*)L"skybox.dds", (wchar_t*)L"-y", (wchar_t*)L"front.png", (wchar_t*)L"back.png", (wchar_t*)L"left.png", (wchar_t*)L"right.png", (wchar_t*)L"top.png", (wchar_t*)L"bottom.png" }; wchar_t err_buf[512]; int result = texassemble(args.size(), args.data(), true, true, err_buf, 512); if (result == 0) { printf("Cubemap created successfully\n"); } dlclose(lib); } ``` -------------------------------- ### Programmatic DDS Conversion using texconv C/C++ Source: https://context7.com/matyalatte/texconv-custom-dll/llms.txt Demonstrates how to programmatically convert DDS textures using the texconv function from the Texconv-Custom-DLL library. This C/C++ example shows loading the shared library, preparing arguments for conversion (e.g., to TGA with BC7 decompression), and executing the conversion process. It handles dynamic library loading and error reporting across different platforms. ```c++ #include #include #ifdef _WIN32 #include typedef HMODULE LibHandle; #else #include typedef void* LibHandle; #endif // Function signature typedef int (*texconv_func)(int argc, wchar_t* argv[], bool verbose, bool init_com, bool allow_slow_codec, wchar_t* err_buf, int err_buf_size); int main() { // Load library #ifdef _WIN32 LibHandle lib = LoadLibraryA("texconv.dll"); auto texconv = (texconv_func)GetProcAddress(lib, "texconv"); #else LibHandle lib = dlopen("./libtexconv.so", RTLD_LAZY); auto texconv = (texconv_func)dlsym(lib, "texconv"); #endif // Prepare arguments: convert DDS to TGA with BC7 decompression std::vector args = { (wchar_t*)L"-ft", (wchar_t*)L"tga", (wchar_t*)L"-o", (wchar_t*)L"output", (wchar_t*)L"-y", // overwrite (wchar_t*)L"--", (wchar_t*)L"input.dds" }; wchar_t err_buf[512] = {0}; // Execute conversion int result = texconv(args.size(), args.data(), true, // verbose output true, // initialize COM (Windows) true, // allow CPU codec for BC6/BC7 err_buf, 512); if (result != 0) { wprintf(L"Error: %s\n", err_buf); return 1; } #ifdef _WIN32 FreeLibrary(lib); #else dlclose(lib); #endif return 0; } ``` -------------------------------- ### Configure OpenEXR Support Source: https://github.com/matyalatte/texconv-custom-dll/blob/main/CMakeLists.txt Finds the OpenEXR library if enabled and links it to the project. Requires OpenEXR to be installed and discoverable by CMake. ```cmake if(ENABLE_OPENEXR_SUPPORT) find_package(OpenEXR REQUIRED) target_link_libraries(${PROJECT_NAME} PUBLIC OpenEXR::OpenEXR) endif() ``` -------------------------------- ### Download sal.h using CMake Source: https://github.com/matyalatte/texconv-custom-dll/blob/main/unix_external/CMakeLists.txt This CMake snippet shows how to download the `sal.h` header file from a GitHub repository. It specifies the download URL, the destination path, enables progress display, and includes an expected SHA256 hash for verification to ensure data integrity. ```cmake # Download sal.h set(SAL_DIR ${CMAKE_CURRENT_SOURCE_DIR}/sal) file(MAKE_DIRECTORY ${SAL_DIR}) file(DOWNLOAD https://raw.githubusercontent.com/dotnet/corert/master/src/Native/inc/unix/sal.h ${SAL_DIR}/sal.h SHOW_PROGRESS EXPECTED_HASH SHA256=bb9ea7c1d05cdfc10a17fe80d87a7cd160c1063c7e5fa089cd6405c31c610a1b ) ``` -------------------------------- ### Build DDSView Sample (CMake) Source: https://github.com/matyalatte/texconv-custom-dll/blob/main/CMakeLists.txt Configures the DDSView sample application, which requires DX11 and Windows. It sets up the executable, links necessary libraries (DirectXTex, d3d11, ole32), and includes compiled shaders as part of the build process. ```cmake #--- DDSView sample if(BUILD_SAMPLE AND BUILD_DX11 AND WIN32) list(APPEND TOOL_EXES ddsview) if(NOT COMPILED_DDSVIEW_SHADERS) if(USE_PREBUILT_SHADERS) message(FATAL_ERROR "ERROR: Using prebuilt shaders requires the COMPILED_DDSVIEW_SHADERS variable is set") endif() set(COMPILED_DDSVIEW_SHADERS ${CMAKE_CURRENT_BINARY_DIR}/Shaders/Compiled) file(MAKE_DIRECTORY ${COMPILED_DDSVIEW_SHADERS}) else() file(TO_CMAKE_PATH ${COMPILED_DDSVIEW_SHADERS} COMPILED_DDSVIEW_SHADERS) endif() add_executable(ddsview WIN32 DDSView/ddsview.cpp DDSView/ddsview.rc ${COMPILED_DDSVIEW_SHADERS}/ddsview_ps1D.inc) target_link_libraries(ddsview PRIVATE ${PROJECT_NAME} d3d11.lib ole32.lib) source_group(ddsview REGULAR_EXPRESSION DDSView/*.*) target_include_directories(ddsview PRIVATE ${COMPILED_DDSVIEW_SHADERS}) endif() ``` -------------------------------- ### Build Texconv-Custom-DLL with Optional Features Source: https://context7.com/matyalatte/texconv-custom-dll/llms.txt Demonstrates building Texconv-Custom-DLL with specific optional features enabled or disabled via CMake flags. This includes enabling texassemble support, disabling GPU codecs, and adding support for JPEG and PNG image formats. Dependencies for external image formats must be met. ```bash # Enable texassemble support and disable GPU codec mkdir build && cd build cmake .. -DTEXCONV_USE_TEXASSEMBLE=ON -DTEXCONV_NO_GPU_CODEC=ON cmake --build . --config Release # Build with JPEG and PNG support (requires dependencies) cmake .. -DENABLE_LIBJPEG_SUPPORT=ON -DENABLE_LIBPNG_SUPPORT=ON cmake --build . --config Release ``` -------------------------------- ### OpenEXR, libjpeg, and libpng Support Configuration (CMake) Source: https://github.com/matyalatte/texconv-custom-dll/blob/main/CMakeLists.txt Conditionally adds headers and sources for optional image format support (OpenEXR, JPEG, PNG). It includes messages recommending WIC over libjpeg/libpng on Windows and checks for environment variables for library paths. ```cmake if(ENABLE_OPENEXR_SUPPORT) list(APPEND LIBRARY_HEADERS Auxiliary/DirectXTexEXR.h) list(APPEND LIBRARY_SOURCES Auxiliary/DirectXTexEXR.cpp) endif() if(ENABLE_LIBJPEG_SUPPORT) if(WIN32) message(STATUS "Use of the Windows Imaging Component (WIC) instead of libjpeg is recommended.") endif() list(APPEND LIBRARY_HEADERS DirectXTex/Auxiliary/DirectXTexJPEG.h) list(APPEND LIBRARY_SOURCES DirectXTex/Auxiliary/DirectXTexJPEG.cpp) endif() if(ENABLE_LIBPNG_SUPPORT) if(WIN32) message(STATUS "Use of the Windows Imaging Component (WIC) instead of libpng is recommended.") endif() list(APPEND LIBRARY_HEADERS DirectXTex/Auxiliary/DirectXTexPNG.h) list(APPEND LIBRARY_SOURCES DirectXTex/Auxiliary/DirectXTexPNG.cpp) endif() ``` -------------------------------- ### Configure Clang/IntelLLVM Compiler Warnings Source: https://github.com/matyalatte/texconv-custom-dll/blob/main/CMakeLists.txt Sets up a comprehensive list of warning flags for Clang and IntelLLVM compilers, including options specific to Xbox development and newer compiler versions. This aims to improve code quality by enabling strict warning checks. ```cmake if(CMAKE_CXX_COMPILER_ID MATCHES "Clang|IntelLLVM") set(WarningsLib -Wall -Wpedantic -Wextra) if((BUILD_XBOX_EXTS_XBOXONE OR BUILD_XBOX_EXTS_SCARLETT) AND WIN32) list(APPEND WarningsLib "-Wno-microsoft-enum-value" "-Wno-non-virtual-dtor" "-Wno-ignored-pragmas" "-Wno-deprecated-dynamic-exception-spec") if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 13.0) list(APPEND WarningsLib "-Wno-reserved-identifier") endif() endif() if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 16.0) list(APPEND WarningsLib "-Wno-unsafe-buffer-usage") endif() target_compile_options(${PROJECT_NAME} PRIVATE ${WarningsLib}) set(WarningsEXE ${WarningsLib} "-Wno-c++98-compat" "-Wno-c++98-compat-pedantic" "-Wno-switch" "-Wno-switch-enum" "-Wno-switch-default" "-Wno-covered-switch-default" "-Wno-language-extension-token" "-Wno-missing-prototypes" "-Wno-global-constructors" "-Wno-double-promotion") foreach(t IN LISTS TOOL_EXES) target_compile_options(${t} PRIVATE ${WarningsEXE}) endforeach() ``` -------------------------------- ### init_com DLL Function Source: https://github.com/matyalatte/texconv-custom-dll/blob/main/docs/Usage.md The `init_com` function initializes the Component Object Model (COM) on Windows, which is necessary for certain DirectXTex functionalities. It should be called once per process. On Unix-like systems, this function has no effect. ```c++ int init_com() ``` -------------------------------- ### CMake Project Configuration Source: https://github.com/matyalatte/texconv-custom-dll/blob/main/CMakeLists.txt Sets the minimum CMake version, project name, version, description, and homepage. It also specifies the programming languages to be used (C and CXX). ```cmake cmake_minimum_required (VERSION 3.20) set(DIRECTXTEX_VERSION 2.0.4) project (DirectXTex VERSION ${DIRECTXTEX_VERSION} DESCRIPTION "DirectX Texture Library" HOMEPAGE_URL "https://go.microsoft.com/fwlink/?LinkId=248926" LANGUAGES C CXX) ``` -------------------------------- ### CMake C++ Standard and Output Directories Source: https://github.com/matyalatte/texconv-custom-dll/blob/main/CMakeLists.txt Configures the C++ standard to C++17 and ensures it's required. It also sets the output directories for archives, libraries, and executables. ```cmake set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib") set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib") set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin") ``` -------------------------------- ### Build texassemble Executable (CMake) Source: https://github.com/matyalatte/texconv-custom-dll/blob/main/CMakeLists.txt Defines the texassemble executable, listing its source files, compile features, and platform-specific libraries. It includes support for animated GIFs and icons. ```cmake set(TEXASSEMBLE_FILES ${TEXASSEMBLE_FILES} DirectXTex/Texassemble/AnimatedGif.cpp) endif() if (TEXCONV_ICON_FOR_EXE) set(TEXASSEMBLE_FILES ${TEXASSEMBLE_FILES} TexconvDLL/texconv.rc) endif() set(TEXASSEMBLE_FILES ${TEXASSEMBLE_FILES} DirectXTex/Common/settings.manifest) endif() add_executable(texassemble ${TEXASSEMBLE_FILES}) target_compile_features(texassemble PRIVATE cxx_std_17) if (WIN32) target_link_libraries(texassemble PRIVATE ${PROJECT_NAME} ole32.lib version.lib) else() # unix need a library for safe functions target_link_libraries(texassemble PRIVATE ${PROJECT_NAME} safestring_static) endif() source_group(texassemble FILES ${TEXASSEMBLE_FILES}) list(APPEND TOOL_EXES texassemble) endif() ``` -------------------------------- ### Configure DirectXMath Library in CMake Source: https://github.com/matyalatte/texconv-custom-dll/blob/main/unix_external/CMakeLists.txt This CMake configuration sets up an INTERFACE library for DirectXMath. It defines the include directories, including the downloaded `sal.h` path, and specifies C++11 as a required compilation feature. An alias is also created for convenient usage. ```cmake # DirectXMath add_library(DirectXMath INTERFACE) target_include_directories(DirectXMath INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/DirectXMath/Inc ${CMAKE_CURRENT_SOURCE_DIR}/sal ) target_compile_features(DirectXMath INTERFACE cxx_std_11) add_library(Microsoft::DirectXMath ALIAS DirectXMath) ``` -------------------------------- ### uninit_com DLL Function Source: https://github.com/matyalatte/texconv-custom-dll/blob/main/docs/Usage.md The `uninit_com` function uninitializes the Component Object Model (COM) on Windows. It should be called after completing operations that required `init_com()`. On Unix-like systems, this function has no effect. ```c++ void uninit_com() ``` -------------------------------- ### Configure DirectX and Windows Version Source: https://github.com/matyalatte/texconv-custom-dll/blob/main/CMakeLists.txt Sets the Windows version (`WINVER`) based on DirectX build flags and architecture. It targets specific Windows SDK versions for compatibility. ```cmake elseif(BUILD_DX12 OR (${DIRECTX_ARCH} MATCHES "^arm64")) message(STATUS "Building with DirectX 12 Runtime support") set(WINVER 0x0A00) elseif(${DIRECTX_ARCH} MATCHES "^arm") set(WINVER 0x0602) else() message(STATUS "Building with Windows 7 compatibility") set(WINVER 0x0601) target_compile_definitions(${PROJECT_NAME} PRIVATE _WIN7_PLATFORM_UPDATE) endif() foreach(t IN LISTS TOOL_EXES ITEMS ${PROJECT_NAME}) target_compile_definitions(${t} PRIVATE _WIN32_WINNT=${WINVER}) endforeach() if(DISABLE_MSVC_ITERATOR_DEBUGGING) foreach(t IN LISTS TOOL_EXES ITEMS ${PROJECT_NAME}) target_compile_definitions(${t} PRIVATE _ITERATOR_DEBUG_LEVEL=0) endforeach() endif() endif() ``` -------------------------------- ### Enable libpng Support for Tools (CMake) Source: https://github.com/matyalatte/texconv-custom-dll/blob/main/CMakeLists.txt Conditionally enables libpng support for all tools in TOOL_EXES. This involves adding include directories, linking against the PNG::PNG target, and defining USE_LIBPNG. ```cmake if(BUILD_TOOLS) # ... other library support blocks ... if(ENABLE_LIBPNG_SUPPORT) foreach(t IN LISTS TOOL_EXES) target_include_directories(${t} PRIVATE DirectXTex/Auxiliary) target_link_libraries(${t} PRIVATE PNG::PNG) target_compile_definitions(${t} PRIVATE USE_LIBPNG) endforeach() endif() # ... other library support blocks ... endif() ``` -------------------------------- ### Configure DirectXMath and DirectX-Headers (Windows) Source: https://github.com/matyalatte/texconv-custom-dll/blob/main/CMakeLists.txt Finds DirectXMath and DirectX-Headers for Windows builds. If they are not found, it may lead to build errors. ```cmake if (WIN32) find_package(directxmath CONFIG REQUIRED) find_package(directx-headers CONFIG REQUIRED) else() message("INFO: Using a subdirectory 'unix_external' for DirectX-Headers, DirectXMath, and safestringlib.") add_subdirectory(unix_external) endif() else() find_package(directxmath CONFIG QUIET) find_package(directx-headers CONFIG QUIET) endif() ``` -------------------------------- ### Set Windows Version Source: https://github.com/matyalatte/texconv-custom-dll/blob/main/CMakeLists.txt Sets the minimum Windows version to 0x0602 (Windows 8) for Durango Xbox console targets. This influences the set of Windows APIs and features available during compilation. ```cmake if(WIN32) if(XBOX_CONSOLE_TARGET STREQUAL "durango") set(WINVER 0x0602) ``` -------------------------------- ### Enable libjpeg Support for Tools (CMake) Source: https://github.com/matyalatte/texconv-custom-dll/blob/main/CMakeLists.txt Conditionally enables libjpeg support for all tools in TOOL_EXES. This adds include directories, links against the JPEG::JPEG target, and defines USE_LIBJPEG. ```cmake if(BUILD_TOOLS) # ... other library support blocks ... if(ENABLE_LIBJPEG_SUPPORT) foreach(t IN LISTS TOOL_EXES) target_include_directories(${t} PRIVATE DirectXTex/Auxiliary) target_link_libraries(${t} PRIVATE JPEG::JPEG) target_compile_definitions(${t} PRIVATE USE_LIBJPEG) endforeach() endif() # ... other library support blocks ... endif() ``` -------------------------------- ### Configure Xbox Series X|S Extensions Source: https://github.com/matyalatte/texconv-custom-dll/blob/main/CMakeLists.txt Builds Xbox extensions for Xbox Series X|S if the necessary GameDK is found. It defines imported library targets and compiles definitions. ```cmake if(BUILD_XBOX_EXTS_SCARLETT AND WIN32) if(EXISTS "${GameDK_DIR}/GXDK/toolKit/include/gxdk.h") message(STATUS "Building Xbox extensions for Xbox Series X|S") add_library(Xbox::GDKX SHARED IMPORTED) set_target_properties(Xbox::GDKX PROPERTIES IMPORTED_LOCATION "${GameDK_DIR}/GXDK/bin/Scarlett/xg_xs.dll" IMPORTED_IMPLIB "${GameDK_DIR}/GXDK/toolKit/lib/amd64/Scarlett/xg_xs.lib" MAP_IMPORTED_CONFIG_MINSIZEREL "" MAP_IMPORTED_CONFIG_RELWITHDEBINFO "" INTERFACE_COMPILE_DEFINITIONS "_USE_GXDK;_USE_SCARLETT" INTERFACE_INCLUDE_DIRECTORIES "${GameDK_DIR}/GXDK/toolKit/include;${GameDK_DIR}/GXDK/toolKit/include/Scarlett") target_compile_definitions(${PROJECT_NAME} PRIVATE USE_XBOX_EXTS) target_link_libraries(${PROJECT_NAME} PUBLIC Xbox::GDKX) else() message(FATAL_ERROR "Building Xbox extensions requires GameDKLatest") endif() ... ``` -------------------------------- ### Library Headers and Sources Definition (CMake) Source: https://github.com/matyalatte/texconv-custom-dll/blob/main/CMakeLists.txt Defines lists for library header and source files. These lists are used later to build the static library. The sources include various DirectXTex files and platform-specific additions for Windows and Xbox. ```cmake set(LIBRARY_HEADERS DirectXTex/DirectXTex/DirectXTex.h DirectXTex/DirectXTex/DirectXTex.inl) set(LIBRARY_SOURCES DirectXTex/DirectXTex/BC.h DirectXTex/DirectXTex/DDS.h DirectXTex/DirectXTex/DirectXTexP.h DirectXTex/DirectXTex/filters.h DirectXTex/DirectXTex/scoped.h DirectXTex/DirectXTex/BC.cpp DirectXTex/DirectXTex/BC4BC5.cpp DirectXTex/DirectXTex/BC6HBC7.cpp DirectXTex/DirectXTex/DirectXTexCompress.cpp DirectXTex/DirectXTex/DirectXTexConvert.cpp DirectXTex/DirectXTex/DirectXTexDDS.cpp DirectXTex/DirectXTex/DirectXTexHDR.cpp DirectXTex/DirectXTex/DirectXTexImage.cpp DirectXTex/DirectXTex/DirectXTexMipmaps.cpp DirectXTex/DirectXTex/DirectXTexMisc.cpp DirectXTex/DirectXTex/DirectXTexNormalMaps.cpp DirectXTex/DirectXTex/DirectXTexPMAlpha.cpp DirectXTex/DirectXTex/DirectXTexResize.cpp DirectXTex/DirectXTex/DirectXTexTGA.cpp DirectXTex/DirectXTex/DirectXTexUtil.cpp) if(WIN32) list(APPEND LIBRARY_SOURCES DirectXTex/DirectXTex/DirectXTexFlipRotate.cpp DirectXTex/DirectXTex/DirectXTexWIC.cpp) endif() ``` -------------------------------- ### Configure TexconvDLL Config Header Source: https://github.com/matyalatte/texconv-custom-dll/blob/main/CMakeLists.txt Configures the TexconvDLL config.h file from a template if the BUILD_TOOLS option is enabled. This is used for building command-line tools. ```cmake if (BUILD_TOOLS) configure_file(${CMAKE_SOURCE_DIR}/TexconvDLL/config.h.in ${CMAKE_BINARY_DIR}/TexconvDLL/config.h @ONLY) endif() ``` -------------------------------- ### Configure Xbox One Extensions (XDK) Source: https://github.com/matyalatte/texconv-custom-dll/blob/main/CMakeLists.txt Builds Xbox extensions for Xbox One using the Xbox One XDK if the necessary XDK is found. It defines imported library targets and compiles definitions. ```cmake elseif(EXISTS "${XboxOneXDK_DIR}/PC/include/xdk.h") message(STATUS "Building Xbox extensions for XboxOne using the Xbox One XDK") add_library(Xbox::XDK SHARED IMPORTED) set_target_properties(Xbox::XDK PROPERTIES IMPORTED_LOCATION "${XboxOneXDK_DIR}/bin/xg.dll" IMPORTED_IMPLIB "${XboxOneXDK_DIR}/PC/lib/amd64/xg.lib" MAP_IMPORTED_CONFIG_MINSIZEREL "" MAP_IMPORTED_CONFIG_RELWITHDEBINFO "" INTERFACE_INCLUDE_DIRECTORIES "${XboxOneXDK_DIR}/PC/include") target_compile_definitions(${PROJECT_NAME} PRIVATE USE_XBOX_EXTS) target_link_libraries(${PROJECT_NAME} PUBLIC Xbox::XDK) else() message(FATAL_ERROR "Building Xbox extensions requires GameDKLatest or XboxOneXDKLatest") endif() endif() ``` -------------------------------- ### Configure MSVC Compiler Options Source: https://github.com/matyalatte/texconv-custom-dll/blob/main/CMakeLists.txt Applies specific compiler options for MSVC builds, including enabling all warnings (/Wall), disabling C++ exceptions (/GR-), and managing wchar_t behavior. It also includes options for code analysis and Spectre mitigation. ```cmake if(MSVC) foreach(t IN LISTS TOOL_EXES ITEMS ${PROJECT_NAME}) target_compile_options(${t} PRIVATE /Wall /GR-) endforeach() if(NO_WCHAR_T) message(STATUS "Using non-native wchar_t as unsigned short") foreach(t IN LISTS TOOL_EXES ITEMS ${PROJECT_NAME}) target_compile_options(${t} PRIVATE "/Zc:wchar_t-") endforeach() endif() if((CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.37) AND (NOT (${DIRECTX_ARCH} MATCHES "^arm")) AND ((${DIRECTX_ARCH} MATCHES "x64") OR (CMAKE_SIZEOF_VOID_P EQUAL 8))) # Enable since DirectXTex library has a lot of large switch statements target_compile_options(${PROJECT_NAME} PRIVATE /jumptablerdata) endif() if(ENABLE_CODE_ANALYSIS) foreach(t IN LISTS TOOL_EXES ITEMS ${PROJECT_NAME}) target_compile_options(${t} PRIVATE /analyze) endforeach() endif() if(ENABLE_SPECTRE_MITIGATION AND (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.13) AND (NOT ENABLE_OPENEXR_SUPPORT) AND (NOT WINDOWS_STORE)) message(STATUS "Building Spectre-mitigated libraries") foreach(t IN LISTS TOOL_EXES ITEMS ${PROJECT_NAME}) target_compile_options(${t} PRIVATE "/Qspectre") endforeach() endif() if((CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.26) AND BUILD_XBOX_EXTS_XBOXONE) foreach(t IN LISTS TOOL_EXES ITEMS ${PROJECT_NAME}) target_compile_options(${t} PRIVATE /wd5104 /wd5204) endforeach() endif() set(WarningsEXE "/wd4061" "/wd4062" "/wd4365" "/wd4514" "/wd4625" "/wd4626" "/wd4627" "/wd4668" "/wd4710" "/wd4711" "/wd4751" "/wd4820" "/wd5026" "/wd5027" "/wd5039" "/wd5045" "/wd5219") if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.34) list(APPEND WarningsEXE "/wd5262" "/wd5264") endif() foreach(t IN LISTS TOOL_EXES) target_compile_options(${t} PRIVATE ${WarningsEXE}) endforeach() if(BUILD_FUZZING AND (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.32) AND (NOT WINDOWS_STORE)) foreach(t IN LISTS TOOL_EXES ITEMS ${PROJECT_NAME}) target_compile_options(${t} PRIVATE ${ASAN_SWITCHES}) target_link_libraries(${t} PRIVATE ${ASAN_LIBS}) endforeach() endif() endif() ``` -------------------------------- ### Configure Xbox One Extensions (GDK) Source: https://github.com/matyalatte/texconv-custom-dll/blob/main/CMakeLists.txt Builds Xbox extensions for Xbox One using the Microsoft GDK if the necessary GameDK is found. It defines imported library targets and compiles definitions. ```cmake elseif(BUILD_XBOX_EXTS_XBOXONE AND WIN32) if(EXISTS "${GameDK_DIR}/GXDK/toolKit/include/gxdk.h") message(STATUS "Building Xbox extensions for XboxOne using the Microsoft GDK") add_library(Xbox::GDKX SHARED IMPORTED) set_target_properties(Xbox::GDKX PROPERTIES IMPORTED_LOCATION "${GameDK_DIR}/GXDK/bin/XboxOne/xg.dll" IMPORTED_IMPLIB "${GameDK_DIR}/GXDK/toolKit/lib/amd64/XboxOne/xg.lib" MAP_IMPORTED_CONFIG_MINSIZEREL "" MAP_IMPORTED_CONFIG_RELWITHDEBINFO "" INTERFACE_COMPILE_DEFINITIONS "_USE_GXDK" INTERFACE_INCLUDE_DIRECTORIES "${GameDK_DIR}/GXDK/toolKit/include;${GameDK_DIR}/GXDK/toolKit/include/XboxOne") target_compile_definitions(${PROJECT_NAME} PRIVATE USE_XBOX_EXTS) target_link_libraries(${PROJECT_NAME} PUBLIC Xbox::GDKX) ... ``` -------------------------------- ### CMake Build Options Configuration Source: https://github.com/matyalatte/texconv-custom-dll/blob/main/CMakeLists.txt Defines boolean options to control various build features of the DirectXTex library. These options, such as BUILD_TOOLS, BUILD_SAMPLE, BUILD_DX11, and others, can be enabled or disabled to customize the build. ```cmake option(BUILD_TOOLS "Build tex command-line tools" ON) option(BUILD_SAMPLE "Build DDSView sample (requires fxc.exe)" ON) # Includes the functions for Direct3D 11 resources and DirectCompute compression option(BUILD_DX11 "Build with DirectX11 Runtime support (requires fxc.exe)" ON) # Includes the functions for creating Direct3D 12 resources at runtime option(BUILD_DX12 "Build with DirectX12 Runtime support" ON) # Enable the use of OpenMP for software BC6H/BC7 compression option(BC_USE_OPENMP "Build with OpenMP support" ON) # Builds Xbox extensions for Host PC option(BUILD_XBOX_EXTS_XBOXONE "Build Xbox library extensions for Xbox One" OFF) option(BUILD_XBOX_EXTS_SCARLETT "Build Xbox library extensions for Xbox Series X|S" OFF) # https://devblogs.microsoft.com/cppblog/spectre-mitigations-in-msvc/ option(ENABLE_SPECTRE_MITIGATION "Build using /Qspectre for MSVC" OFF) option(DISABLE_MSVC_ITERATOR_DEBUGGING "Disable iterator debugging in Debug configurations with the MSVC CRT" OFF) option(ENABLE_CODE_ANALYSIS "Use Static Code Analysis on build" OFF) option(USE_PREBUILT_SHADERS "Use externally built HLSL shaders" OFF) option(NO_WCHAR_T "Use legacy wide-character as unsigned short" OFF) option(BUILD_FUZZING "Build for fuzz testing" OFF) # Includes the functions for loading/saving OpenEXR files at runtime option(ENABLE_OPENEXR_SUPPORT "Build with OpenEXR support" OFF) # See https://www.ijg.org/ option(ENABLE_LIBJPEG_SUPPORT "Build with libjpeg support" OFF) # See http://www.libpng.org/pub/png/libpng.html option(ENABLE_LIBPNG_SUPPORT "Build with libpng support" OFF) ``` -------------------------------- ### Xbox Console Target Configuration (CMake) Source: https://github.com/matyalatte/texconv-custom-dll/blob/main/CMakeLists.txt Configures library headers and sources for Xbox console targets. It conditionally adds files based on the type of Xbox target (durango) and DirectX version (BUILD_DX11, BUILD_DX12). ```cmake if(DEFINED XBOX_CONSOLE_TARGET) list(APPEND LIBRARY_HEADERS Auxiliary/DirectXTexXbox.h) list(APPEND LIBRARY_SOURCES Auxiliary/DirectXTexXboxDDS.cpp Auxiliary/DirectXTexXboxDetile.cpp Auxiliary/DirectXTexXboxImage.cpp Auxiliary/DirectXTexXboxTile.cpp) if((XBOX_CONSOLE_TARGET STREQUAL "durango") AND BUILD_DX11) list(APPEND LIBRARY_SOURCES Auxiliary/DirectXTexXboxD3D11X.cpp) endif() if(BUILD_DX12) list(APPEND LIBRARY_SOURCES Auxiliary/DirectXTexXboxD3D12X.cpp) endif() elseif((BUILD_XBOX_EXTS_XBOXONE OR BUILD_XBOX_EXTS_SCARLETT) AND WIN32) if(DEFINED ENV{GameDKLatest}) cmake_path(SET GameDK_DIR "$ENV{GameDKLatest}") endif() if(DEFINED ENV{XboxOneXDKLatest}) cmake_path(SET XboxOneXDK_DIR "$ENV{XboxOneXDKLatest}") endif() list(APPEND LIBRARY_HEADERS Auxiliary/DirectXTexXbox.h) list(APPEND LIBRARY_SOURCES Auxiliary/DirectXTexXboxDDS.cpp Auxiliary/DirectXTexXboxDetile.cpp Auxiliary/DirectXTexXboxImage.cpp Auxiliary/DirectXTexXboxTile.cpp) endif() ``` -------------------------------- ### Enable OpenEXR Support for Tools (CMake) Source: https://github.com/matyalatte/texconv-custom-dll/blob/main/CMakeLists.txt Conditionally enables OpenEXR support for all tools in TOOL_EXES. This involves adding include directories, linking against the OpenEXR library, and defining USE_OPENEXR. ```cmake if(BUILD_TOOLS) if(ENABLE_OPENEXR_SUPPORT) foreach(t IN LISTS TOOL_EXES) target_include_directories(${t} PRIVATE DirectXTex/Auxiliary) target_link_libraries(${t} PRIVATE ${OPENEXR_ILMIMF_LIBRARY}) target_compile_definitions(${t} PRIVATE USE_OPENEXR) endforeach() endif() # ... other library support blocks ... endif() ``` -------------------------------- ### Configure OpenMP Support Source: https://github.com/matyalatte/texconv-custom-dll/blob/main/CMakeLists.txt Finds and configures OpenMP support for the project. If OpenMP is found and enabled, it links the OpenMP library; otherwise, it disables OpenMP support. ```cmake if(BC_USE_OPENMP) find_package(OpenMP) if(OpenMP_CXX_FOUND) target_link_libraries(${PROJECT_NAME} PUBLIC OpenMP::OpenMP_CXX) else() set(BC_USE_OPENMP OFF) endif() endif() ``` -------------------------------- ### Link DirectXMath Source: https://github.com/matyalatte/texconv-custom-dll/blob/main/CMakeLists.txt Links the DirectXMath library to the project if it is found or if the build is not on Windows (implying use of external dependencies). ```cmake if(directxmath_FOUND OR (NOT WIN32)) message(STATUS "Using DirectXMath package") target_link_libraries(${PROJECT_NAME} PUBLIC Microsoft::DirectXMath) endif() ``` -------------------------------- ### Build Texconv-Custom-DLL Shared Library (Linux/macOS) Source: https://context7.com/matyalatte/texconv-custom-dll/llms.txt Builds the Texconv-Custom-DLL project as a shared library using CMake on Linux or macOS. This creates a library file (e.g., libtexconv.so) for programmatic use. Ensure the repository is cloned with submodules. ```bash # Clone repository with submodules git clone --recursive https://github.com/matyalatte/Texconv-Custom-DLL.git cd Texconv-Custom-DLL # Linux/macOS build mkdir build && cd build cmake .. cmake --build . --config Release # Output: build/bin/texconv (executable) or build/lib/libtexconv.so/.dylib ``` -------------------------------- ### DirectX 12 and D3D11 Support Configuration (CMake) Source: https://github.com/matyalatte/texconv-custom-dll/blob/main/CMakeLists.txt Conditionally adds source files for DirectX 12 and DirectX 11 support. It includes specific DirectX 12 files and D3D11 compression-related files, along with a common D3DX12 header if not targeting an Xbox console. ```cmake if(BUILD_DX11 AND WIN32) list(APPEND LIBRARY_SOURCES DirectXTex/DirectXTex/BCDirectCompute.h DirectXTex/DirectXTex/BCDirectCompute.cpp DirectXTex/DirectXTex/DirectXTexCompressGPU.cpp DirectXTex/DirectXTex/DirectXTexD3D11.cpp) endif() if(BUILD_DX12) list(APPEND LIBRARY_SOURCES DirectXTex/DirectXTex/DirectXTexD3D12.cpp) if(NOT (DEFINED XBOX_CONSOLE_TARGET)) list(APPEND LIBRARY_SOURCES DirectXTex/Common/d3dx12.h) endif() endif() ``` -------------------------------- ### Enable Xbox Extensions for texconv (CMake) Source: https://github.com/matyalatte/texconv-custom-dll/blob/main/CMakeLists.txt Enables Xbox specific extensions for the texconv tool if BUILD_XBOX_EXTS_SCARLETT or BUILD_XBOX_EXTS_XBOXONE is set. This adds include directories, defines USE_XBOX_EXTS, and links against Xbox GDK/XDK libraries if available. ```cmake if(BUILD_TOOLS) # ... other library support blocks ... if(BUILD_XBOX_EXTS_SCARLETT OR BUILD_XBOX_EXTS_XBOXONE) target_include_directories(texconv PRIVATE DirectXTex/Auxiliary) target_compile_definitions(texconv PRIVATE USE_XBOX_EXTS) target_link_libraries(texconv PUBLIC $ $) if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.21") add_custom_command(TARGET texconv POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy $ $ COMMAND_EXPAND_LISTS ) endif() endif() endif() ``` -------------------------------- ### Configure DirectX Headers Library in CMake Source: https://github.com/matyalatte/texconv-custom-dll/blob/main/unix_external/CMakeLists.txt This snippet demonstrates how to define an INTERFACE library for DirectX Headers using CMake. It sets the necessary include directories, including specific paths for WSL stubs, and creates an alias for easier referencing in other targets. ```cmake cmake_minimum_required (VERSION 3.14) # DirectX-Headers add_library(DirectX-Headers INTERFACE) target_include_directories(DirectX-Headers INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/DirectX-Headers/include) target_include_directories(DirectX-Headers INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/DirectX-Headers/include/wsl/stubs) add_library(Microsoft::DirectX-Headers ALIAS DirectX-Headers) ``` -------------------------------- ### Apply Common Compiler Definitions and Options Source: https://github.com/matyalatte/texconv-custom-dll/blob/main/CMakeLists.txt Applies common compiler definitions, switches, and linker options to targets defined in TOOL_EXES and the main project. This ensures consistent build settings across different tools and the main executable. ```cmake foreach(t IN LISTS TOOL_EXES ITEMS ${PROJECT_NAME}) target_compile_definitions(${t} PRIVATE ${COMPILER_DEFINES}) target_compile_options(${t} PRIVATE ${COMPILER_SWITCHES}) target_link_options(${t} PRIVATE ${LINKER_SWITCHES}) endforeach() ``` -------------------------------- ### Configure Test Suite Source: https://github.com/matyalatte/texconv-custom-dll/blob/main/CMakeLists.txt Includes the CMake test suite (`CTest`) for Windows platforms, excluding Windows Store and Xbox console targets. It conditionally enables testing or fuzzing based on build flags and directory existence. ```cmake if(WIN32 AND (NOT WINDOWS_STORE) AND (NOT (DEFINED XBOX_CONSOLE_TARGET))) include(CTest) if(BUILD_TESTING AND (EXISTS "${CMAKE_CURRENT_LIST_DIR}/Tests/CMakeLists.txt")) enable_testing() add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/Tests) elseif(BUILD_FUZZING AND (EXISTS "${CMAKE_CURRENT_LIST_DIR}/Tests/fuzzloaders/CMakeLists.txt")) message(STATUS "Building for fuzzing") add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/Tests/fuzzloaders) endif() endif() ``` -------------------------------- ### CMake Platform-Specific Build Configuration Source: https://github.com/matyalatte/texconv-custom-dll/blob/main/CMakeLists.txt Adjusts build options based on specific platform targets like WINDOWS_STORE or XBOX_CONSOLE_TARGET. This ensures appropriate features are enabled or disabled for different environments. ```cmake if(WINDOWS_STORE OR (DEFINED XBOX_CONSOLE_TARGET)) set(CMAKE_TRY_COMPILE_TARGET_TYPE "STATIC_LIBRARY") endif() if(WINDOWS_STORE OR (DEFINED XBOX_CONSOLE_TARGET))) set(BUILD_DX12 ON) set(BUILD_TOOLS OFF) set(BUILD_SAMPLE OFF) endif() if((DEFINED XBOX_CONSOLE_TARGET) AND (NOT (XBOX_CONSOLE_TARGET STREQUAL "durango"))) set(BUILD_DX11 OFF) endif() ``` -------------------------------- ### Build texconv Executable or Library (CMake) Source: https://github.com/matyalatte/texconv-custom-dll/blob/main/CMakeLists.txt Configures the texconv tool, either as an executable or a shared library, based on the TEXCONV_BUILD_AS_EXE flag. It includes various source files and links against platform-specific libraries and potentially external image format libraries. ```cmake if(BUILD_TOOLS) set(TEXCONV_FILES ${CMAKE_BINARY_DIR}/TexconvDLL/config.h ${CMAKE_SOURCE_DIR}/TexconvDLL/config.h.in TexconvDLL/tool_util.h TexconvDLL/texconv.cpp) if (TEXCONV_USE_TEXASSEMBLE) if (NOT TEXCONV_BUILD_AS_EXE) set(TEXCONV_FILES ${TEXCONV_FILES} TexconvDLL/texassemble.cpp) if (TEXCONV_USE_WIC AND WIN32) set(TEXCONV_FILES ${TEXCONV_FILES} DirectXTex/Texassemble/AnimatedGif.cpp) endif() endif() endif() if (TEXCONV_USE_WIC AND WIN32) set(TEXCONV_FILES ${TEXCONV_FILES} DirectXTex/Texconv/ExtendedBMP.cpp DirectXTex/Texconv/PortablePixMap.cpp) endif() if (TEXCONV_BUILD_AS_EXE) if (WIN32) if (TEXCONV_ICON_FOR_EXE) set(TEXCONV_FILES ${TEXCONV_FILES} TexconvDLL/texconv.rc) endif() set(TEXCONV_FILES ${TEXCONV_FILES} DirectXTex/Common/settings.manifest) endif() add_executable(texconv ${TEXCONV_FILES}) else() add_library(texconv SHARED ${TEXCONV_FILES}) endif() target_compile_features(texconv PRIVATE cxx_std_17) if (WIN32) target_link_libraries(texconv PRIVATE ${PROJECT_NAME} ole32.lib shell32.lib version.lib) else() # unix need a library for safe functions target_link_libraries(texconv PRIVATE ${PROJECT_NAME} safestring_static) endif() source_group(texconv FILES ${TEXCONV_FILES}) list(APPEND TOOL_EXES texconv) endif() ``` -------------------------------- ### macOS Deployment Target Configuration (CMake) Source: https://github.com/matyalatte/texconv-custom-dll/blob/main/CMakeLists.txt Sets the macOS deployment target for the project. This ensures compatibility with specified macOS versions. It uses a conditional statement to apply only when the APPLE variable is defined. ```cmake if(APPLE) set(CMAKE_OSX_DEPLOYMENT_TARGET "10.15" CACHE STRING "" FORCE) endif() ``` -------------------------------- ### Define Texassemble Files Source: https://github.com/matyalatte/texconv-custom-dll/blob/main/CMakeLists.txt Defines the source files for the texassemble command-line tool if BUILD_TOOLS, TEXCONV_USE_TEXASSEMBLE, and TEXCONV_BUILD_AS_EXE are enabled. Includes necessary headers and source files. ```cmake if (BUILD_TOOLS AND TEXCONV_USE_TEXASSEMBLE AND TEXCONV_BUILD_AS_EXE) set(TEXASSEMBLE_FILES ${CMAKE_BINARY_DIR}/TexconvDLL/config.h ${CMAKE_SOURCE_DIR}/TexconvDLL/config.h.in TexconvDLL/tool_util.h TexconvDLL/texassemble.cpp) if (WIN32) if (TEXCONV_USE_WIC) ``` -------------------------------- ### Generate HLSL Shaders with Custom Command Source: https://github.com/matyalatte/texconv-custom-dll/blob/main/CMakeLists.txt This snippet defines a custom CMake command to generate HLSL shaders for DDSView. It depends on hlsl.cmd and ddsview.fx, and its output is written to a specified directory. This is conditionally executed if USE_PREBUILT_SHADERS is not set. ```cmake if(NOT USE_PREBUILT_SHADERS) add_custom_command( OUTPUT "${COMPILED_DDSVIEW_SHADERS}/ddsview_ps1D.inc" MAIN_DEPENDENCY "${PROJECT_SOURCE_DIR}/DDSView/hlsl.cmd" DEPENDS "${PROJECT_SOURCE_DIR}/DDSView/ddsview.fx" COMMENT "Generating HLSL shaders for DDSView..." COMMAND COMMAND ${CMAKE_COMMAND} -E env CompileShadersOutput="${COMPILED_DDSVIEW_SHADERS}" hlsl.cmd > "${COMPILED_DDSVIEW_SHADERS}/hlsl.log" WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}/DDSView" USES_TERMINAL) endif() ``` -------------------------------- ### Configure MINGW Linker Options Source: https://github.com/matyalatte/texconv-custom-dll/blob/main/CMakeLists.txt Applies the -municode linker option for MINGW builds. This option is typically used to enable Unicode support in the Windows environment when using the MinGW toolchain. ```cmake if(MINGW) foreach(t IN LISTS TOOL_EXES) target_link_options(${t} PRIVATE -municode) endforeach() endif() ``` -------------------------------- ### Configure GNU Compiler Options Source: https://github.com/matyalatte/texconv-custom-dll/blob/main/CMakeLists.txt Applies specific warning suppression options for GNU compiler builds, ignoring certain attributes and setting a limit for allocatable buffer sizes to prevent potential issues. ```cmake elseif(CMAKE_CXX_COMPILER_ID MATCHES "GNU") foreach(t IN LISTS TOOL_EXES ITEMS ${PROJECT_NAME}) target_compile_options(${t} PRIVATE "-Wno-ignored-attributes" "-Walloc-size-larger-than=4GB") endforeach() ``` -------------------------------- ### Shader Sources Definition (CMake) Source: https://github.com/matyalatte/texconv-custom-dll/blob/main/CMakeLists.txt Defines the list of shader source files. These are High-Level Shading Language (HLSL) files used for specific compression algorithms like BC6H and BC7. ```cmake set(SHADER_SOURCES DirectXTex/DirectXTex/Shaders/BC6HEncode.hlsl DirectXTex/DirectXTex/Shaders/BC7Encode.hlsl) ```