Skip to content

Commit

Permalink
[ESIMD] Refactor vc-intrinsics build for easier sync with custom buil…
Browse files Browse the repository at this point in the history
…ds. (#4879)

Signed-off-by: Konstantin S Bobrovsky <[email protected]>
  • Loading branch information
kbobrovs authored Nov 3, 2021
1 parent 89b19c0 commit 35ccdd5
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions llvm/lib/SYCLLowerIR/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,33 +12,33 @@ endif()
# NOTE: could have been added earlier from llvm/projects
if (NOT TARGET LLVMGenXIntrinsics)
if (NOT DEFINED LLVMGenXIntrinsics_SOURCE_DIR)
message(STATUS "vc-intrinsics are missing. Will try to download them from github.com")

set( LLVMGenXIntrinsics_GIT_TAG dpcpp_staging )
set(LLVMGenXIntrinsics_GIT_REPO https://github.com/intel/vc-intrinsics.git)
set(LLVMGenXIntrinsics_GIT_TAG dpcpp_staging)

message(STATUS "vc-intrinsics repo is missing. Will try to download it from ${LLVMGenXIntrinsics_GIT_REPO}")
include(FetchContent)
FetchContent_Declare(vc-intrinsics
GIT_REPOSITORY https://github.com/intel/vc-intrinsics.git
GIT_REPOSITORY ${LLVMGenXIntrinsics_GIT_REPO}
GIT_TAG ${LLVMGenXIntrinsics_GIT_TAG}
)
FetchContent_MakeAvailable(vc-intrinsics)
FetchContent_GetProperties(vc-intrinsics)

set(LLVMGenXIntrinsics_SOURCE_DIR ${vc-intrinsics_SOURCE_DIR})
set(LLVMGenXIntrinsics_BINARY_DIR ${vc-intrinsics_BINARY_DIR})
else()
else (NOT DEFINED LLVMGenXIntrinsics_SOURCE_DIR)
# -DLLVMGenXIntrinsics_SOURCE_DIR is provided
message(STATUS "vc-intrinsics are added manually ${LLVMGenXIntrinsics_SOURCE_DIR}")

set(LLVMGenXIntrinsics_BINARY_DIR ${CMAKE_BINARY_DIR}/vc-intrinsics-build)
add_subdirectory(${LLVMGenXIntrinsics_SOURCE_DIR} ${LLVMGenXIntrinsics_BINARY_DIR})
endif()
endif (NOT DEFINED LLVMGenXIntrinsics_SOURCE_DIR)

target_include_directories(LLVMGenXIntrinsics
PUBLIC $<BUILD_INTERFACE:${LLVMGenXIntrinsics_SOURCE_DIR}/GenXIntrinsics/include>
PUBLIC $<BUILD_INTERFACE:${LLVMGenXIntrinsics_BINARY_DIR}/GenXIntrinsics/include>
)
endif()
endif (NOT TARGET LLVMGenXIntrinsics)

set_property(GLOBAL PROPERTY LLVMGenXIntrinsics_SOURCE_PROP ${LLVMGenXIntrinsics_SOURCE_DIR})
set_property(GLOBAL PROPERTY LLVMGenXIntrinsics_BINARY_PROP ${LLVMGenXIntrinsics_BINARY_DIR})
Expand Down

0 comments on commit 35ccdd5

Please sign in to comment.