Skip to content

Commit

Permalink
Fix cmake integration for AdaptiveCpp
Browse files Browse the repository at this point in the history
  • Loading branch information
illuhad authored and DuncanMcBain committed Oct 31, 2023
1 parent ac1beb0 commit d0d1bb5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ if (SYCL_ACADEMY_USE_ADAPTIVECPP)
"the path to the root of the chosen SYCL implementation using "
"SYCL_ACADEMY_INSTALL_ROOT=<path/to/install/root>.")
endif()
set(hipSYCL_DIR ${SYCL_ACADEMY_INSTALL_ROOT}/lib/cmake/hipSYCL)
find_package(hipSYCL CONFIG REQUIRED PATHS)
set(AdaptiveCpp_DIR ${SYCL_ACADEMY_INSTALL_ROOT}/lib/cmake/AdaptiveCpp)
find_package(AdaptiveCpp CONFIG REQUIRED PATHS)
endif()

# Exercises
Expand Down
6 changes: 4 additions & 2 deletions Code_Exercises/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@
# CMake function to build ab AdaptiveCpp configuration and create executable binaries
# from AdaptiveCpp libraries.
function( add_sycl_executable_adaptivecpp prefix source )
add_executable("${prefix}_${source}" "${source}.cpp")
target_compile_definitions("${prefix}_${source}" PUBLIC -DSYCL_LANGUAGE_VERSION=2020)
set(TARGET_NAME "${prefix}_${source}")
add_executable("${TARGET_NAME}" "${source}.cpp")
add_sycl_to_target(TARGET ${TARGET_NAME} SOURCES "${source}.cpp")

target_include_directories("${prefix}_${source}" PRIVATE
${PROJECT_SOURCE_DIR}/Utilities/include
${PROJECT_SOURCE_DIR}/External/stb)
Expand Down

0 comments on commit d0d1bb5

Please sign in to comment.