@@ -143,7 +143,6 @@ elseif((BUILD_XBOX_EXTS_XBOXONE OR BUILD_XBOX_EXTS_SCARLETT) AND WIN32)
143
143
Auxiliary/DirectXTexXboxTile.cpp)
144
144
endif ()
145
145
146
-
147
146
if (BUILD_DX11 AND WIN32 AND (NOT (XBOX_CONSOLE_TARGET STREQUAL "durango" )))
148
147
set (SHADER_SOURCES
149
148
DirectXTex/Shaders/BC6HEncode.hlsl
@@ -160,7 +159,7 @@ if(BUILD_DX12)
160
159
list (APPEND LIBRARY_SOURCES DirectXTex/DirectXTexD3D12.cpp)
161
160
162
161
if (NOT (DEFINED XBOX_CONSOLE_TARGET))
163
- list (APPEND LIBRARY_SOURCES DirectXTex /d3dx12.h)
162
+ list (APPEND LIBRARY_SOURCES Common /d3dx12.h)
164
163
endif ()
165
164
endif ()
166
165
@@ -404,7 +403,8 @@ if(BUILD_TOOLS AND WIN32)
404
403
add_executable (texassemble
405
404
Texassemble/texassemble.cpp
406
405
Texassemble/texassemble.rc
407
- Texassemble/settings.manifest
406
+ Common/CmdLineHelpers.h
407
+ Common/settings.manifest
408
408
Texassemble/AnimatedGif.cpp)
409
409
target_compile_features (texassemble PRIVATE cxx_std_17)
410
410
target_link_libraries (texassemble PRIVATE ${PROJECT_NAME} ole32.lib version .lib)
@@ -416,7 +416,8 @@ if(BUILD_TOOLS AND BUILD_DX11 AND WIN32)
416
416
add_executable (texconv
417
417
Texconv/texconv.cpp
418
418
Texconv/texconv.rc
419
- Texconv/settings.manifest
419
+ Common/CmdLineHelpers.h
420
+ Common/settings.manifest
420
421
Texconv/ExtendedBMP.cpp
421
422
Texconv/PortablePixMap.cpp)
422
423
target_compile_features (texconv PRIVATE cxx_std_17)
@@ -429,13 +430,18 @@ if(BUILD_TOOLS AND WIN32)
429
430
add_executable (texdiag
430
431
Texdiag/texdiag.cpp
431
432
Texdiag/texdiag.rc
432
- Texdiag/settings.manifest)
433
+ Common/CmdLineHelpers.h
434
+ Common/settings.manifest)
433
435
target_compile_features (texdiag PRIVATE cxx_std_17)
434
436
target_link_libraries (texdiag PRIVATE ${PROJECT_NAME} ole32.lib version .lib)
435
437
source_group (texdiag REGULAR_EXPRESSION Texdiag/*.*)
436
438
list (APPEND TOOL_EXES texdiag)
437
439
endif ()
438
440
441
+ foreach (t IN LISTS TOOL_EXES ITEMS ${PROJECT_NAME} )
442
+ target_include_directories (${t} PRIVATE Common)
443
+ endforeach ()
444
+
439
445
if (BUILD_TOOLS AND WIN32 )
440
446
if (ENABLE_OPENEXR_SUPPORT)
441
447
foreach (t IN LISTS TOOL_EXES)
@@ -477,32 +483,22 @@ endif()
477
483
if (BUILD_SAMPLE AND BUILD_DX11 AND WIN32 )
478
484
list (APPEND TOOL_EXES ddsview)
479
485
480
- if (NOT COMPILED_DDSVIEW_SHADERS)
481
- if (USE_PREBUILT_SHADERS)
482
- message (FATAL_ERROR "ERROR: Using prebuilt shaders requires the COMPILED_DDSVIEW_SHADERS variable is set" )
483
- endif ()
484
- set (COMPILED_DDSVIEW_SHADERS ${CMAKE_CURRENT_BINARY_DIR} /Shaders/Compiled)
485
- file (MAKE_DIRECTORY ${COMPILED_DDSVIEW_SHADERS} )
486
- else ()
487
- file (TO_CMAKE_PATH ${COMPILED_DDSVIEW_SHADERS} COMPILED_DDSVIEW_SHADERS)
488
- endif ()
489
-
490
486
add_executable (ddsview WIN32
491
487
DDSView/ddsview.cpp
492
488
DDSView/ddsview.rc
493
- ${COMPILED_DDSVIEW_SHADERS } /ddsview_ps1D.inc)
489
+ ${COMPILED_SHADERS } /ddsview_ps1D.inc)
494
490
target_link_libraries (ddsview PRIVATE ${PROJECT_NAME} d3d11.lib ole32.lib)
495
491
source_group (ddsview REGULAR_EXPRESSION DDSView/*.*)
496
492
497
- target_include_directories (ddsview PRIVATE ${COMPILED_DDSVIEW_SHADERS } )
493
+ target_include_directories (ddsview PRIVATE ${COMPILED_SHADERS } )
498
494
499
495
if (NOT USE_PREBUILT_SHADERS)
500
496
add_custom_command (
501
- OUTPUT "${COMPILED_DDSVIEW_SHADERS } /ddsview_ps1D.inc"
497
+ OUTPUT "${COMPILED_SHADERS } /ddsview_ps1D.inc"
502
498
MAIN_DEPENDENCY "${PROJECT_SOURCE_DIR} /DDSView/hlsl.cmd"
503
- DEPENDS "${PROJECT_SOURCE_DIR} / DDSView/ddsview.fx "
499
+ DEPENDS "DDSView/ddsview.hlsl "
504
500
COMMENT "Generating HLSL shaders for DDSView..."
505
- COMMAND COMMAND ${CMAKE_COMMAND} -E env CompileShadersOutput="${COMPILED_DDSVIEW_SHADERS } " hlsl.cmd > "${COMPILED_DDSVIEW_SHADERS} /hlsl .log"
501
+ COMMAND ${CMAKE_COMMAND} -E env CompileShadersOutput="${COMPILED_SHADERS } " $<$< BOOL : ${DIRECTX_FXC_TOOL} >:LegacyShaderCompiler= ${DIRECTX_FXC_TOOL} > hlsl.cmd > "${COMPILED_SHADERS} /hlsl_ddsview .log"
506
502
WORKING_DIRECTORY "${PROJECT_SOURCE_DIR} /DDSView"
507
503
USES_TERMINAL )
508
504
endif ()
@@ -514,6 +510,10 @@ if(directxmath_FOUND)
514
510
endforeach ()
515
511
endif ()
516
512
513
+ if (TOOL_EXES)
514
+ message (STATUS "Building tools: ${TOOL_EXES} " )
515
+ endif ()
516
+
517
517
if (MSVC )
518
518
foreach (t IN LISTS TOOL_EXES ITEMS ${PROJECT_NAME} )
519
519
target_compile_options (${t} PRIVATE /Wall /GR-)
@@ -574,6 +574,7 @@ elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
574
574
endif ()
575
575
576
576
if (ENABLE_CODE_ANALYSIS)
577
+ message (STATUS "Building with Code Analysis (PREFIX)" )
577
578
foreach (t IN LISTS TOOL_EXES ITEMS ${PROJECT_NAME} )
578
579
target_compile_options (${t} PRIVATE /analyze /WX)
579
580
endforeach ()
0 commit comments