Skip to content

Commit

Permalink
Remove -fsycl getting added to non-SYCL code
Browse files Browse the repository at this point in the history
  • Loading branch information
thilinarmtb committed Nov 21, 2024
1 parent 75b49c7 commit 04eb8d1
Showing 1 changed file with 3 additions and 17 deletions.
20 changes: 3 additions & 17 deletions cmake/FindDPCPP.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ find_path(
PATH_SUFFIXES
include/sycl
include/CL
include/sycl/CL
)
include/sycl/CL)

find_library(
SYCL_LIBRARIES
Expand All @@ -29,32 +28,19 @@ find_library(
/opt/intel/oneapi/compiler/latest/linux
${SYCL_ROOT}
PATH_SUFFIXES
lib
)

if(NOT DEFINED SYCL_FLAGS)
if(DEFINED ENV{SYCL_FLAGS})
set(SYCL_FLAGS $ENV{SYCL_FLAGS})
else()
set(SYCL_FLAGS -fsycl)
endif()
endif()
lib)

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(
DPCPP
REQUIRED_VARS
SYCL_INCLUDE_DIRS
SYCL_LIBRARIES
SYCL_FLAGS
)
SYCL_LIBRARIES)

if(DPCPP_FOUND AND NOT TARGET OCCA::depends::DPCPP)
# Create our wrapper imported target
# Put it in the OCCA namespace to make it clear that we created it.
add_library(OCCA::depends::DPCPP INTERFACE IMPORTED)
separate_arguments(SYCL_FLAGS UNIX_COMMAND "${SYCL_FLAGS}")
target_compile_options(OCCA::depends::DPCPP INTERFACE ${SYCL_FLAGS})
set_target_properties(OCCA::depends::DPCPP PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${SYCL_INCLUDE_DIRS}"
INTERFACE_LINK_LIBRARIES "${SYCL_LIBRARIES}"
Expand Down

0 comments on commit 04eb8d1

Please sign in to comment.