Skip to content

Commit ca3797c

Browse files
Tim Raeclaude
andcommitted
Mark include directories as SYSTEM for consuming targets
When a project enables -Wreserved-identifier (as recommended by clang for production codebases), including stdexec headers generates >8000 warnings due to the __double_underscore naming convention used internally. These warnings are expected within stdexec itself but should not propagate to consumers. Adding SYSTEM to target_include_directories causes CMake to pass -isystem instead of -I for stdexec's include paths, suppressing warnings that originate from stdexec headers in consuming projects. This matches the convention used by other header-heavy libraries (Boost, fmt, spdlog) that use reserved identifiers internally. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 5473e9d commit ca3797c

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

CMakeLists.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,13 @@ PUBLIC
201201
FILES
202202
${CMAKE_CURRENT_BINARY_DIR}/include/stdexec_version_config.hpp
203203
)
204+
# Mark include directories as SYSTEM so consumers don't get warnings from stdexec internals
205+
target_include_directories(stdexec SYSTEM INTERFACE
206+
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
207+
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/include>
208+
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
209+
)
210+
204211
list(APPEND stdexec_export_targets stdexec)
205212

206213
# Set library version

0 commit comments

Comments
 (0)