diff --git a/CMakeLists.txt b/CMakeLists.txt index c0d957b35d..01cec3107e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,7 +4,11 @@ cmake_minimum_required(VERSION 3.22) # from git describe list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake") include(GitVersion) -get_git_version(SLANG_VERSION_NUMERIC SLANG_VERSION_FULL "${CMAKE_CURRENT_LIST_DIR}") +get_git_version( + SLANG_VERSION_NUMERIC + SLANG_VERSION_FULL + "${CMAKE_CURRENT_LIST_DIR}" +) # # Our project @@ -83,11 +87,22 @@ auto_option( Aftermath "Enable Aftermath in GFX, and add aftermath crash example to project" ) -advanced_option(SLANG_ENABLE_DX_ON_VK "Use dxvk and vkd3d-proton for DirectX support" OFF) +advanced_option( + SLANG_ENABLE_DX_ON_VK + "Use dxvk and vkd3d-proton for DirectX support" + OFF +) advanced_option(SLANG_ENABLE_SLANG_RHI "Use slang-rhi as dependency" ON) -option(SLANG_EMBED_CORE_MODULE_SOURCE "Embed core module source in the binary" ON) -option(SLANG_EMBED_CORE_MODULE "Build slang with an embedded version of the core module") +option( + SLANG_EMBED_CORE_MODULE_SOURCE + "Embed core module source in the binary" + ON +) +option( + SLANG_EMBED_CORE_MODULE + "Build slang with an embedded version of the core module" +) option(SLANG_ENABLE_FULL_IR_VALIDATION "Enable full IR validation (SLOW!)") option(SLANG_ENABLE_IR_BREAK_ALLOC, "Enable _debugUID on IR allocation") @@ -98,31 +113,62 @@ option(SLANG_ENABLE_GFX "Enable gfx targets" ON) option(SLANG_ENABLE_SLANGD "Enable language server target" ON) option(SLANG_ENABLE_SLANGC "Enable standalone compiler target" ON) option(SLANG_ENABLE_SLANGRT "Enable runtime target" ON) -option(SLANG_ENABLE_SLANG_GLSLANG "Enable glslang dependency and slang-glslang wrapper target" ON) -option(SLANG_ENABLE_TESTS "Enable test targets, some tests may require SLANG_ENABLE_GFX, SLANG_ENABLE_SLANGD or SLANG_ENABLE_SLANGRT" ON) -option(SLANG_ENABLE_EXAMPLES "Enable example targets, requires SLANG_ENABLE_GFX" ON) +option( + SLANG_ENABLE_SLANG_GLSLANG + "Enable glslang dependency and slang-glslang wrapper target" + ON +) +option( + SLANG_ENABLE_TESTS + "Enable test targets, some tests may require SLANG_ENABLE_GFX, SLANG_ENABLE_SLANGD or SLANG_ENABLE_SLANGRT" + ON +) +option( + SLANG_ENABLE_EXAMPLES + "Enable example targets, requires SLANG_ENABLE_GFX" + ON +) option(SLANG_ENABLE_REPLAYER "Enable slang-replay tool" ON) -option(SLANG_GITHUB_TOKEN "Use a given token value for accessing Github REST API" "") +option( + SLANG_GITHUB_TOKEN + "Use a given token value for accessing Github REST API" + "" +) advanced_option(SLANG_USE_SYSTEM_MINIZ "Build using system Miniz library" OFF) advanced_option(SLANG_USE_SYSTEM_LZ4 "Build using system LZ4 library" OFF) -advanced_option(SLANG_USE_SYSTEM_VULKAN_HEADERS "Build using system Vulkan headers" OFF) -advanced_option(SLANG_USE_SYSTEM_SPIRV_HEADERS "Build using system SPIR-V headers" OFF) -advanced_option(SLANG_USE_SYSTEM_UNORDERED_DENSE "Build using system unordered dense" OFF) +advanced_option( + SLANG_USE_SYSTEM_VULKAN_HEADERS + "Build using system Vulkan headers" + OFF +) +advanced_option( + SLANG_USE_SYSTEM_SPIRV_HEADERS + "Build using system SPIR-V headers" + OFF +) +advanced_option( + SLANG_USE_SYSTEM_UNORDERED_DENSE + "Build using system unordered dense" + OFF +) -option(SLANG_SPIRV_HEADERS_INCLUDE_DIR "Provide a specific path for the SPIR-V headers and grammar files") +option( + SLANG_SPIRV_HEADERS_INCLUDE_DIR + "Provide a specific path for the SPIR-V headers and grammar files" +) mark_as_advanced(SLANG_SPIRV_HEADERS_INCLUDE_DIR) -if (${SLANG_USE_SYSTEM_LZ4}) +if(${SLANG_USE_SYSTEM_LZ4}) add_compile_definitions(SLANG_USE_SYSTEM_LZ4_HEADER) endif() -if (${SLANG_USE_SYSTEM_SPIRV_HEADERS}) +if(${SLANG_USE_SYSTEM_SPIRV_HEADERS}) add_compile_definitions(SLANG_USE_SYSTEM_SPIRV_HEADER) endif() -if (${SLANG_USE_SYSTEM_UNORDERED_DENSE}) +if(${SLANG_USE_SYSTEM_UNORDERED_DENSE}) add_compile_definitions(SLANG_USE_SYSTEM_UNORDERED_DENSE_HEADER) endif() @@ -166,9 +212,15 @@ if(SLANG_SLANG_LLVM_FLAVOR MATCHES FETCH_BINARY) get_best_slang_binary_release_url("${SLANG_GITHUB_TOKEN}" url) if(NOT DEFINED url) if(SLANG_SLANG_LLVM_FLAVOR STREQUAL FETCH_BINARY_IF_POSSIBLE) - message(WARNING "Unable to find a prebuilt binary for slang-llvm, Slang will be built without LLVM support. Please consider setting SLANG_SLANG_LLVM_BINARY_URL manually") + message( + WARNING + "Unable to find a prebuilt binary for slang-llvm, Slang will be built without LLVM support. Please consider setting SLANG_SLANG_LLVM_BINARY_URL manually" + ) else() - message(FATAL_ERROR "Unable to find binary release for slang-llvm, please set a different SLANG_SLANG_LLVM_FLAVOR or set SLANG_SLANG_LLVM_BINARY_URL manually") + message( + FATAL_ERROR + "Unable to find binary release for slang-llvm, please set a different SLANG_SLANG_LLVM_FLAVOR or set SLANG_SLANG_LLVM_BINARY_URL manually" + ) endif() endif() endif() @@ -180,21 +232,23 @@ if(SLANG_SLANG_LLVM_FLAVOR MATCHES FETCH_BINARY) endif() set(webgpu_dawn_release_tag "webgpu_dawn-0") -if(CMAKE_SYSTEM_NAME MATCHES "Windows" AND - CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64|amd64|AMD64") - set( - SLANG_WEBGPU_DAWN_BINARY_URL - "https://github.com/shader-slang/dawn/releases/download/${webgpu_dawn_release_tag}/webgpu_dawn-windows-x64.zip" - ) +if( + CMAKE_SYSTEM_NAME MATCHES "Windows" + AND CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64|amd64|AMD64" +) + set(SLANG_WEBGPU_DAWN_BINARY_URL + "https://github.com/shader-slang/dawn/releases/download/${webgpu_dawn_release_tag}/webgpu_dawn-windows-x64.zip" + ) endif() set(slang_tint_release_tag "slang-tint-0") -if(CMAKE_SYSTEM_NAME MATCHES "Windows" AND - CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64|amd64|AMD64") - set( - SLANG_SLANG_TINT_BINARY_URL - "https://github.com/shader-slang/dawn/releases/download/${slang_tint_release_tag}/slang-tint-windows-x64.zip" - ) +if( + CMAKE_SYSTEM_NAME MATCHES "Windows" + AND CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64|amd64|AMD64" +) + set(SLANG_SLANG_TINT_BINARY_URL + "https://github.com/shader-slang/dawn/releases/download/${slang_tint_release_tag}/slang-tint-windows-x64.zip" + ) endif() # @@ -230,7 +284,7 @@ endif() find_package(Threads REQUIRED) -if (${SLANG_USE_SYSTEM_UNORDERED_DENSE}) +if(${SLANG_USE_SYSTEM_UNORDERED_DENSE}) find_package(unordered_dense CONFIG QUIET) endif() @@ -273,20 +327,13 @@ add_subdirectory(examples) set(CPACK_ARCHIVE_COMPONENT_INSTALL ON) set(CPACK_COMPONENTS_ALL_IN_ONE_PACKAGE ON) set(CPACK_STRIP_FILES FALSE) -install(FILES - "${slang_SOURCE_DIR}/README.md" - "${slang_SOURCE_DIR}/LICENSE" - DESTINATION . - COMPONENT metadata - EXCLUDE_FROM_ALL -) -install(DIRECTORY - "${slang_SOURCE_DIR}/docs/" - DESTINATION share/doc/slang -) -install(DIRECTORY - "${slang_SOURCE_DIR}/include" - DESTINATION . +install( + FILES "${slang_SOURCE_DIR}/README.md" "${slang_SOURCE_DIR}/LICENSE" + DESTINATION . + COMPONENT metadata + EXCLUDE_FROM_ALL ) +install(DIRECTORY "${slang_SOURCE_DIR}/docs/" DESTINATION share/doc/slang) +install(DIRECTORY "${slang_SOURCE_DIR}/include" DESTINATION .) include(CPack) diff --git a/cmake/FetchedSharedLibrary.cmake b/cmake/FetchedSharedLibrary.cmake index 3c7f24be58..fa0bd9f5e4 100644 --- a/cmake/FetchedSharedLibrary.cmake +++ b/cmake/FetchedSharedLibrary.cmake @@ -9,23 +9,24 @@ function(download_and_extract archive_name url) set(archive_path ${url}) else() message(STATUS "Fetching ${archive_name} from ${url}") - file(DOWNLOAD ${url} ${archive_path} - # SHOW_PROGRESS - STATUS status + file( + DOWNLOAD ${url} ${archive_path} + # SHOW_PROGRESS + STATUS status ) list(GET status 0 status_code) list(GET status 1 status_string) if(NOT status_code EQUAL 0) - message(WARNING "Failed to download ${archive_name} from ${url}: ${status_string}") + message( + WARNING + "Failed to download ${archive_name} from ${url}: ${status_string}" + ) return() endif() endif() - file(ARCHIVE_EXTRACT - INPUT ${archive_path} - DESTINATION ${extract_dir} - ) + file(ARCHIVE_EXTRACT INPUT ${archive_path} DESTINATION ${extract_dir}) set(${archive_name}_SOURCE_DIR ${extract_dir} PARENT_SCOPE) message(STATUS "${archive_name} downloaded and extracted to ${extract_dir}") @@ -51,10 +52,7 @@ function(copy_fetched_shared_library library_name url) ) macro(from_glob dir) # A little helper function - file( - GLOB_RECURSE source_object - "${dir}/${shared_library_filename}" - ) + file(GLOB_RECURSE source_object "${dir}/${shared_library_filename}") list(LENGTH source_object nmatches) if(nmatches EQUAL 0) message( @@ -88,7 +86,10 @@ function(copy_fetched_shared_library library_name url) elseif(ARG_IGNORE_FAILURE) return() else() - message(SEND_ERROR "Unable to download and extract ${library_name} from ${url}") + message( + SEND_ERROR + "Unable to download and extract ${library_name} from ${url}" + ) return() endif() endif() diff --git a/cmake/GitHubRelease.cmake b/cmake/GitHubRelease.cmake index 0590933d2a..adcb9a5634 100644 --- a/cmake/GitHubRelease.cmake +++ b/cmake/GitHubRelease.cmake @@ -14,24 +14,45 @@ function(check_assets_for_file json_content filename found_var) set(${found_var} "${found}" PARENT_SCOPE) endfunction() -function(get_latest owner repo os arch github_token out_var) - set(json_output_file "${CMAKE_CURRENT_BINARY_DIR}/${owner}_${repo}_release_info.json") - set(latest_release_url "https://api.github.com/repos/${owner}/${repo}/releases/latest") +function( + get_latest + owner + repo + os + arch + github_token + out_var +) + set(json_output_file + "${CMAKE_CURRENT_BINARY_DIR}/${owner}_${repo}_release_info.json" + ) + set(latest_release_url + "https://api.github.com/repos/${owner}/${repo}/releases/latest" + ) set(download_args "${latest_release_url}" "${json_output_file}" - STATUS download_statuses + STATUS + download_statuses ) if(github_token) - list(APPEND download_args HTTPHEADER "Authorization: token ${github_token}") + list( + APPEND + download_args + HTTPHEADER + "Authorization: token ${github_token}" + ) endif() file(DOWNLOAD ${download_args}) list(GET download_statuses 0 status_code) if(NOT status_code EQUAL 0) - message(WARNING "Failed to download latest release info from ${latest_release_url}") + message( + WARNING + "Failed to download latest release info from ${latest_release_url}" + ) return() endif() @@ -42,33 +63,62 @@ function(get_latest owner repo os arch github_token out_var) # Check if the expected ZIP file is in the latest release set(desired_zip "${repo}-${latest_version}-${os}-${arch}.zip") - message(VERBOSE "searching for the prebuilt slang-llvm library in ${latest_release_url}") - check_assets_for_file("${latest_json_content}" "${desired_zip}" file_found_latest) + message( + VERBOSE + "searching for the prebuilt slang-llvm library in ${latest_release_url}" + ) + check_assets_for_file( + "${latest_json_content}" + "${desired_zip}" + file_found_latest + ) if(file_found_latest) # If we got it, we found a good version set(${out_var} "${latest_version}" PARENT_SCOPE) else() - message(WARNING "No release binary for ${os}-${arch} exists for the latest version: ${latest_version}") + message( + WARNING + "No release binary for ${os}-${arch} exists for the latest version: ${latest_version}" + ) endif() endfunction() -function(check_release_and_get_latest owner repo version os arch github_token out_var) +function( + check_release_and_get_latest + owner + repo + version + os + arch + github_token + out_var +) # Construct the URL for the specified version's release API endpoint - set(version_url "https://api.github.com/repos/${owner}/${repo}/releases/tags/v${version}") + set(version_url + "https://api.github.com/repos/${owner}/${repo}/releases/tags/v${version}" + ) - set(json_output_file "${CMAKE_CURRENT_BINARY_DIR}/${owner}_${repo}_release_info.json") + set(json_output_file + "${CMAKE_CURRENT_BINARY_DIR}/${owner}_${repo}_release_info.json" + ) # Prepare download arguments set(download_args "${version_url}" "${json_output_file}" - STATUS download_statuses + STATUS + download_statuses ) if(github_token) # Add authorization header if token is provided - list(APPEND download_args HTTPHEADER "Authorization: token ${github_token}") + list( + APPEND + download_args + HTTPHEADER + "Authorization: token ${github_token}" + ) endif() # Perform the download @@ -81,18 +131,28 @@ function(check_release_and_get_latest owner repo version os arch github_token ou # Check if the specified version contains the expected ZIP file set(desired_zip "${repo}-${version}-${os}-${arch}.zip") - message(VERBOSE "searching for the prebuilt slang-llvm library in ${version_url}") + message( + VERBOSE + "searching for the prebuilt slang-llvm library in ${version_url}" + ) check_assets_for_file("${json_content}" "${desired_zip}" file_found) if(file_found) set(${out_var} "${version}" PARENT_SCOPE) return() endif() - message(WARNING "Failed to find ${desired_zip} in release assets for ${version} from ${version_url}\nFalling back to latest version if it differs") + message( + WARNING + "Failed to find ${desired_zip} in release assets for ${version} from ${version_url}\nFalling back to latest version if it differs" + ) else() - set(w "Failed to download release info for version ${version} from ${version_url}\nFalling back to latest version if it differs") + set(w + "Failed to download release info for version ${version} from ${version_url}\nFalling back to latest version if it differs" + ) if(status_code EQUAL 22) - set(w "${w}\nIf you think this is failing because of GitHub API rate limiting, Github allows a higher limit if you use a token. Try the cmake option -DSLANG_GITHUB_TOKEN=your_token_here") + set(w + "${w}\nIf you think this is failing because of GitHub API rate limiting, Github allows a higher limit if you use a token. Try the cmake option -DSLANG_GITHUB_TOKEN=your_token_here" + ) endif() message(WARNING ${w}) @@ -112,7 +172,10 @@ function(get_best_slang_binary_release_url github_token out_var) elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64|ARM64|arm64") set(arch "aarch64") else() - message(WARNING "Unsupported architecture for slang binary releases: ${CMAKE_SYSTEM_PROCESSOR}") + message( + WARNING + "Unsupported architecture for slang binary releases: ${CMAKE_SYSTEM_PROCESSOR}" + ) return() endif() @@ -123,7 +186,10 @@ function(get_best_slang_binary_release_url github_token out_var) elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux") set(os "linux") else() - message(WARNING "Unsupported operating system for slang binary releases: ${CMAKE_SYSTEM_NAME}") + message( + WARNING + "Unsupported operating system for slang binary releases: ${CMAKE_SYSTEM_NAME}" + ) return() endif() @@ -135,17 +201,43 @@ function(get_best_slang_binary_release_url github_token out_var) # fallback to the latest release if(${SLANG_VERSION_NUMERIC} VERSION_LESS "2024.1.27") if(${SLANG_VERSION_NUMERIC} VERSION_EQUAL "0.0.0") - message(VERBOSE "The detected version of slang is ${SLANG_VERSION_NUMERIC}, fetching libslang-llvm from the latest release") + message( + VERBOSE + "The detected version of slang is ${SLANG_VERSION_NUMERIC}, fetching libslang-llvm from the latest release" + ) else() - message(WARNING "The detected version of slang ${SLANG_VERSION_NUMERIC} is very old (probably you haven't fetched tags recently?), libslang-llvm will be fetched from the latest release rather than the one matching ${SLANG_VERSION_NUMERIC}") + message( + WARNING + "The detected version of slang ${SLANG_VERSION_NUMERIC} is very old (probably you haven't fetched tags recently?), libslang-llvm will be fetched from the latest release rather than the one matching ${SLANG_VERSION_NUMERIC}" + ) endif() - get_latest(${owner} ${repo} ${os} ${arch} "${github_token}" release_version) + get_latest( + ${owner} + ${repo} + ${os} + ${arch} + "${github_token}" + release_version + ) else() - check_release_and_get_latest(${owner} ${repo} ${SLANG_VERSION_NUMERIC} ${os} ${arch} "${github_token}" release_version) + check_release_and_get_latest( + ${owner} + ${repo} + ${SLANG_VERSION_NUMERIC} + ${os} + ${arch} + "${github_token}" + release_version + ) endif() if(DEFINED release_version) - message(VERBOSE "Found a version of libslang-llvm.so in ${release_version}") - set(${out_var} "https://github.com/${owner}/${repo}/releases/download/v${release_version}/slang-${release_version}-${os}-${arch}.zip" PARENT_SCOPE) + message( + VERBOSE + "Found a version of libslang-llvm.so in ${release_version}" + ) + set(${out_var} + "https://github.com/${owner}/${repo}/releases/download/v${release_version}/slang-${release_version}-${os}-${arch}.zip" + PARENT_SCOPE + ) endif() endfunction() - diff --git a/cmake/Glob.cmake b/cmake/Glob.cmake index 831a074961..7adf355f12 100644 --- a/cmake/Glob.cmake +++ b/cmake/Glob.cmake @@ -22,9 +22,9 @@ function(slang_glob_sources var dir) "*.natstepfilter" "*.natjmc" ) - if (CMAKE_SYSTEM_NAME MATCHES "Darwin") + if(CMAKE_SYSTEM_NAME MATCHES "Darwin") list(APPEND patterns "*.mm") - endif() + endif() list(TRANSFORM patterns PREPEND "${dir}/") file(GLOB_RECURSE files CONFIGURE_DEPENDS ${patterns}) diff --git a/cmake/LLVM.cmake b/cmake/LLVM.cmake index a9afdb3cb0..e0b7d6241c 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}/$/${runtime_subdir} - COMMAND ${CMAKE_COMMAND} -E copy_if_different - ${prebuilt_binaries} + copy-prebuilt-binaries + ALL + COMMAND + ${CMAKE_COMMAND} -E make_directory + ${CMAKE_BINARY_DIR}/$/${runtime_subdir} + COMMAND + ${CMAKE_COMMAND} -E copy_if_different ${prebuilt_binaries} ${CMAKE_BINARY_DIR}/$/${runtime_subdir} - COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/$/${runtime_subdir}/D3D12 - COMMAND ${CMAKE_COMMAND} -E copy_if_different + COMMAND + ${CMAKE_COMMAND} -E make_directory + ${CMAKE_BINARY_DIR}/$/${runtime_subdir}/D3D12 + COMMAND + ${CMAKE_COMMAND} -E copy_if_different ${prebuilt_d3d12_binaries} ${CMAKE_BINARY_DIR}/$/${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() diff --git a/cmake/SlangTarget.cmake b/cmake/SlangTarget.cmake index bf1abe3a98..4a3b757046 100644 --- a/cmake/SlangTarget.cmake +++ b/cmake/SlangTarget.cmake @@ -232,7 +232,10 @@ function(slang_add_target dir type) if(CMAKE_SYSTEM_NAME MATCHES "Darwin") foreach(link_framework ${ARG_LINK_WITH_FRAMEWORK}) - target_link_libraries(${target} PRIVATE "-framework ${link_framework}") + target_link_libraries( + ${target} + PRIVATE "-framework ${link_framework}" + ) endforeach() endif() @@ -294,7 +297,10 @@ function(slang_add_target dir type) PUBLIC "${ARG_EXPORT_MACRO_PREFIX}_STATIC" ) else() - message(WARNING "unhandled case in slang_add_target while setting export macro") + message( + WARNING + "unhandled case in slang_add_target while setting export macro" + ) endif() endif() @@ -394,18 +400,10 @@ function(slang_add_target dir type) install( TARGETS ${target} EXPORT SlangTargets - ARCHIVE - DESTINATION ${archive_subdir} - ${ARGN} - LIBRARY - DESTINATION ${library_subdir} - ${ARGN} - RUNTIME - DESTINATION ${runtime_subdir} - ${ARGN} - PUBLIC_HEADER - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} - ${ARGN} + ARCHIVE DESTINATION ${archive_subdir} ${ARGN} + LIBRARY DESTINATION ${library_subdir} ${ARGN} + RUNTIME DESTINATION ${runtime_subdir} ${ARGN} + PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} ${ARGN} ) endmacro() if(ARG_INSTALL) diff --git a/external/CMakeLists.txt b/external/CMakeLists.txt index 4f861c7596..9a27f7bcc5 100644 --- a/external/CMakeLists.txt +++ b/external/CMakeLists.txt @@ -11,7 +11,10 @@ endif() if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.25") set(system SYSTEM) else() - message(STATUS "CMake 3.25 is required to suppress warnings originating in headers in external/ but you are using ${CMAKE_VERSION}, be prepared for some warnings") + message( + STATUS + "CMake 3.25 is required to suppress warnings originating in headers in external/ but you are using ${CMAKE_VERSION}, be prepared for some warnings" + ) set(system) endif() @@ -24,12 +27,12 @@ if(NOT SLANG_ENABLE_EXTERNAL_COMPILER_WARNINGS) endif() endif() -if (NOT ${SLANG_USE_SYSTEM_UNORDERED_DENSE}) +if(NOT ${SLANG_USE_SYSTEM_UNORDERED_DENSE}) add_subdirectory(unordered_dense EXCLUDE_FROM_ALL ${system}) endif() # Miniz -if (NOT ${SLANG_USE_SYSTEM_MINIZ}) +if(NOT ${SLANG_USE_SYSTEM_MINIZ}) add_subdirectory(miniz EXCLUDE_FROM_ALL ${system}) set_property(TARGET miniz PROPERTY POSITION_INDEPENDENT_CODE ON) # Work around https://github.com/richgel999/miniz/pull/292 @@ -41,28 +44,31 @@ if (NOT ${SLANG_USE_SYSTEM_MINIZ}) endif() # LZ4 -if (NOT ${SLANG_USE_SYSTEM_LZ4}) +if(NOT ${SLANG_USE_SYSTEM_LZ4}) set(LZ4_BUNDLED_MODE ON) add_subdirectory(lz4/build/cmake EXCLUDE_FROM_ALL ${system}) if(MSVC) - target_compile_options( - lz4_static - PRIVATE /wd5045 /wd4820 /wd4711 /wd6385 /wd6262 - ) + target_compile_options( + lz4_static + PRIVATE /wd5045 /wd4820 /wd4711 /wd6385 /wd6262 + ) endif() endif() # Vulkan headers -if (NOT ${SLANG_USE_SYSTEM_VULKAN_HEADERS}) +if(NOT ${SLANG_USE_SYSTEM_VULKAN_HEADERS}) add_subdirectory(vulkan EXCLUDE_FROM_ALL ${system}) endif() # metal-cpp headers add_library(metal-cpp INTERFACE) -target_include_directories(metal-cpp INTERFACE "${CMAKE_CURRENT_LIST_DIR}/metal-cpp") +target_include_directories( + metal-cpp + INTERFACE "${CMAKE_CURRENT_LIST_DIR}/metal-cpp" +) # SPIRV-Headers -if (NOT ${SLANG_USE_SYSTEM_SPIRV_HEADERS}) +if(NOT ${SLANG_USE_SYSTEM_SPIRV_HEADERS}) add_subdirectory(spirv-headers EXCLUDE_FROM_ALL ${system}) endif() diff --git a/prelude/CMakeLists.txt b/prelude/CMakeLists.txt index b9a763f035..67dc89d993 100644 --- a/prelude/CMakeLists.txt +++ b/prelude/CMakeLists.txt @@ -24,7 +24,9 @@ slang_add_target( EXPLICIT_SOURCE ${prelude_source} EXCLUDE_FROM_ALL TARGET_NAME prelude - INCLUDE_DIRECTORIES_PUBLIC ${CMAKE_CURRENT_LIST_DIR} ${CMAKE_CURRENT_LIST_DIR}/../include + INCLUDE_DIRECTORIES_PUBLIC + ${CMAKE_CURRENT_LIST_DIR} + ${CMAKE_CURRENT_LIST_DIR}/../include LINK_WITH_PRIVATE unordered_dense::unordered_dense PUBLIC_HEADERS ${CMAKE_CURRENT_LIST_DIR}/slang*.h # It's an object library, so the install step only installs the headers diff --git a/source/core/CMakeLists.txt b/source/core/CMakeLists.txt index 15da2abfb1..8228d00670 100644 --- a/source/core/CMakeLists.txt +++ b/source/core/CMakeLists.txt @@ -3,8 +3,9 @@ slang_add_target( STATIC EXCLUDE_FROM_ALL USE_EXTRA_WARNINGS - LINK_WITH_PRIVATE - miniz lz4_static Threads::Threads ${CMAKE_DL_LIBS} + LINK_WITH_PRIVATE miniz lz4_static Threads::Threads ${CMAKE_DL_LIBS} LINK_WITH_PUBLIC unordered_dense::unordered_dense - INCLUDE_DIRECTORIES_PUBLIC ${slang_SOURCE_DIR}/source ${slang_SOURCE_DIR}/include + INCLUDE_DIRECTORIES_PUBLIC + ${slang_SOURCE_DIR}/source + ${slang_SOURCE_DIR}/include ) diff --git a/source/slang-glslang/CMakeLists.txt b/source/slang-glslang/CMakeLists.txt index 37bb93ca08..d28177ccc9 100644 --- a/source/slang-glslang/CMakeLists.txt +++ b/source/slang-glslang/CMakeLists.txt @@ -12,5 +12,9 @@ if(SLANG_ENABLE_SLANG_GLSLANG) ) # Our only interface is through what we define in source/slang-glslang, in the # interests of hygiene, hide anything else we link in. - add_supported_cxx_linker_flags(slang-glslang PRIVATE "-Wl,--exclude-libs,ALL") + add_supported_cxx_linker_flags( + slang-glslang + PRIVATE + "-Wl,--exclude-libs,ALL" + ) endif() diff --git a/source/slang-rt/CMakeLists.txt b/source/slang-rt/CMakeLists.txt index fc37237cd7..2dc56355e0 100644 --- a/source/slang-rt/CMakeLists.txt +++ b/source/slang-rt/CMakeLists.txt @@ -5,8 +5,7 @@ if(SLANG_ENABLE_SLANGRT) # This compiles 'core' again with the SLANG_RT_DYNAMIC_EXPORT macro defined EXTRA_SOURCE_DIRS ${slang_SOURCE_DIR}/source/core USE_EXTRA_WARNINGS - LINK_WITH_PRIVATE - miniz lz4_static Threads::Threads ${CMAKE_DL_LIBS} + LINK_WITH_PRIVATE miniz lz4_static Threads::Threads ${CMAKE_DL_LIBS} LINK_WITH_PUBLIC unordered_dense::unordered_dense EXPORT_MACRO_PREFIX SLANG_RT INCLUDE_DIRECTORIES_PUBLIC ${slang_SOURCE_DIR}/include diff --git a/source/slang-stdlib/CMakeLists.txt b/source/slang-stdlib/CMakeLists.txt index fd9394e4a9..96a874d081 100644 --- a/source/slang-stdlib/CMakeLists.txt +++ b/source/slang-stdlib/CMakeLists.txt @@ -29,18 +29,23 @@ set(core_module_common_args . OBJECT EXCLUDE_FROM_ALL - EXPORT_MACRO_PREFIX SLANG - EXPORT_TYPE_AS ${SLANG_LIB_TYPE} - FOLDER generated - LINK_WITH_PRIVATE core + EXPORT_MACRO_PREFIX + SLANG + EXPORT_TYPE_AS + ${SLANG_LIB_TYPE} + FOLDER + generated + LINK_WITH_PRIVATE + core USE_EXTRA_WARNINGS - EXPLICIT_SOURCE ./slang-embedded-core-module.cpp + EXPLICIT_SOURCE + ./slang-embedded-core-module.cpp ) slang_add_target( ${core_module_common_args} TARGET_NAME slang-embedded-core-module - EXPLICIT_SOURCE ${core_module_generated_header} + EXPLICIT_SOURCE ${core_module_generated_header} EXTRA_COMPILE_DEFINITIONS_PRIVATE SLANG_EMBED_CORE_MODULE INCLUDE_DIRECTORIES_PRIVATE ${core_module_generated_header_dir} ) @@ -56,7 +61,10 @@ slang_add_target( # List of *.meta.slang headers set(core_module_meta_source_dir "${slang_SOURCE_DIR}/source/slang") -glob_append(core_module_meta_source "${core_module_meta_source_dir}/*.meta.slang") +glob_append( + core_module_meta_source + "${core_module_meta_source_dir}/*.meta.slang" +) set(core_module_meta_output_dir "${CMAKE_CURRENT_BINARY_DIR}/core-module-meta") @@ -87,7 +95,10 @@ add_custom_command( VERBATIM ) -add_custom_target(generate-core-module-headers DEPENDS ${core_module_meta_generated_headers}) +add_custom_target( + generate-core-module-headers + DEPENDS ${core_module_meta_generated_headers} +) set_target_properties(generate-core-module-headers PROPERTIES FOLDER generated) # @@ -99,22 +110,28 @@ set(core_module_source_common_args OBJECT EXCLUDE_FROM_ALL USE_EXTRA_WARNINGS - LINK_WITH_PRIVATE - core - slang-capability-defs - slang-reflect-headers - SPIRV-Headers - INCLUDE_DIRECTORIES_PRIVATE ../slang - FOLDER generated - EXPLICIT_SOURCE - ./slang-embedded-core-module-source.cpp - ${core_module_meta_generated_headers} - REQUIRES generate-core-module-headers - EXTRA_COMPILE_DEFINITIONS_PRIVATE SLANG_EMBED_CORE_MODULE_SOURCE - INCLUDE_DIRECTORIES_PRIVATE - ${core_module_meta_output_dir} - EXPORT_MACRO_PREFIX SLANG - EXPORT_TYPE_AS ${SLANG_LIB_TYPE} + LINK_WITH_PRIVATE + core + slang-capability-defs + slang-reflect-headers + SPIRV-Headers + INCLUDE_DIRECTORIES_PRIVATE + ../slang + FOLDER + generated + EXPLICIT_SOURCE + ./slang-embedded-core-module-source.cpp + ${core_module_meta_generated_headers} + REQUIRES + generate-core-module-headers + EXTRA_COMPILE_DEFINITIONS_PRIVATE + SLANG_EMBED_CORE_MODULE_SOURCE + INCLUDE_DIRECTORIES_PRIVATE + ${core_module_meta_output_dir} + EXPORT_MACRO_PREFIX + SLANG + EXPORT_TYPE_AS + ${SLANG_LIB_TYPE} ) slang_add_target( diff --git a/source/slang-wasm/CMakeLists.txt b/source/slang-wasm/CMakeLists.txt index 75bbe3b692..2f3e6e8d37 100644 --- a/source/slang-wasm/CMakeLists.txt +++ b/source/slang-wasm/CMakeLists.txt @@ -3,7 +3,7 @@ # # This is an executable target because emcmake produces .a files without bindings if you just create a static library # https://stackoverflow.com/questions/63622009/static-library-built-with-cmake-as-a-with-emscripten-instead-of-wasm-js -if (EMSCRIPTEN) +if(EMSCRIPTEN) slang_add_target( . EXECUTABLE diff --git a/source/slang/CMakeLists.txt b/source/slang/CMakeLists.txt index a08ad1efcb..fc815f84cd 100644 --- a/source/slang/CMakeLists.txt +++ b/source/slang/CMakeLists.txt @@ -1,4 +1,3 @@ - # # generate capability files # @@ -20,7 +19,8 @@ add_custom_command( COMMAND ${CMAKE_COMMAND} -E make_directory ${SLANG_CAPABILITY_OUTPUT_DIR} COMMAND slang-capability-generator ${SLANG_CAPABILITY_SOURCE} --target-directory - ${SLANG_CAPABILITY_OUTPUT_DIR} --doc "${slang_SOURCE_DIR}/docs/user-guide/a3-02-reference-capability-atoms.md" + ${SLANG_CAPABILITY_OUTPUT_DIR} --doc + "${slang_SOURCE_DIR}/docs/user-guide/a3-02-reference-capability-atoms.md" DEPENDS ${SLANG_CAPABILITY_SOURCE} slang-capability-generator WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR} VERBATIM @@ -105,8 +105,10 @@ target_include_directories( # generated lookup tables # -if (NOT SLANG_USE_SYSTEM_SPIRV_HEADERS) - set(SLANG_SPIRV_HEADERS_INCLUDE_DIR "${slang_SOURCE_DIR}/external/spirv-headers/include") +if(NOT SLANG_USE_SYSTEM_SPIRV_HEADERS) + set(SLANG_SPIRV_HEADERS_INCLUDE_DIR + "${slang_SOURCE_DIR}/external/spirv-headers/include" + ) endif() set(SLANG_LOOKUP_GENERATOR_INPUT_JSON @@ -146,8 +148,7 @@ add_custom_command( COMMAND ${CMAKE_COMMAND} -E make_directory ${SLANG_LOOKUP_GENERATOR_OUTPUT_DIR} COMMAND - slang-spirv-embed-generator - ${SLANG_SPIRV_CORE_SOURCE_JSON} + slang-spirv-embed-generator ${SLANG_SPIRV_CORE_SOURCE_JSON} ${SLANG_SPIRV_CORE_GRAMMAR_SOURCE} DEPENDS ${SLANG_SPIRV_CORE_SOURCE_JSON} slang-spirv-embed-generator VERBATIM @@ -157,7 +158,9 @@ slang_add_target( slang-lookup-tables OBJECT USE_EXTRA_WARNINGS - EXPLICIT_SOURCE ${SLANG_LOOKUP_GENERATED_SOURCE} ${SLANG_SPIRV_CORE_GRAMMAR_SOURCE} + EXPLICIT_SOURCE + ${SLANG_LOOKUP_GENERATED_SOURCE} + ${SLANG_SPIRV_CORE_GRAMMAR_SOURCE} LINK_WITH_PRIVATE core SPIRV-Headers EXCLUDE_FROM_ALL FOLDER generated @@ -167,7 +170,10 @@ slang_add_target( # Generate the version header # -configure_file(${slang_SOURCE_DIR}/slang-tag-version.h.in slang-version-header/slang-tag-version.h) +configure_file( + ${slang_SOURCE_DIR}/slang-tag-version.h.in + slang-version-header/slang-tag-version.h +) # # Slang itself @@ -176,37 +182,42 @@ configure_file(${slang_SOURCE_DIR}/slang-tag-version.h.in slang-version-header/s set(slang_build_args USE_EXTRA_WARNINGS EXTRA_COMPILE_OPTIONS_PRIVATE - # a warning is disabled for a memset boundary check. - # everything looked fine and it is unclear why the checking fails - $<$:-Wno-error=stringop-overflow> - INCLUDE_DIRECTORIES_PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/slang-version-header - EXPORT_MACRO_PREFIX SLANG - EXPORT_TYPE_AS ${SLANG_LIB_TYPE} - EXTRA_SOURCE_DIRS ${SLANG_RECORD_REPLAY_SYSTEM} + # a warning is disabled for a memset boundary check. + # everything looked fine and it is unclear why the checking fails + $<$:-Wno-error=stringop-overflow> + INCLUDE_DIRECTORIES_PRIVATE + ${CMAKE_CURRENT_BINARY_DIR}/slang-version-header + EXPORT_MACRO_PREFIX + SLANG + EXPORT_TYPE_AS + ${SLANG_LIB_TYPE} + EXTRA_SOURCE_DIRS + ${SLANG_RECORD_REPLAY_SYSTEM} ) set(slang_link_args LINK_WITH_PRIVATE - core - prelude - compiler-core - slang-capability-defs - slang-capability-lookup - slang-reflect-headers - slang-lookup-tables - SPIRV-Headers + core + prelude + compiler-core + slang-capability-defs + slang-capability-lookup + slang-reflect-headers + slang-lookup-tables + SPIRV-Headers ) set(slang_interface_args # slang.h is in the project root, so include that directory in the interface # for slang - INCLUDE_DIRECTORIES_PUBLIC ${slang_SOURCE_DIR} -) + INCLUDE_DIRECTORIES_PUBLIC + ${slang_SOURCE_DIR} +) set(slang_public_lib_args - PUBLIC_HEADERS - ${slang_SOURCE_DIR}/include/slang*.h - ${CMAKE_CURRENT_BINARY_DIR}/slang-version-header/*.h + PUBLIC_HEADERS + ${slang_SOURCE_DIR}/include/slang*.h + ${CMAKE_CURRENT_BINARY_DIR}/slang-version-header/*.h LINK_WITH_PRIVATE - $,slang-embedded-core-module,slang-no-embedded-core-module> - $,slang-embedded-core-module-source,slang-no-embedded-core-module-source> + $,slang-embedded-core-module,slang-no-embedded-core-module> + $,slang-embedded-core-module-source,slang-no-embedded-core-module-source> INSTALL ) @@ -231,7 +242,7 @@ if(NOT SLANG_EMBED_CORE_MODULE) ${slang_public_lib_args} INSTALL_COMPONENT generators ) - add_library(slang-without-embedded-core-module ALIAS slang) + add_library(slang-without-embedded-core-module ALIAS slang) else() # However if we're embedding core module, we need to make two different # libraries, one with the embedded core module and one without, so first define @@ -250,12 +261,11 @@ else() ${slang_link_args} ${slang_interface_args} NO_SOURCE - TARGET_NAME - slang-without-embedded-core-module + TARGET_NAME slang-without-embedded-core-module EXCLUDE_FROM_ALL - LINK_WITH_PRIVATE + LINK_WITH_PRIVATE slang-common-objects - slang-no-embedded-core-module + slang-no-embedded-core-module slang-embedded-core-module-source OUTPUT_DIR generators FOLDER generators @@ -267,8 +277,7 @@ else() ${slang_link_args} ${slang_interface_args} ${slang_public_lib_args} - LINK_WITH_PRIVATE - slang-common-objects + LINK_WITH_PRIVATE slang-common-objects NO_SOURCE ) endif() diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index 26ab139094..9af17b349d 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -9,9 +9,9 @@ add_custom_target( set_target_properties(all-generators PROPERTIES FOLDER generators) if(CMAKE_HOST_WIN32) - set(CMAKE_HOST_EXECUTABLE_SUFFIX ".exe") + set(CMAKE_HOST_EXECUTABLE_SUFFIX ".exe") else() - set(CMAKE_HOST_EXECUTABLE_SUFFIX "") + set(CMAKE_HOST_EXECUTABLE_SUFFIX "") endif() function(generator dir) if(SLANG_GENERATORS_PATH) @@ -44,7 +44,12 @@ function(generator dir) endif() endfunction() -generator(slang-cpp-extractor USE_FEWER_WARNINGS LINK_WITH_PRIVATE compiler-core) +generator( + slang-cpp-extractor + USE_FEWER_WARNINGS + LINK_WITH_PRIVATE + compiler-core +) generator(slang-embed) generator(slang-generate USE_FEWER_WARNINGS) generator(slang-lookup-generator LINK_WITH_PRIVATE compiler-core) @@ -52,14 +57,15 @@ generator(slang-capability-generator LINK_WITH_PRIVATE compiler-core) generator(slang-spirv-embed-generator LINK_WITH_PRIVATE compiler-core) generator( ${slang_SOURCE_DIR}/source/slangc - TARGET_NAME slang-bootstrap + TARGET_NAME + slang-bootstrap USE_FEWER_WARNINGS - LINK_WITH_PRIVATE - prelude - slang-without-embedded-core-module - slang-capability-lookup - slang-lookup-tables - Threads::Threads + LINK_WITH_PRIVATE + prelude + slang-without-embedded-core-module + slang-capability-lookup + slang-lookup-tables + Threads::Threads ) # @@ -96,10 +102,7 @@ if(SLANG_ENABLE_GFX) "$<$:-framework Cocoa>" "$<$:-framework QuartzCore>" ${CMAKE_DL_LIBS} - LINK_WITH_FRAMEWORK - Foundation - Cocoa - QuartzCore + LINK_WITH_FRAMEWORK Foundation Cocoa QuartzCore EXTRA_COMPILE_DEFINITIONS_PRIVATE $<$:SLANG_ENABLE_XLIB=1> INCLUDE_FROM_PRIVATE gfx @@ -121,11 +124,7 @@ if(SLANG_ENABLE_GFX) metal-cpp $<$:X11::X11> $<$:CUDA::cuda_driver> - LINK_WITH_FRAMEWORK - Foundation - Cocoa - QuartzCore - Metal + LINK_WITH_FRAMEWORK Foundation Cocoa QuartzCore Metal EXTRA_COMPILE_DEFINITIONS_PRIVATE $<$:GFX_ENABLE_CUDA> $<$:GFX_OPTIX> @@ -136,7 +135,9 @@ if(SLANG_ENABLE_GFX) EXPORT_MACRO_PREFIX SLANG_GFX # slang-gfx is in this directory, anything which depends on gfx should include # this - INCLUDE_DIRECTORIES_PUBLIC ${slang_SOURCE_DIR} ${slang_SOURCE_DIR}/include + INCLUDE_DIRECTORIES_PUBLIC + ${slang_SOURCE_DIR} + ${slang_SOURCE_DIR}/include REQUIRES copy-gfx-slang-modules INSTALL FOLDER gfx @@ -195,7 +196,12 @@ if(SLANG_ENABLE_TESTS) slang-test EXECUTABLE USE_FEWER_WARNINGS - LINK_WITH_PRIVATE core compiler-core slang ${CMAKE_DL_LIBS} Threads::Threads + LINK_WITH_PRIVATE + core + compiler-core + slang + ${CMAKE_DL_LIBS} + Threads::Threads REQUIRES # Shared libraries dlopened by slang-test slang-reflection-test @@ -222,14 +228,15 @@ if(SLANG_ENABLE_TESTS) add_test( NAME slang-test COMMAND - slang-test -bindir ${slang_SOURCE_DIR}/build/$/${runtime_subdir} - -expected-failure-list ${slang_SOURCE_DIR}/tests/expected-failure.txt + slang-test -bindir + ${slang_SOURCE_DIR}/build/$/${runtime_subdir} + -expected-failure-list + ${slang_SOURCE_DIR}/tests/expected-failure.txt -expected-failure-list ${slang_SOURCE_DIR}/tests/expected-failure-github.txt WORKING_DIRECTORY ${slang_SOURCE_DIR} ) - slang_add_target( unit-test OBJECT @@ -308,15 +315,16 @@ endif() # # slang-replay tool for replaying the record files # -if (SLANG_ENABLE_REPLAYER) +if(SLANG_ENABLE_REPLAYER) slang_add_target( slang-replay EXECUTABLE - EXTRA_SOURCE_DIRS - ${slang_SOURCE_DIR}/source/slang-record-replay/replay + EXTRA_SOURCE_DIRS + ${slang_SOURCE_DIR}/source/slang-record-replay/replay ${slang_SOURCE_DIR}/source/slang-record-replay/util LINK_WITH_PRIVATE core compiler-core slang - INCLUDE_DIRECTORIES_PUBLIC ${slang_SOURCE_DIR}/source/slang-record-replay + INCLUDE_DIRECTORIES_PUBLIC + ${slang_SOURCE_DIR}/source/slang-record-replay FOLDER test ) endif()