Skip to content

Commit dafb841

Browse files
authored
Upgrade to CMake 3.21 (#631)
1 parent f32f30d commit dafb841

6 files changed

Lines changed: 14 additions & 19 deletions

File tree

‎CMakeLists.txt‎

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Copyright (c) Microsoft Corporation.
22
# Licensed under the MIT License.
33

4-
cmake_minimum_required (VERSION 3.20)
4+
cmake_minimum_required (VERSION 3.21)
55

66
set(DIRECTXTEX_VERSION 2.0.8)
77

@@ -509,13 +509,11 @@ if(BUILD_TOOLS AND WIN32)
509509
target_compile_definitions(texconv PRIVATE USE_XBOX_EXTS)
510510
target_link_libraries(texconv PUBLIC $<TARGET_NAME_IF_EXISTS:Xbox::GDKX> $<TARGET_NAME_IF_EXISTS:Xbox::XDK>)
511511

512-
if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.21")
513-
add_custom_command(TARGET texconv POST_BUILD
514-
COMMAND ${CMAKE_COMMAND} -E copy
515-
$<TARGET_RUNTIME_DLLS:texconv> $<TARGET_FILE_DIR:texconv>
516-
COMMAND_EXPAND_LISTS
517-
)
518-
endif()
512+
add_custom_command(TARGET texconv POST_BUILD
513+
COMMAND ${CMAKE_COMMAND} -E copy
514+
$<TARGET_RUNTIME_DLLS:texconv> $<TARGET_FILE_DIR:texconv>
515+
COMMAND_EXPAND_LISTS
516+
)
519517
endif()
520518
endif()
521519

‎CMakePresets.json‎

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": 2,
2+
"version": 3,
33
"configurePresets": [
44
{
55
"name": "base",
@@ -8,7 +8,7 @@
88
"generator": "Ninja",
99
"hidden": true,
1010
"binaryDir": "${sourceDir}/out/build/${presetName}",
11-
"cacheVariables": { "CMAKE_INSTALL_PREFIX": "${sourceDir}/out/install/${presetName}" }
11+
"installDir": "${sourceDir}/out/install/${presetName}"
1212
},
1313

1414
{
@@ -183,12 +183,7 @@
183183
},
184184
{
185185
"name": "VCPKG",
186-
"cacheVariables": {
187-
"CMAKE_TOOLCHAIN_FILE": {
188-
"value": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake",
189-
"type": "FILEPATH"
190-
}
191-
},
186+
"toolchainFile": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake",
192187
"hidden": true
193188
},
194189
{

‎DirectXTex/DirectXTexDDS.cpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ namespace
325325
_Inout_ uint32_t& convFlags) noexcept
326326
{
327327
if (!pSource)
328-
return E_INVALIDARG;
328+
return E_POINTER;
329329

330330
metadata = {};
331331
if (ddPixelFormat)

‎DirectXTex/DirectXTexUtil.cpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ static_assert(WIN10_DXGI_FORMAT_V208 == DXGI_FORMAT_V208, "Windows SDK mismatch
2727
static_assert(WIN10_DXGI_FORMAT_V408 == DXGI_FORMAT_V408, "Windows SDK mismatch detected");
2828
#endif
2929

30-
#if defined(NTDDI_WIN11_GE) && !defined(_GAMING_XBOX)
30+
#if defined(NTDDI_WIN11_GE) && !defined(_GAMING_XBOX) && !defined(__MINGW32__)
3131
static_assert(WIN11_DXGI_FORMAT_A4B4G4R4_UNORM == DXGI_FORMAT_A4B4G4R4_UNORM, "Windows SDK mismatch detected");
3232
#endif
3333

‎README.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@ FOR SECURITY ADVISORIES, see [GitHub](https://github.com/microsoft/DirectXTex/se
8383

8484
For a full change history, see [CHANGELOG.md](https://github.com/microsoft/DirectXTex/blob/main/CHANGELOG.md).
8585

86+
* The CMake projects require 3.21 or later. VS 2019 users will need to install a standalone version of CMake 3.21 or later and add it to their PATH.
87+
8688
* Starting with the March 2025 release, Windows 7 and Windows 8.0 support has been retired.
8789

8890
* Starting with the July 2022 release, the ``bool forceSRGB`` parameter for the **CreateTextureEx** and **CreateShaderResourceViewEx** functions is now a ``CREATETEX_FLAGS`` typed enum bitmask flag parameter. This may have a _breaking change_ impact to client code. Replace ``true`` with ``CREATETEX_FORCE_SRGB`` and ``false`` with ``CREATETEX_DEFAULT``.

‎Texconv/texconv.cpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3856,7 +3856,7 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[])
38563856
{
38573857
options.pstrName = const_cast<wchar_t*>(L"HeifCompressionMethod");
38583858
varValues.vt = VT_UI1;
3859-
#if defined(NTDDI_WIN10_CU)
3859+
#if defined(NTDDI_WIN10_CU) && !defined(__MINGW32__)
38603860
varValues.bVal = WICHeifCompressionNone;
38613861
#else
38623862
varValues.bVal = 0x1 /* WICHeifCompressionNone */;

0 commit comments

Comments
 (0)