Skip to content

Commit 3b32a65

Browse files
authored
Merge pull request #1596 from ericniebler/clangd-helpers
help clangd select the correct target for deducing compiler flags for headers
2 parents 63d153f + aa63783 commit 3b32a65

6 files changed

Lines changed: 11 additions & 43 deletions

File tree

CMakeLists.txt

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,6 @@ message(STATUS "Build date : ${STDEXEC_BUILD_DATE}")
6767
message(STATUS "Build year : ${STDEXEC_BUILD_YEAR}")
6868
message(STATUS)
6969

70-
if (STDEXEC_IS_TOP_LEVEL)
71-
# Integrate with LLVM/clang tooling
72-
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/clangd_compile_info.cmake)
73-
endif()
74-
7570
# Write the version header
7671
rapids_cmake_write_version_file(include/stdexec_version_config.hpp)
7772

@@ -270,9 +265,13 @@ target_compile_options(stdexec_executable_flags INTERFACE
270265
-include stdexec/__detail/__force_include.hpp>
271266
)
272267

273-
target_compile_definitions(
274-
stdexec_executable_flags INTERFACE
275-
$<$<NOT:$<AND:$<CXX_COMPILER_ID:NVHPC>,$<COMPILE_LANGUAGE:CXX>>>:STDEXEC_ENABLE_EXTRA_TYPE_CHECKING>)
268+
if (STDEXEC_IS_TOP_LEVEL)
269+
# Integrate with LLVM/clang tooling
270+
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/clangd_compile_info.cmake)
271+
add_executable(_clangd_helper_file
272+
include/._clangd_helper_file.cpp
273+
)
274+
endif()
276275

277276
# Set up nvexec library
278277
option(STDEXEC_ENABLE_CUDA "Enable CUDA targets for non-nvc++ compilers" OFF)

examples/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ function(def_example example)
3838
endfunction()
3939

4040
set(stdexec_examples
41-
"example.clangd.helper : _clangd_helper_file.cpp"
4241
"example.hello_world : hello_world.cpp"
4342
"example.hello_coro : hello_coro.cpp"
4443
"example.scope : scope.cpp"

examples/nvexec/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ endfunction()
7676
# CPU examples
7777
###############################################################################
7878
set(nvexec_cpu_examples
79-
" example.nvexec.clangd_helper : _clangd_helper_file.cpp"
8079
"example.nvexec.maxwell_cpu_mt : maxwell_cpu_mt.cpp"
8180
"example.nvexec.maxwell_cpu_st : maxwell_cpu_st.cpp"
8281
)

examples/nvexec/_clangd_helper_file.cpp

Lines changed: 0 additions & 32 deletions
This file was deleted.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2022 NVIDIA Corporation
2+
* Copyright (c) 2025 NVIDIA Corporation
33
*
44
* Licensed under the Apache License Version 2.0 with LLVM Exceptions
55
* (the "License"); you may not use this file except in compliance with

test/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,9 @@ set_target_properties(common_test_settings PROPERTIES
7272
MSVC_DEBUG_INFORMATION_FORMAT Embedded
7373
)
7474
target_include_directories(common_test_settings INTERFACE "${CMAKE_CURRENT_LIST_DIR}")
75+
target_compile_definitions(
76+
common_test_settings INTERFACE
77+
$<$<NOT:$<AND:$<CXX_COMPILER_ID:NVHPC>,$<COMPILE_LANGUAGE:CXX>>>:STDEXEC_ENABLE_EXTRA_TYPE_CHECKING>)
7578

7679
add_executable(test.stdexec ${stdexec_test_sources})
7780
target_link_libraries(test.stdexec

0 commit comments

Comments
 (0)