Arfrever added a comment.

In `clang-tools-extra/clangd/unittests/CMakeLists.txt`, usage of 
`CompletionModel.cmake` probably also should be dependent on 
`CLANGD_DECISION_FOREST`.

In `clang-tools-extra/clangd/CMakeLists.txt` and 
`clang-tools-extra/clangd/unittests/CMakeLists.txt`, calls to 
`target_include_directories()` for directories with generated Completion Model 
headers can be also made dependent on `CLANGD_DECISION_FOREST`.

  --- clang-tools-extra/clangd/unittests/CMakeLists.txt
  +++ clang-tools-extra/clangd/unittests/CMakeLists.txt
  @@ -146,10 +146,12 @@
     omp_gen
     )
   
  -# Include generated CompletionModel headers.
  -target_include_directories(clangDaemon PUBLIC
  -  $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>
  -)
  +if(CLANGD_DECISION_FOREST)
  +  # Include generated Completion Model header.
  +  target_include_directories(clangDaemon PUBLIC
  +    $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>
  +  )
  +endif()
   
   clang_target_link_libraries(clangDaemon
     PRIVATE
  --- clang-tools-extra/clangd/unittests/CMakeLists.txt
  +++ clang-tools-extra/clangd/unittests/CMakeLists.txt
  @@ -19,8 +19,12 @@
     set(REMOTE_TEST_SOURCES remote/MarshallingTests.cpp)
   endif()
   
  -include(${CMAKE_CURRENT_SOURCE_DIR}/../quality/CompletionModel.cmake)
  -gen_decision_forest(${CMAKE_CURRENT_SOURCE_DIR}/decision_forest_model 
DecisionForestRuntimeTest ::ns1::ns2::test::Example)
  +set(DECISIONFORESTRUNTIMETEST_SOURCES)
  +if(CLANGD_DECISION_FOREST)
  +  include(${CMAKE_CURRENT_SOURCE_DIR}/../quality/CompletionModel.cmake)
  +  gen_decision_forest(${CMAKE_CURRENT_SOURCE_DIR}/decision_forest_model 
DecisionForestRuntimeTest ::ns1::ns2::test::Example)
  +  list(APPEND DECISIONFORESTRUNTIMETEST_SOURCES 
${CMAKE_CURRENT_BINARY_DIR}/DecisionForestRuntimeTest.cpp)
  +endif()
   
   add_custom_target(ClangdUnitTests)
   add_unittest(ClangdUnitTests ClangdTests
  @@ -95,7 +99,7 @@
     TypeHierarchyTests.cpp
     URITests.cpp
     XRefsTests.cpp
  -  ${CMAKE_CURRENT_BINARY_DIR}/DecisionForestRuntimeTest.cpp
  +  ${DECISIONFORESTRUNTIMETEST_SOURCES}
   
     support/CancellationTests.cpp
     support/ContextTests.cpp
  @@ -134,10 +138,12 @@
     $<TARGET_OBJECTS:obj.clangDaemonTweaks>
     )
   
  -# Include generated ComletionModel headers.
  -target_include_directories(ClangdTests PUBLIC
  -  $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>
  -)
  +if(CLANGD_DECISION_FOREST)
  +  # Include generated Completion Model header.
  +  target_include_directories(ClangdTests PUBLIC
  +    $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>
  +  )
  +endif()
   
   clang_target_link_libraries(ClangdTests
     PRIVATE


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D138520/new/

https://reviews.llvm.org/D138520

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
  • [PATCH... Michał Górny via Phabricator via cfe-commits
    • [... Michał Górny via Phabricator via cfe-commits
    • [... Sam James via Phabricator via cfe-commits
    • [... Arfrever Frehtes Taifersar Arahesis via Phabricator via cfe-commits
    • [... Sam McCall via Phabricator via cfe-commits
    • [... Michał Górny via Phabricator via cfe-commits
    • [... Sam McCall via Phabricator via cfe-commits
    • [... Michał Górny via Phabricator via cfe-commits

Reply via email to