Skip to content

Commit

Permalink
Add Stdexec to the build system (will be formalized later)
Browse files Browse the repository at this point in the history
  • Loading branch information
isidorostsa committed Feb 3, 2024
1 parent 9c53b99 commit 8826f04
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2196,6 +2196,9 @@ include(HPX_SetupAsio)
include(HPX_SetupAllocator)
include(HPX_SetupHwloc)

# Setup NVIDIA's stdexec
include(HPX_SetupStdexec)

# reset external source lists
add_hpx_library_sources_noglob(hpx_external)
add_hpx_library_headers_noglob(hpx_external)
Expand Down
29 changes: 29 additions & 0 deletions cmake/FindStdexec.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@

if(NOT TARGET STDEXEC::stdexec)
# print out STDEXEC_ROOT
message(STATUS "Stdexec_ROOT: ${Stdexec_ROOT}")
set(Stdexec_ROOT ${Stdexec_ROOT})

find_path(
Stdexec_INCLUDE_DIR stdexec
HINTS "${Stdexec_ROOT}" ENV STDEXEC_ROOT
PATH_SUFFIXES include
)

if (NOT Stdexec_INCLUDE_DIR)
message(FATAL_ERROR "stdexec not found")
endif()

add_library(STDEXEC::stdexec INTERFACE IMPORTED)
target_include_directories(STDEXEC::stdexec INTERFACE ${Stdexec_INCLUDE_DIR})

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(
Stdexec
REQUIRED_VARS Stdexec_INCLUDE_DIR
VERSION_VAR "1.0"
FOUND_VAR Stdexec_FOUND
)

mark_as_advanced(Stdexec_INCLUDE_DIR Stdexec_ROOT)
endif()
17 changes: 17 additions & 0 deletions cmake/HPX_SetupStdexec.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@


if(STDEXEC_ROOT AND NOT Stdexec_ROOT)
set(Stdexec_ROOT
${STDEXEC_ROOT}
CACHE PATH "STDEXEC base directory"
)
unset(STDEXEC_ROOT CACHE)
endif()

find_package(Stdexec REQUIRED)

if(NOT Stdexec_FOUND)
hpx_error(
"Stdexec could not be found, please specify Stdexec_ROOT to point to the correct location"
)
endif()

0 comments on commit 8826f04

Please sign in to comment.