Skip to content

[SYCL][CMake] Disable win_proxy_loader build and link on non-Windows #8520

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

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
14 changes: 11 additions & 3 deletions sycl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -314,11 +314,14 @@ add_custom_target( sycl-toolchain
DEPENDS sycl-runtime-libraries
sycl-compiler
sycl-ls
win_proxy_loader
${XPTIFW_LIBS}
COMMENT "Building SYCL compiler toolchain..."
)

if (WIN32)
add_dependencies(sycl-toolchain win_proxy_loader)
endif()

# Enable new IN_LIST operator.
cmake_policy(SET CMP0057 NEW)

Expand Down Expand Up @@ -351,7 +354,9 @@ add_subdirectory( plugins )

add_subdirectory(tools)

add_subdirectory(win_proxy_loader)
if (WIN32)
add_subdirectory(win_proxy_loader)
endif()

if(SYCL_INCLUDE_TESTS)
if(NOT LLVM_INCLUDE_TESTS)
Expand Down Expand Up @@ -395,11 +400,14 @@ set( SYCL_TOOLCHAIN_DEPLOY_COMPONENTS
sycl
libsycldevice
level-zero-sycl-dev
win_proxy_loader
${XPTIFW_LIBS}
${SYCL_TOOLCHAIN_DEPS}
)

if (WIN32)
list(APPEND SYCL_TOOLCHAIN_DEPLOY_COMPONENTS win_proxy_loader)
endif()

if (TARGET sycl-prof)
list(APPEND SYCL_TOOLCHAIN_DEPLOY_COMPONENTS sycl-prof)
endif()
Expand Down
12 changes: 7 additions & 5 deletions sycl/source/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,13 @@ function(add_sycl_rt_library LIB_NAME LIB_OBJ_NAME)
endif()

# win_proxy_loader
include_directories(${LLVM_EXTERNAL_SYCL_SOURCE_DIR}/win_proxy_loader)
if(WIN_DUPE)
target_link_libraries(${LIB_NAME} PUBLIC win_proxy_loaderd)
else()
target_link_libraries(${LIB_NAME} PUBLIC win_proxy_loader)
if (WIN32)
include_directories(${LLVM_EXTERNAL_SYCL_SOURCE_DIR}/win_proxy_loader)
if(WIN_DUPE)
target_link_libraries(${LIB_NAME} PUBLIC win_proxy_loaderd)
else()
target_link_libraries(${LIB_NAME} PUBLIC win_proxy_loader)
endif()
endif()

target_compile_definitions(${LIB_OBJ_NAME} PRIVATE __SYCL_INTERNAL_API )
Expand Down
14 changes: 5 additions & 9 deletions sycl/win_proxy_loader/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
project(win_proxy_loader)
add_library(win_proxy_loader SHARED win_proxy_loader.cpp)
if (WIN32)
install(TARGETS win_proxy_loader
RUNTIME DESTINATION "bin" COMPONENT win_proxy_loader
)
endif()
install(TARGETS win_proxy_loader
RUNTIME DESTINATION "bin" COMPONENT win_proxy_loader
)

if (MSVC)
# MSVC provides two incompatible build variants for its CRT: release and debug
Expand Down Expand Up @@ -48,10 +46,8 @@ if (MSVC)
target_compile_options(win_proxy_loader PRIVATE ${WINUNLOAD_CXX_FLAGS_RELEASE})
target_link_libraries(win_proxy_loaderd PRIVATE shlwapi)
target_link_libraries(win_proxy_loader PRIVATE shlwapi)
if (WIN32)
install(TARGETS win_proxy_loaderd
RUNTIME DESTINATION "bin" COMPONENT win_proxy_loader)
endif()
install(TARGETS win_proxy_loaderd
RUNTIME DESTINATION "bin" COMPONENT win_proxy_loader)
endif()