-
Notifications
You must be signed in to change notification settings - Fork 66
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
Portable Executor port to Rust #532
base: main
Are you sure you want to change the base?
Changes from 14 commits
3025c98
3a964fc
2cf0ee7
6b17e1a
1518caf
32ce01c
33ab6ff
ca418b8
7aa74bc
47de5db
2cd9db2
9823b91
ac8e692
4f5362e
19505c6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,7 +24,7 @@ stlab_detect_thread_system(STLAB_DEFAULT_THREAD_SYSTEM) | |
set( STLAB_THREAD_SYSTEM ${STLAB_DEFAULT_THREAD_SYSTEM} CACHE STRING "Thread system to use (win32|pthread|pthread-emscripten|pthread-apple|none)") | ||
|
||
stlab_detect_task_system(STLAB_DEFAULT_TASK_SYSTEM) | ||
set(STLAB_TASK_SYSTEM ${STLAB_DEFAULT_TASK_SYSTEM} CACHE STRING "Task system to use (portable|libdispatch|windows).") | ||
set(STLAB_TASK_SYSTEM ${STLAB_DEFAULT_TASK_SYSTEM} CACHE STRING "Task system to use (portable|libdispatch|windows|experimental_rust).") | ||
|
||
stlab_detect_main_executor(STLAB_DEFAULT_MAIN_EXECUTOR) | ||
set(STLAB_MAIN_EXECUTOR ${STLAB_DEFAULT_MAIN_EXECUTOR} CACHE STRING "Main executor to use (qt5|qt6|libdispatch|emscripten|none).") | ||
|
@@ -91,6 +91,10 @@ if (STLAB_TASK_SYSTEM STREQUAL "libdispatch") | |
target_link_libraries(stlab INTERFACE libdispatch::libdispatch) | ||
endif() | ||
|
||
if (STLAB_TASK_SYSTEM STREQUAL "experimental_rust") | ||
add_subdirectory( rustport ) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we maybe call this directory just |
||
endif() | ||
|
||
if (STLAB_MAIN_EXECUTOR STREQUAL "libdispatch") | ||
target_link_libraries(stlab INTERFACE libdispatch::libdispatch) | ||
elseif (STLAB_MAIN_EXECUTOR STREQUAL "qt5") | ||
|
@@ -99,6 +103,7 @@ elseif (STLAB_MAIN_EXECUTOR STREQUAL "qt6") | |
target_link_libraries( stlab INTERFACE Qt6::Core ) | ||
endif() | ||
|
||
message(STATUS "stlab: Use Boost C++17 Shims: ${STLAB_USE_BOOST_CPP17_SHIMS}") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Leftover cruft? I think this variable was removed at one point. |
||
message(STATUS "stlab: Disable Coroutines: ${STLAB_DEFAULT_NO_STD_COROUTINES}") | ||
message(STATUS "stlab: Thread System: ${STLAB_THREAD_SYSTEM}") | ||
message(STATUS "stlab: Task System: ${STLAB_TASK_SYSTEM}") | ||
|
@@ -123,6 +128,10 @@ if ( BUILD_TESTING ) | |
stlab::development | ||
stlab::stlab ) | ||
|
||
if (STLAB_TASK_SYSTEM STREQUAL "experimental_rust") | ||
target_link_libraries( testing INTERFACE RustyDefaultExecutor ) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm confused that this is linked to testing instead of it being transitively brought in with |
||
endif () | ||
|
||
# | ||
# Linking to the Boost unit test framework requires an additional | ||
# preprocessor definition when the unit test compiled resources are | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
target |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
cmake_minimum_required(VERSION 3.25) | ||
|
||
include(FetchContent) | ||
|
||
FetchContent_Declare( | ||
Corrosion | ||
GIT_REPOSITORY https://github.com/corrosion-rs/corrosion.git | ||
GIT_TAG master # Needed for experimental feature `corrosion_experimental_cbindgen`. | ||
) | ||
|
||
# Set any global configuration variables such as `Rust_TOOLCHAIN` before this line! | ||
|
||
FetchContent_MakeAvailable(Corrosion) | ||
|
||
corrosion_import_crate(MANIFEST_PATH ./Cargo.toml) | ||
|
||
corrosion_experimental_cbindgen( | ||
TARGET default_executor | ||
HEADER_NAME "bindings.h" | ||
) | ||
|
||
add_library(RustyDefaultExecutor INTERFACE) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe |
||
|
||
target_include_directories(RustyDefaultExecutor | ||
# PRIVATE | ||
# # where the library itself will look for its internal headers | ||
# ${CMAKE_CURRENT_SOURCE_DIR}/src | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The above three lines are cruft I think. |
||
INTERFACE | ||
# where top-level project will look for the library's public headers | ||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/cppshim/include> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is |
||
) | ||
|
||
target_link_libraries(RustyDefaultExecutor INTERFACE default_executor) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given that this whole library is experimental I wonder if we should call this task system
portable_rust
.