Skip to content

Commit 8b871f6

Browse files
author
Stephen Gutekanst
committed
revert CMake changes
Signed-off-by: Stephen Gutekanst <[email protected]>
1 parent 84da60c commit 8b871f6

File tree

15 files changed

+111
-257
lines changed

15 files changed

+111
-257
lines changed

CMakeLists.txt

Lines changed: 18 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -107,27 +107,21 @@ endif()
107107
option(DXC_DISABLE_ALLOCATOR_OVERRIDES "Disable usage of allocator overrides" OFF)
108108
mark_as_advanced(DXC_DISABLE_ALLOCATOR_OVERRIDES)
109109

110-
#------------------
111-
# Mach change start
112-
#------------------
113-
# # adjust link option to enable debugging from kernel mode; not compatible with incremental linking
114-
# if(NOT CMAKE_VERSION VERSION_LESS "3.13" AND WIN32 AND NOT CMAKE_C_COMPILER_ARCHITECTURE_ID STREQUAL "ARM64EC")
115-
# add_link_options(/DEBUGTYPE:CV,FIXUP,PDATA /INCREMENTAL:NO)
116-
# endif()
117-
118-
# # enable control flow guard
119-
# if(WIN32)
120-
# add_compile_options(/guard:cf)
121-
# add_link_options(/guard:cf)
122-
# endif(WIN32)
123-
124-
# # Enable CET Shadow Stack
125-
# if(WIN32 AND NOT (CMAKE_C_COMPILER_ARCHITECTURE_ID MATCHES "ARM.*"))
126-
# add_link_options(/CETCOMPAT)
127-
# endif()
128-
#------------------
129-
# Mach change end
130-
#------------------
110+
# adjust link option to enable debugging from kernel mode; not compatible with incremental linking
111+
if(NOT CMAKE_VERSION VERSION_LESS "3.13" AND WIN32 AND NOT CMAKE_C_COMPILER_ARCHITECTURE_ID STREQUAL "ARM64EC")
112+
add_link_options(/DEBUGTYPE:CV,FIXUP,PDATA /INCREMENTAL:NO)
113+
endif()
114+
115+
# enable control flow guard
116+
if(WIN32)
117+
add_compile_options(/guard:cf)
118+
add_link_options(/guard:cf)
119+
endif(WIN32)
120+
121+
# Enable CET Shadow Stack
122+
if(WIN32 AND NOT (CMAKE_C_COMPILER_ARCHITECTURE_ID MATCHES "ARM.*"))
123+
add_link_options(/CETCOMPAT)
124+
endif()
131125

132126
# HLSL Change Ends
133127

@@ -810,16 +804,9 @@ endif()
810804

811805
include(CoverageReport)
812806

813-
#------------------
814-
# Mach change start
815-
#------------------
816-
# # HLSL Change begin - Set default distribution value.
817-
# set(LLVM_DISTRIBUTION_COMPONENTS "dxc;dxcompiler;dxc-headers" CACHE STRING "")
818-
# # HLSL Change end - Set default distribution value.
819-
set(LLVM_DISTRIBUTION_COMPONENTS "dxcompiler;dxc-headers" CACHE STRING "")
820-
#------------------
821-
# Mach change end
822-
#------------------
807+
# HLSL Change begin - Set default distribution value.
808+
set(LLVM_DISTRIBUTION_COMPONENTS "dxc;dxcompiler;dxc-headers" CACHE STRING "")
809+
# HLSL Change end - Set default distribution value.
823810

824811
# This must be at the end of the LLVM root CMakeLists file because it must run
825812
# after all targets are created.

cmake/modules/AddLLVM.cmake

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,7 @@ function(llvm_update_compile_flags name)
1616
endif()
1717
else()
1818
if(LLVM_COMPILER_IS_GCC_COMPATIBLE)
19-
#------------------
20-
# Mach change start
21-
#------------------
22-
# list(APPEND LLVM_COMPILE_FLAGS "-fno-exceptions")
23-
#------------------
24-
# Mach change end
25-
#------------------
19+
list(APPEND LLVM_COMPILE_FLAGS "-fno-exceptions")
2620
elseif(MSVC)
2721
list(APPEND LLVM_COMPILE_DEFINITIONS _HAS_EXCEPTIONS=0)
2822
list(APPEND LLVM_COMPILE_FLAGS "/EHs-c-")

external/CMakeLists.txt

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -81,13 +81,7 @@ if (${ENABLE_SPIRV_CODEGEN})
8181
# Avoid exception handling warning from MSVC.
8282
# This add_compile_options() will only affect the current directory and its subdirectories.
8383
if (WIN32)
84-
#------------------
85-
# Mach change start
86-
#------------------
87-
# add_compile_options(/EHs)
88-
#------------------
89-
# Mach change end
90-
#------------------
84+
add_compile_options(/EHs)
9185
else(WIN32)
9286
# Disable all warnings in subproject RE2
9387
add_compile_options(-w)

include/dxc/Tracing/CMakeLists.txt

Lines changed: 13 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -4,53 +4,29 @@
44

55
# Create the header in a temporary file and only update when necessary,
66
# to avoid invalidating targets that depend on it.
7-
#------------------
8-
# Mach change start
9-
#------------------
10-
# add_custom_command(
11-
# OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/tmpdxcetw.h
12-
# COMMAND mc -r ${CMAKE_CURRENT_BINARY_DIR} -h ${CMAKE_CURRENT_BINARY_DIR} -p DxcEtw_ -um -z tmpdxcetw ${CMAKE_CURRENT_SOURCE_DIR}/dxcetw.man
13-
# DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/dxcetw.man
14-
# COMMENT "Building instrumentation manifest ..."
15-
# )
167
add_custom_command(
178
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/tmpdxcetw.h
18-
COMMAND touch ${CMAKE_CURRENT_BINARY_DIR}/tmpdxcetw.h
9+
COMMAND mc -r ${CMAKE_CURRENT_BINARY_DIR} -h ${CMAKE_CURRENT_BINARY_DIR} -p DxcEtw_ -um -z tmpdxcetw ${CMAKE_CURRENT_SOURCE_DIR}/dxcetw.man
1910
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/dxcetw.man
2011
COMMENT "Building instrumentation manifest ..."
2112
)
22-
#------------------
23-
# Mach change end
24-
#------------------
25-
#------------------
26-
# Mach change start
27-
#------------------
28-
# add_custom_command(
29-
# OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/dxcetw.h
30-
# COMMAND ${CMAKE_COMMAND} -E copy_if_different
31-
# ${CMAKE_CURRENT_BINARY_DIR}/tmpdxcetw.h
32-
# ${CMAKE_CURRENT_BINARY_DIR}/dxcetw.h
33-
# COMMAND ${CMAKE_COMMAND} -E copy_if_different
34-
# ${CMAKE_CURRENT_BINARY_DIR}/tmpdxcetw.rc
35-
# ${CMAKE_CURRENT_BINARY_DIR}/dxcetw.rc
36-
# COMMAND ${CMAKE_COMMAND} -E copy_if_different
37-
# ${CMAKE_CURRENT_BINARY_DIR}/tmpdxcetwTEMP.bin
38-
# ${CMAKE_CURRENT_BINARY_DIR}/dxcetwTEMP.bin
39-
# COMMAND ${CMAKE_COMMAND} -E copy_if_different
40-
# ${CMAKE_CURRENT_BINARY_DIR}/tmpdxcetw_MSG00001.bin
41-
# ${CMAKE_CURRENT_BINARY_DIR}/MSG00001.bin
42-
# DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/tmpdxcetw.h
43-
# COMMENT "Updating instrumentation manifest ..."
44-
# )
4513
add_custom_command(
4614
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/dxcetw.h
47-
COMMAND touch ${CMAKE_CURRENT_BINARY_DIR}/dxcetw.h
15+
COMMAND ${CMAKE_COMMAND} -E copy_if_different
16+
${CMAKE_CURRENT_BINARY_DIR}/tmpdxcetw.h
17+
${CMAKE_CURRENT_BINARY_DIR}/dxcetw.h
18+
COMMAND ${CMAKE_COMMAND} -E copy_if_different
19+
${CMAKE_CURRENT_BINARY_DIR}/tmpdxcetw.rc
20+
${CMAKE_CURRENT_BINARY_DIR}/dxcetw.rc
21+
COMMAND ${CMAKE_COMMAND} -E copy_if_different
22+
${CMAKE_CURRENT_BINARY_DIR}/tmpdxcetwTEMP.bin
23+
${CMAKE_CURRENT_BINARY_DIR}/dxcetwTEMP.bin
24+
COMMAND ${CMAKE_COMMAND} -E copy_if_different
25+
${CMAKE_CURRENT_BINARY_DIR}/tmpdxcetw_MSG00001.bin
26+
${CMAKE_CURRENT_BINARY_DIR}/MSG00001.bin
4827
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/tmpdxcetw.h
4928
COMMENT "Updating instrumentation manifest ..."
5029
)
51-
#------------------
52-
# Mach change end
53-
#------------------
5430

5531
set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/dxcetw.h PROPERTIES GENERATED 1)
5632
set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/dxcetw.rc PROPERTIES GENERATED 1)

lib/CMakeLists.txt

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,7 @@ add_subdirectory(DXIL) # HLSL Change
2727
add_subdirectory(DxilContainer) # HLSL Change
2828
add_subdirectory(DxilPdbInfo) # HLSL Change
2929
add_subdirectory(DxilPIXPasses) # HLSL Change
30-
#------------------
31-
# Mach change start
32-
#------------------
33-
# add_subdirectory(DxilDia) # HLSL Change
34-
#------------------
35-
# Mach change end
36-
#------------------
30+
add_subdirectory(DxilDia) # HLSL Change
3731
add_subdirectory(DxilRootSignature) # HLSL Change
3832
add_subdirectory(DxcBindingTable) # HLSL Change
3933
add_subdirectory(DxrFallback) # HLSL Change

lib/Support/CMakeLists.txt

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -145,14 +145,8 @@ add_llvm_library(LLVMSupport
145145
)
146146

147147
set_property(TARGET LLVMSupport PROPERTY LLVM_SYSTEM_LIBS "${system_libs}")
148-
#------------------
149-
# Mach change start
150-
#------------------
151-
# if(WIN32)
152-
# set_property(TARGET LLVMSupport PROPERTY COMPILE_FLAGS /EHsc )
153-
# endif(WIN32)
154-
#------------------
155-
# Mach change end
156-
#------------------
148+
if(WIN32)
149+
set_property(TARGET LLVMSupport PROPERTY COMPILE_FLAGS /EHsc )
150+
endif(WIN32)
157151

158152
target_link_libraries(LLVMSupport PUBLIC LLVMMSSupport) # HLSL Change

projects/include/Tracing/CMakeLists.txt

Lines changed: 13 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -4,53 +4,29 @@
44

55
# Create the header in a temporary file and only update when necessary,
66
# to avoid invalidating targets that depend on it.
7-
#------------------
8-
# Mach change start
9-
#------------------
10-
# add_custom_command(
11-
# OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/tmpdxcruntimeetw.h
12-
# COMMAND mc -r ${CMAKE_CURRENT_BINARY_DIR} -h ${CMAKE_CURRENT_BINARY_DIR} -p DxcRuntimeEtw_ -um -z tmpdxcruntimeetw ${CMAKE_CURRENT_SOURCE_DIR}/DxcRuntime.man
13-
# DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/DxcRuntime.man
14-
# COMMENT "Building instrumentation manifest ..."
15-
# )
167
add_custom_command(
178
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/tmpdxcruntimeetw.h
18-
COMMAND touch ${CMAKE_CURRENT_BINARY_DIR}/tmpdxcruntimeetw.h
9+
COMMAND mc -r ${CMAKE_CURRENT_BINARY_DIR} -h ${CMAKE_CURRENT_BINARY_DIR} -p DxcRuntimeEtw_ -um -z tmpdxcruntimeetw ${CMAKE_CURRENT_SOURCE_DIR}/DxcRuntime.man
1910
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/DxcRuntime.man
2011
COMMENT "Building instrumentation manifest ..."
2112
)
22-
#------------------
23-
# Mach change end
24-
#------------------
25-
#------------------
26-
# Mach change start
27-
#------------------
28-
# add_custom_command(
29-
# OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/DxcRuntimeEtw.h
30-
# COMMAND ${CMAKE_COMMAND} -E copy_if_different
31-
# ${CMAKE_CURRENT_BINARY_DIR}/tmpdxcruntimeetw.h
32-
# ${CMAKE_CURRENT_BINARY_DIR}/DxcRuntimeEtw.h
33-
# COMMAND ${CMAKE_COMMAND} -E copy_if_different
34-
# ${CMAKE_CURRENT_BINARY_DIR}/tmpdxcruntimeetw.rc
35-
# ${CMAKE_CURRENT_BINARY_DIR}/DxcRuntimeEtw.rc
36-
# COMMAND ${CMAKE_COMMAND} -E copy_if_different
37-
# ${CMAKE_CURRENT_BINARY_DIR}/tmpdxcruntimeetwTEMP.bin
38-
# ${CMAKE_CURRENT_BINARY_DIR}/DxcRuntimeEtwtemp.BIN
39-
# COMMAND ${CMAKE_COMMAND} -E copy_if_different
40-
# ${CMAKE_CURRENT_BINARY_DIR}/tmpdxcruntimeetw_msg00001.bin
41-
# ${CMAKE_CURRENT_BINARY_DIR}/DxcRuntimeEtw_msg00001.bin
42-
# DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/tmpdxcruntimeetw.h
43-
# COMMENT "Updating instrumentation manifest ..."
44-
# )
4513
add_custom_command(
4614
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/DxcRuntimeEtw.h
47-
COMMAND touch ${CMAKE_CURRENT_BINARY_DIR}/DxcRuntimeEtw.h
15+
COMMAND ${CMAKE_COMMAND} -E copy_if_different
16+
${CMAKE_CURRENT_BINARY_DIR}/tmpdxcruntimeetw.h
17+
${CMAKE_CURRENT_BINARY_DIR}/DxcRuntimeEtw.h
18+
COMMAND ${CMAKE_COMMAND} -E copy_if_different
19+
${CMAKE_CURRENT_BINARY_DIR}/tmpdxcruntimeetw.rc
20+
${CMAKE_CURRENT_BINARY_DIR}/DxcRuntimeEtw.rc
21+
COMMAND ${CMAKE_COMMAND} -E copy_if_different
22+
${CMAKE_CURRENT_BINARY_DIR}/tmpdxcruntimeetwTEMP.bin
23+
${CMAKE_CURRENT_BINARY_DIR}/DxcRuntimeEtwtemp.BIN
24+
COMMAND ${CMAKE_COMMAND} -E copy_if_different
25+
${CMAKE_CURRENT_BINARY_DIR}/tmpdxcruntimeetw_msg00001.bin
26+
${CMAKE_CURRENT_BINARY_DIR}/DxcRuntimeEtw_msg00001.bin
4827
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/tmpdxcruntimeetw.h
4928
COMMENT "Updating instrumentation manifest ..."
5029
)
51-
#------------------
52-
# Mach change end
53-
#------------------
5430

5531
set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/DxcRuntimeEtw.h PROPERTIES GENERATED 1)
5632
set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/DxcRuntimeEtw.rc PROPERTIES GENERATED 1)

tools/CMakeLists.txt

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,12 @@ add_llvm_tool_subdirectory(llvm-as) # HLSL Change
2020
add_llvm_tool_subdirectory(llvm-dis) # HLSL Change
2121
# add_llvm_tool_subdirectory(llvm-mc) # HLSL Change
2222

23-
#------------------
24-
# Mach change start
25-
#------------------
26-
# # HLSL Change Begins
27-
# if (WIN32)
28-
# # This target can currently only be built on Windows.
29-
# add_llvm_tool_subdirectory(dxexp)
30-
# endif (WIN32)
31-
# # HLSL Change ends
32-
#------------------
33-
# Mach change end
34-
#------------------
23+
# HLSL Change Begins
24+
if (WIN32)
25+
# This target can currently only be built on Windows.
26+
add_llvm_tool_subdirectory(dxexp)
27+
endif (WIN32)
28+
# HLSL Change ends
3529

3630
# add_llvm_tool_subdirectory(llc) # HLSL Change
3731
# add_llvm_tool_subdirectory(llvm-ar) # HLSL Change

tools/clang/CMakeLists.txt

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -499,15 +499,9 @@ if( CLANG_INCLUDE_TESTS OR HLSL_INCLUDE_TESTS ) # HLSL Change
499499
clang_unit_site_config=${CMAKE_CURRENT_BINARY_DIR}/test/Unit/lit.site.cfg
500500
)
501501
endif()
502-
#------------------
503-
# Mach change start
504-
#------------------
505-
# if (CLANG_INCLUDE_TESTS) # HLSL Change - respect variable for clang tests
506-
# add_subdirectory(test)
507-
# endif()
508-
#------------------
509-
# Mach change end
510-
#------------------
502+
if (CLANG_INCLUDE_TESTS) # HLSL Change - respect variable for clang tests
503+
add_subdirectory(test)
504+
endif()
511505

512506
if(CLANG_BUILT_STANDALONE)
513507
# Add a global check rule now that all subdirectories have been traversed

tools/clang/lib/ASTMatchers/Dynamic/CMakeLists.txt

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,6 @@ add_clang_library(clangDynamicASTMatchers
1212
clangBasic
1313
)
1414

15-
#------------------
16-
# Mach change start
17-
#------------------
18-
# # HLSL Changes Start
19-
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /bigobj") # otherwise will hit fatal error C1128 on x64
20-
# # HLSL Changes End
21-
#------------------
22-
# Mach change end
23-
#------------------
15+
# HLSL Changes Start
16+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /bigobj") # otherwise will hit fatal error C1128 on x64
17+
# HLSL Changes End

0 commit comments

Comments
 (0)