Hi guys,
I compiled CMake (cloned from GitLab) on FreeBSD-12.1-RELEASE and got a broken ninja file. Here is the CMakeLists.txt:
cmake_minimum_required(VERSION 3.16)
project(NinjaOmitLocalOutputTest)
add_library(foo foo.cpp)
The command cmake -G ninja --debug-trycompile
produces the following output:
debug trycompile on
-- The C compiler identification is Clang 8.0.1
-- The CXX compiler identification is Clang 8.0.1
-- Detecting C compiler ABI info
CMake Error:
Running
'/home/hsebert/local/bin/ninja' '-C' '/usr/home/hsebert/Documents/cmake_test/build.broken/CMakeFiles/CMakeTmp' '-t' 'cleandead'
failed with:
ninja: error: build.ninja:120: unknown target 'all'
default all
^ near here
<snip>
Looking into the respective build.ninja
file, I found this:
#############################################
# Folder: /home/hsebert/Documents/cmake_test/build.broken/CMakeFiles/CMakeTmp
build /home/hsebert/Documents/cmake_test/build.broken/CMakeFiles/CMakeTmp/all: phony /home/hsebert/Documents/cmake_test/build.broken/CMakeFiles/CMakeTmp/cmTC_91198
which should rather be (I suppose)
#############################################
# Folder: /home/hsebert/Documents/cmake_test/build.broken/CMakeFiles/CMakeTmp
build all: phony /home/hsebert/Documents/cmake_test/build.broken/CMakeFiles/CMakeTmp/cmTC_91198
(without the path before all
).
What do you think?