Skip to content
Closed
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
3 changes: 2 additions & 1 deletion .github/workflows/pr-description-checker.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
name: 'PR description checker'
on:
pull_request_target:
pull_request:
types:
- opened
- edited
- reopened
- labeled
- unlabeled
workflow_dispatch:
permissions:
contents: read
pull-requests: write
Expand Down
6 changes: 4 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,9 @@ if(WIN32)
add_compile_options(/guard:cf)
add_link_options(/guard:cf)
else()
add_compile_options(-fcf-protection)
if(NOT CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64|arm64")
add_compile_options(-fcf-protection)
endif()
endif()
endif(WIN32)

Expand Down Expand Up @@ -595,7 +597,7 @@ if (APPLE)
set(CMAKE_INSTALL_NAME_DIR "@rpath")
set(CMAKE_INSTALL_RPATH "@executable_path/../lib")
endif(NOT DEFINED CMAKE_INSTALL_RPATH)
else(UNIX)
elseif(UNIX)
if(NOT DEFINED CMAKE_INSTALL_RPATH)
set(CMAKE_INSTALL_RPATH "\$ORIGIN/../lib${LLVM_LIBDIR_SUFFIX}")
if(${CMAKE_SYSTEM_NAME} MATCHES "(FreeBSD|DragonFly)")
Expand Down
15 changes: 14 additions & 1 deletion cmake/modules/HandleLLVMOptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,13 @@ if( CMAKE_SIZEOF_VOID_P EQUAL 8 AND NOT WIN32 )
endif( CMAKE_SIZEOF_VOID_P EQUAL 8 AND NOT WIN32 )

if (LLVM_BUILD_STATIC)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static")
if(MINGW)
# We want to mimic MSVC standalone build here
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libgcc -static-libstdc++")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -static-libgcc -static-libstdc++")
else()
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static")
endif()
endif()

if( XCODE )
Expand Down Expand Up @@ -430,12 +436,19 @@ elseif( LLVM_COMPILER_IS_GCC_COMPATIBLE )
append("-Wno-unknown-pragmas" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)

if (MINGW)
append("-Wno-cast-function-type-mismatch" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
append("-Wno-implicit-fallthrough" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
append("-Wno-inconsistent-dllimport" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
append("-Wno-missing-exception-spec" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
append("-Wno-reorder-ctor" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
append("-Wno-sign-compare" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
append("-Wno-unused-const-variable" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
append("-Wno-unused-function" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
append("-Wno-unused-private-field" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)

if (CMAKE_BUILD_TYPE STREQUAL "Debug")
append("-Wno-gnu-zero-variadic-macro-arguments" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
endif()
endif()

add_flag_if_supported("-Wno-unused-but-set-variable" UNUSED_BUT_SET_VARIABLE)
Expand Down
4 changes: 4 additions & 0 deletions tools/clang/tools/dxc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ target_link_libraries(dxc
dxclib
)

if (MINGW)
target_link_options(dxc PRIVATE -mconsole -municode)
endif()

if(ENABLE_SPIRV_CODEGEN)
target_link_libraries(dxc SPIRV-Tools)
endif()
Expand Down
1 change: 0 additions & 1 deletion tools/clang/tools/dxclib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ add_clang_library(dxclib
)

if (MINGW)
target_link_options(dxclib PUBLIC -mconsole -municode)
target_link_libraries(dxclib PRIVATE version)
endif()

Expand Down
5 changes: 0 additions & 5 deletions tools/clang/tools/dxcvalidator/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,5 @@ add_clang_library(dxcvalidator
dxcvalidator.cpp
)

if (MINGW)
target_link_options(dxcvalidator PUBLIC -mconsole -municode)
target_link_libraries(dxcvalidator PRIVATE version)
endif()

target_compile_definitions(dxcvalidator
PRIVATE VERSION_STRING_SUFFIX=" for ${CMAKE_SYSTEM_NAME}")
4 changes: 2 additions & 2 deletions tools/clang/tools/dxildll/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ set(sources
dxcvalidator.cpp
)

if (WIN32)
if (MSVC)
add_clang_library(dxildll SHARED ${sources})
list(APPEND DXCLibs
kernel32.lib
Expand Down Expand Up @@ -77,7 +77,7 @@ if (WIN32)
set_target_properties(${target_name} PROPERTIES SOURCES "${sources}")

set_property(SOURCE dxildll.rc PROPERTY COMPILE_DEFINITIONS "INCLUDE_HLSL_VERSION_FILE=1")
set_property(SOURCE dxildll.rc PROPERTY COMPILE_OPTIONS "/I" "${HLSL_VERSION_LOCATION}" "/I" "${LLVM_MAIN_SRC_DIR}")
set_property(SOURCE dxildll.rc PROPERTY COMPILE_OPTIONS "-I" "${HLSL_VERSION_LOCATION}" "-I" "${LLVM_MAIN_SRC_DIR}")
endif()

set_target_properties(dxildll
Expand Down
4 changes: 4 additions & 0 deletions tools/clang/tools/dxl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ target_link_libraries(dxl
dxcompiler
)

if (MINGW)
target_link_options(dxl PRIVATE -mconsole -municode)
endif()

set_target_properties(dxl PROPERTIES VERSION ${CLANG_EXECUTABLE_VERSION})

if (MSVC)
Expand Down
4 changes: 4 additions & 0 deletions tools/clang/tools/dxr/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ target_link_libraries(dxr
dxcompiler
)

if (MINGW)
target_link_options(dxr PRIVATE -mconsole -municode)
endif()

set_target_properties(dxr PROPERTIES VERSION ${CLANG_EXECUTABLE_VERSION})
# set_target_properties(dxr PROPERTIES ENABLE_EXPORTS 1)

Expand Down