summaryrefslogtreecommitdiffstats
path: root/cmake/LLVM.cmake
diff options
context:
space:
mode:
authorEllie Hermaszewska <ellieh@nvidia.com>2024-10-29 10:15:21 +0800
committerGitHub <noreply@github.com>2024-10-29 10:15:21 +0800
commit657287e774c6d7f740bedbcbd9846de473dd1b18 (patch)
tree0466c5182a4331df4442551dc5305aece34b1e85 /cmake/LLVM.cmake
parentd38fbaefe4e4e43f9febc1afb985227a221963ea (diff)
format cmake files (#5406)
* format cmake files * format code --------- Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
Diffstat (limited to 'cmake/LLVM.cmake')
-rw-r--r--cmake/LLVM.cmake55
1 files changed, 42 insertions, 13 deletions
diff --git a/cmake/LLVM.cmake b/cmake/LLVM.cmake
index a9afdb3cb..e0b7d6241 100644
--- a/cmake/LLVM.cmake
+++ b/cmake/LLVM.cmake
@@ -41,12 +41,22 @@ endfunction()
function(fetch_or_build_slang_llvm)
if(SLANG_SLANG_LLVM_FLAVOR STREQUAL "FETCH_BINARY")
- install_fetched_shared_library("slang-llvm" "${SLANG_SLANG_LLVM_BINARY_URL}")
+ install_fetched_shared_library(
+ "slang-llvm"
+ "${SLANG_SLANG_LLVM_BINARY_URL}"
+ )
elseif(SLANG_SLANG_LLVM_FLAVOR STREQUAL "FETCH_BINARY_IF_POSSIBLE")
if(SLANG_SLANG_LLVM_BINARY_URL)
- install_fetched_shared_library("slang-llvm" "${SLANG_SLANG_LLVM_BINARY_URL}" IGNORE_FAILURE)
+ install_fetched_shared_library(
+ "slang-llvm"
+ "${SLANG_SLANG_LLVM_BINARY_URL}"
+ IGNORE_FAILURE
+ )
if(NOT TARGET slang-llvm)
- message(WARNING "Unable to fetch slang-llvm prebuilt binary, configuring without LLVM support")
+ message(
+ WARNING
+ "Unable to fetch slang-llvm prebuilt binary, configuring without LLVM support"
+ )
endif()
endif()
elseif(SLANG_SLANG_LLVM_FLAVOR STREQUAL "USE_SYSTEM_LLVM")
@@ -77,7 +87,11 @@ function(fetch_or_build_slang_llvm)
)
# If we don't include this, then the symbols in the LLVM linked here may
# conflict with those of other LLVMs linked at runtime, for instance in mesa.
- add_supported_cxx_linker_flags(slang-llvm PRIVATE "-Wl,--exclude-libs,ALL")
+ add_supported_cxx_linker_flags(
+ slang-llvm
+ PRIVATE
+ "-Wl,--exclude-libs,ALL"
+ )
# The LLVM headers need a warning disabling, which somehow slips through \external
if(MSVC)
@@ -94,22 +108,37 @@ function(fetch_or_build_slang_llvm)
if(CMAKE_SYSTEM_NAME MATCHES "Windows")
# DX Agility SDK requires the D3D12*.DLL files to be placed under a sub-directory, "D3D12".
# https://devblogs.microsoft.com/directx/gettingstarted-dx12agility/#d3d12sdkpath-should-not-be-the-same-directory-as-the-application-exe
- file(GLOB prebuilt_binaries "${slang_SOURCE_DIR}/external/slang-binaries/bin/windows-x64/*")
- file(GLOB prebuilt_d3d12_binaries "${slang_SOURCE_DIR}/external/slang-binaries/bin/windows-x64/[dD]3[dD]12*")
+ file(
+ GLOB prebuilt_binaries
+ "${slang_SOURCE_DIR}/external/slang-binaries/bin/windows-x64/*"
+ )
+ file(
+ GLOB prebuilt_d3d12_binaries
+ "${slang_SOURCE_DIR}/external/slang-binaries/bin/windows-x64/[dD]3[dD]12*"
+ )
list(REMOVE_ITEM prebuilt_binaries ${prebuilt_d3d12_binaries})
add_custom_target(
- copy-prebuilt-binaries ALL
- COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/$<CONFIG>/${runtime_subdir}
- COMMAND ${CMAKE_COMMAND} -E copy_if_different
- ${prebuilt_binaries}
+ copy-prebuilt-binaries
+ ALL
+ COMMAND
+ ${CMAKE_COMMAND} -E make_directory
+ ${CMAKE_BINARY_DIR}/$<CONFIG>/${runtime_subdir}
+ COMMAND
+ ${CMAKE_COMMAND} -E copy_if_different ${prebuilt_binaries}
${CMAKE_BINARY_DIR}/$<CONFIG>/${runtime_subdir}
- COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/$<CONFIG>/${runtime_subdir}/D3D12
- COMMAND ${CMAKE_COMMAND} -E copy_if_different
+ COMMAND
+ ${CMAKE_COMMAND} -E make_directory
+ ${CMAKE_BINARY_DIR}/$<CONFIG>/${runtime_subdir}/D3D12
+ COMMAND
+ ${CMAKE_COMMAND} -E copy_if_different
${prebuilt_d3d12_binaries}
${CMAKE_BINARY_DIR}/$<CONFIG>/${runtime_subdir}/D3D12
VERBATIM
)
- set_target_properties(copy-prebuilt-binaries PROPERTIES FOLDER external)
+ set_target_properties(
+ copy-prebuilt-binaries
+ PROPERTIES FOLDER external
+ )
endif()
endif()
endfunction()