You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 8, 2024. It is now read-only.
$ mkdir build
$ cd build
$ cmake -GNinja ..
-- The C compiler identification is AppleClang 11.0.0.11000033
-- The CXX compiler identification is AppleClang 11.0.0.11000033
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Setting build type to 'Release' as none was specified.
-- Testing dependencies .
-- Setting up tests for production...
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/kyle/Projects/apiaryio/drafter/build
$ ninja
ninja: warning: phony target 'src/drafter' names itself as an input; ignoring [-w phonycycle=warn]
ninja: warning: multiple rules generate src/drafter. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn]
ninja: error: dependency cycle: src/drafter -> src/CMakeFiles/drafter -> src/drafter
The text was updated successfully, but these errors were encountered:
I’ve spent a bit of time on this, the underlying problem is that the drafter-cli target has an output name of drafter (the binary name is drafter). We also have a custom aggregate target called drafter which runs the targets drafter-cli, libdrafter etc at the same time.
Various package managers script (homebrew, aur, dockerfiles) use make drafter (thus this is expected and depended upon behaviour). make drafter builds everything needed for make install to work.
While this works fine with the makefile generator, under ninja both these parts cause different targets with the same name. This also results in circular reference because the drafter aggregate target which depends on drafter-cli (which ninja calls drafter). This problem manifests differently in newer versions of CMake.
The text was updated successfully, but these errors were encountered: