File tree Expand file tree Collapse file tree 7 files changed +22
-12
lines changed
Expand file tree Collapse file tree 7 files changed +22
-12
lines changed Original file line number Diff line number Diff line change @@ -109,7 +109,9 @@ if(WIN32)
109109 add_compile_options (/guard:cf )
110110 add_link_options (/guard:cf )
111111 else ()
112- add_compile_options (-fcf-protection )
112+ if (LLVM_NATIVE_ARCH MATCHES "X86" )
113+ add_compile_options (-fcf-protection )
114+ endif ()
113115 endif ()
114116endif (WIN32 )
115117
Original file line number Diff line number Diff line change @@ -238,6 +238,10 @@ endif( CMAKE_SIZEOF_VOID_P EQUAL 8 AND NOT WIN32 )
238238
239239if (LLVM_BUILD_STATIC)
240240 set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static" )
241+ if (MINGW)
242+ # We want to mimic MSVC standalone build here
243+ set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -static" )
244+ endif ()
241245endif ()
242246
243247if ( XCODE )
@@ -425,12 +429,18 @@ elseif( LLVM_COMPILER_IS_GCC_COMPATIBLE )
425429 append ("-Wno-unknown-pragmas" CMAKE_C_FLAGS CMAKE_CXX_FLAGS )
426430
427431 if (MINGW)
432+ append ("-Wno-cast-function-type-mismatch" CMAKE_C_FLAGS CMAKE_CXX_FLAGS )
428433 append ("-Wno-implicit-fallthrough" CMAKE_C_FLAGS CMAKE_CXX_FLAGS )
429434 append ("-Wno-missing-exception-spec" CMAKE_C_FLAGS CMAKE_CXX_FLAGS )
430435 append ("-Wno-reorder-ctor" CMAKE_C_FLAGS CMAKE_CXX_FLAGS )
431436 append ("-Wno-sign-compare" CMAKE_C_FLAGS CMAKE_CXX_FLAGS )
432437 append ("-Wno-unused-const-variable" CMAKE_C_FLAGS CMAKE_CXX_FLAGS )
433438 append ("-Wno-unused-function" CMAKE_C_FLAGS CMAKE_CXX_FLAGS )
439+ append ("-Wno-unused-private-field" CMAKE_C_FLAGS CMAKE_CXX_FLAGS )
440+
441+ if (CMAKE_BUILD_TYPE STREQUAL "Debug" )
442+ append ("-Wno-gnu-zero-variadic-macro-arguments" CMAKE_C_FLAGS CMAKE_CXX_FLAGS )
443+ endif ()
434444 endif ()
435445
436446 add_flag_if_supported ("-Wno-unused-but-set-variable" UNUSED_BUT_SET_VARIABLE )
Original file line number Diff line number Diff line change 11set (DXC_PROJECTS_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR} )
22set (DXC_PROJECTS_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR} )
33
4- if (WIN32 )
4+ if (MSVC )
55add_subdirectory (include /Tracing ) # DxcRuntimeEtw target
66
77if (HLSL_BUILD_DXILCONV)
88 add_subdirectory (dxilconv )
99endif (HLSL_BUILD_DXILCONV )
1010
11- endif (WIN32 )
11+ endif (MSVC )
Original file line number Diff line number Diff line change @@ -431,6 +431,9 @@ install(DIRECTORY include/clang-c
431431 )
432432
433433add_definitions ( -D_GNU_SOURCE )
434+ if (MINGW)
435+ add_definitions ( -DMS_SUPPORT_VARIABLE_LANGOPTS )
436+ endif ()
434437
435438option (CLANG_ENABLE_ARCMT "Build ARCMT." ON )
436439if (CLANG_ENABLE_ARCMT)
Original file line number Diff line number Diff line change @@ -37,4 +37,4 @@ endif (MSVC)
3737target_compile_definitions (dxclib
3838 PRIVATE VERSION_STRING_SUFFIX= " for ${CMAKE_SYSTEM_NAME} " )
3939
40- add_dependencies (dxclib TablegenHLSLOptions dxcompiler )
40+ add_dependencies (dxclib TablegenHLSLOptions )
Original file line number Diff line number Diff line change @@ -19,10 +19,5 @@ add_clang_library(dxcvalidator
1919 dxcvalidator.cpp
2020 )
2121
22- if (MINGW)
23- target_link_options (dxcvalidator PUBLIC -mconsole -municode )
24- target_link_libraries (dxcvalidator PRIVATE version )
25- endif ()
26-
2722target_compile_definitions (dxcvalidator
2823 PRIVATE VERSION_STRING_SUFFIX= " for ${CMAKE_SYSTEM_NAME} " )
Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ set(sources
4141 dxcvalidator.cpp
4242)
4343
44- if (WIN32 )
44+ if (MSVC )
4545add_clang_library (dxildll SHARED ${sources} )
4646list (APPEND DXCLibs
4747 kernel32.lib
@@ -58,7 +58,7 @@ target_link_libraries(dxildll PRIVATE
5858 dxcvalidator
5959)
6060
61- if (WIN32 )
61+ if (MSVC )
6262add_dependencies (dxildll
6363 ${DXCDependencies}
6464 DxcEtw
@@ -77,7 +77,7 @@ if (WIN32)
7777 set_target_properties (${target_name} PROPERTIES SOURCES "${sources} " )
7878
7979 set_property (SOURCE dxildll.rc PROPERTY COMPILE_DEFINITIONS "INCLUDE_HLSL_VERSION_FILE=1" )
80- set_property (SOURCE dxildll.rc PROPERTY COMPILE_OPTIONS "/ I" "${HLSL_VERSION_LOCATION} " "/ I" "${LLVM_MAIN_SRC_DIR} " )
80+ set_property (SOURCE dxildll.rc PROPERTY COMPILE_OPTIONS "- I" "${HLSL_VERSION_LOCATION} " "- I" "${LLVM_MAIN_SRC_DIR} " )
8181endif ()
8282
8383set_target_properties (dxildll
You can’t perform that action at this time.
0 commit comments