Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add variables to specify the clspv and llvm dirs #743

Merged
merged 1 commit into from
Dec 9, 2019
Merged
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
2 changes: 1 addition & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ endif()

if (${AMBER_ENABLE_CLSPV})
target_include_directories(libamber PRIVATE
"${PROJECT_SOURCE_DIR}/third_party/clspv/include"
"${clspv_SOURCE_DIR}/clspv/include"
)

target_link_libraries(libamber
Expand Down
15 changes: 11 additions & 4 deletions third_party/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -131,20 +131,27 @@ if (${AMBER_ENABLE_DXC})
endif()

if (${AMBER_ENABLE_CLSPV})
set(CLSPV_LLVM_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/clspv-llvm/llvm" CACHE STRING "")
set(CLSPV_CLANG_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/clspv-llvm/clang" CACHE STRING "")
if (NOT DEFINED AMBER_CLSPV_DIR)
set(AMBER_CLSPV_DIR "${CMAKE_CURRENT_SOURCE_DIR}/clspv")
endif()
if (NOT DEFINED AMBER_CLSPV_LLVM_DIR)
set(AMBER_CLSPV_LLVM_DIR "${CMAKE_CURRENT_SOURCE_DIR}/clspv-llvm")
endif()

set(CLSPV_LLVM_SOURCE_DIR "${AMBER_CLSPV_LLVM_DIR}/llvm" CACHE STRING "")
set(CLSPV_CLANG_SOURCE_DIR "${AMBER_CLSPV_LLVM_DIR}/clang" CACHE STRING "")
set(SPIRV_HEADERS_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/spirv-headers" CACHE STRING "")
set(SPIRV_TOOLS_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/spirv-tools" CACHE STRING "")
set(LINKER_SUPPORTS_COLOR_DIAGNOSTICS 0 CACHE INTERNAL 0 FORCE)

set(LLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN ON CACHE STRING "")
set(LLVM_BUILD_STATIC ON CACHE BOOL "")
set(LLVM_BUILD_STATIC OFF CACHE BOOL "")
set(LLVM_INCLUDE_BENCHMARKS OFF CACHE BOOL "")
set(LLVM_INCLUDE_DOCS OFF CACHE BOOL "")
set(LLVM_INCLUDE_EXAMPLES OFF CACHE BOOL "")
set(LLVM_INCLUDE_GO_TESTS OFF CACHE BOOL "")
set(LLVM_INCLUDE_TESTS OFF CACHE BOOL "")
set(LLVM_INCLUDE_UTILS OFF CACHE BOOL "")

add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/clspv)
add_subdirectory(${AMBER_CLSPV_DIR} ${CMAKE_CURRENT_BINARY_DIR}/clspv)
endif()