fix: add STDEXEC_BUILD_SYSTEM_CONTEXT option and fix Conan recipe for header-only vs compiled package#1930
Open
solarispika wants to merge 2 commits intoNVIDIA:mainfrom
Open
fix: add STDEXEC_BUILD_SYSTEM_CONTEXT option and fix Conan recipe for header-only vs compiled package#1930solarispika wants to merge 2 commits intoNVIDIA:mainfrom
solarispika wants to merge 2 commits intoNVIDIA:mainfrom
Conversation
…_context system_context is an optional compiled component; defaults to OFF to match the README claim that stdexec is header-only. Users who need exec::get_system_scheduler() opt in by setting this option to ON.
…package_id - Add system_context option (default False) to reflect that stdexec is header-only by default; opt in to build the compiled system_context library - Set package_type dynamically in configure(): header-library or static-library - package_id() clears settings only when system_context=False (header-only) - Pass STDEXEC_BUILD_SYSTEM_CONTEXT to CMake based on the option - Declare system_context as a Conan component so CMakeDeps generates the STDEXEC::system_context target for consumers - test_package: conditionally link and test system_context when available
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1540
Problem
The Conan recipe had two related issues:
system_context— there was no option to skip it, even though the README says the library is header-only.package_id()calledself.info.clear()unconditionally — this treated the package as always header-only, even whensystem_context(a compiled binary) was included. Thecpp_info.libs = ["system_context"]entry was also generating an incorrect/missing CMake target.Changes
CMake (
CMakeLists.txt,test/CMakeLists.txt)STDEXEC_BUILD_SYSTEM_CONTEXToption (defaultOFF) to match the README's header-only claimsystem_contextlibrary target creation and installation inif(STDEXEC_BUILD_SYSTEM_CONTEXT)test.system_context_replaceabilitytest target in the same guardConan (
conanfile.py)system_contextoption (defaultFalse)configure()to setpackage_typedynamically ("header-library"or"static-library")package_id()to only clear settings whensystem_context=False(i.e. header-only)package_info()to declaresystem_contextas a component so CMakeDeps correctly generates theSTDEXEC::system_contextCMake targetTest package (
test_package/CMakeLists.txt,test_package/test.cpp)$<TARGET_NAME_IF_EXISTS:STDEXEC::system_context>to link conditionallyif(TARGET STDEXEC::system_context)to setSTDEXEC_TEST_SYSTEM_CONTEXTcompile definitiontest.cppselects betweenexec::get_parallel_scheduler()andexec::static_thread_poolat compile time via#ifdefTesting