← All tasks
cppjbeder/yaml-cpp #1463Not a task: already works

Globs trigger unnecessary CMake re-run when rebuilding

envgap__jbeder__yaml-cpp-1463

01 / FAILURE SIGNATURE

As reported upstream

No identifying execution failure has been captured.
Not a benchmark task.
  • The project already builds and runs before the fix, so there is nothing to repair.

02 / ENVIRONMENT RECIPE

Base commit
356643ba267039367d87fa70ce3d8f87144f55e9
Manifest
CMakeLists.txt
Reproduce
Awaiting issue-specific recipe
Run under trace
Awaiting a meaningful runtime command

03 / ORIGINAL ISSUE TEXT

jbeder/yaml-cpp #1463 · read the original issue
My code uses yaml-cpp via `add_subdirectory` and I was attempting to speed-up `cmake --build . --parallel` for the case when nothing has changed.   One of the things that came up was that yaml-cpp consistently triggers a cmake re-run,

```
ninja explain: .../VerifyGlobs.cmake_force is dirty
[0/2] Re-checking globbed directories...
[1/2] Re-running CMake...
```

Would there be interest in avoiding this by eliminating the Glob?   I see #1349 , but it looks like it's over a year old without any feedback, so wanted to open up a discussion here.

```
-set(contrib-pattern "src/contrib/*.cpp")
-set(src-pattern "src/*.cpp")
-if (CMAKE_VERSION VERSION_GREATER 3.12)
-  list(INSERT contrib-pattern 0 CONFIGURE_DEPENDS)
-  list(INSERT src-pattern 0 CONFIGURE_DEPENDS)
-endif()
-
-file(GLOB yaml-cpp-contrib-sources ${contrib-pattern})
-file(GLOB yaml-cpp-sources ${src-pattern})
+set(yaml-cpp-contrib-sources
+  src/contrib/graphbuilder.cpp
+  src/contrib/graphbuilderadapter.cpp)
+
+set(yaml-cpp-sources
+  src/binary.cpp
+  src/convert.cpp
+  src/depthguard.cpp
+  src/directives.cpp
+  src/emit.cpp
+  src/emitfromevents.cpp
+  src/emitter.cpp
+  src/emitterstate.cpp
+  src/emitterutils.cpp
+  src/exceptions.cpp
+  src/exp.cpp
+  src/fptostring.cpp
+  src/memory.cpp
+  src/node.cpp
+  src/node_data.cpp
+  src/nodebuilder.cpp
+  src/nodeevents.cpp
+  src/null.cpp
+  src/ostream_wrapper.cpp
+  src/parse.cpp
+  src/parser.cpp
+  src/regex_yaml.cpp
+  src/scanner.cpp
+  src/scanscalar.cpp
+  src/scantag.cpp
+  src/scantoken.cpp
+  src/simplekey.cpp
+  src/singledocparser.cpp
+  src/stream.cpp
+  src/tag.cpp)
```
Continue on GitHub ↗

04 / LABELS

Labels from the report text only; not yet run

No supported category has been assigned.

Label rules and the text that matched
[]