← All tasks
cppjrouwe/JoltPhysics #1211Not a task: already works

Error when generating build files for Ninja and clang-cl

envgap__jrouwe__JoltPhysics-1211

01 / FAILURE SIGNATURE

As reported upstream

CMake Error: No output files for WriteBuild! called with comment: Additional output files.
Not a benchmark task.
  • The project already builds and runs before the fix, so there is nothing to repair.

02 / ENVIRONMENT RECIPE

Base commit
308dd5779af4da355f9ba9eff8fe8f583b799cc4
Manifest
Build/CMakeLists.txt
Reproduce
Awaiting issue-specific recipe
Run under trace
Awaiting a meaningful runtime command

03 / ORIGINAL ISSUE TEXT

jrouwe/JoltPhysics #1211 · read the original issue
I'm still trying to figure out exactly what's going on, and it's not impossible that this actually is a bug in CMake, but it seems that #1206 broke something.



If you open up Visual Studio's "x64 Native Tools Command Prompt" and run this inside the `Build` folder:



```sh

cmake -S . -B Ninja_ClangCL -G "Ninja Multi-Config" -DCMAKE_MAKE_PROGRAM=C:/Path/To/ninja.exe -DCMAKE_CXX_COMPILER=clang-cl

```



You'll be met with this:



```

-- The CXX compiler identification is Clang 16.0.4 with MSVC-like command-line

-- Detecting CXX compiler ABI info

-- Detecting CXX compiler ABI info - done

-- Check for working CXX compiler: C:/Path/To/clang-cl.exe - skipped

-- Detecting CXX compile features

-- Detecting CXX compile features - done

-- Configuring done (1.2s)

CMake Error: No output files for WriteBuild! called with comment: Additional output files.

CMake Error: No output files for WriteBuild! called with comment: Additional output files.

-- Generating done (0.5s)

CMake Generate step failed.  Build files cannot be regenerated correctly.

```



Which seems to be caused by this:



https://github.com/jrouwe/JoltPhysics/blob/308dd5779af4da355f9ba9eff8fe8f583b799cc4/Build/CMakeLists.txt#L317



... and this:



https://github.com/jrouwe/JoltPhysics/blob/308dd5779af4da355f9ba9eff8fe8f583b799cc4/Jolt/Jolt.cmake#L504



More specifically the fact that these effectively evaluate to `target_precompile_headers(... PRIVATE "")` for the `ReleaseCoverage` configuration, and CMake doesn't seem to like that empty string there for some reason.



This works just fine with Ninja+MSVC though, so I feel like this is probably a CMake bug, but whatever is to blame it's proving to be a showstopper for me updating Jolt.



EDIT: I just realized that `ReleaseCoverage` configuration isn't present when using MSVC, so I guess that might explain the discrepancy, but things do seem to work fine on Linux with Ninja+Clang, which should have that configuration, so something odd is going on anyway.
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
[]