Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ mark_as_advanced(DXC_DISABLE_ALLOCATOR_OVERRIDES)
option(DXC_CODEGEN_EXCEPTIONS_TRAP "An exception in code generation generates a trap, ending the compiler process" OFF)
mark_as_advanced(DXC_CODEGEN_EXCEPTIONS_TRAP)

option(DXC_OPTIMIZE_FOR_SIZE "Favor smaller Windows Release binaries over compiler throughput" OFF)

# adjust link option to enable debugging from kernel mode; not compatible with incremental linking
if(NOT CMAKE_VERSION VERSION_LESS "3.13" AND MSVC AND NOT CMAKE_C_COMPILER_ARCHITECTURE_ID STREQUAL "ARM64EC")
add_link_options(/DEBUGTYPE:CV,FIXUP,PDATA /INCREMENTAL:NO)
Expand Down
4 changes: 4 additions & 0 deletions cmake/modules/HandleLLVMOptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,10 @@ if( MSVC )
append("/DEBUG /OPT:REF" CMAKE_EXE_LINKER_FLAGS_RELEASE)
endif()

if (DXC_OPTIMIZE_FOR_SIZE)
append("/Os" CMAKE_C_FLAGS_RELEASE CMAKE_CXX_FLAGS_RELEASE)
endif()

# HLSL Changes End

# Enable warnings
Expand Down
Loading