Configuring with ninja fails
feldim2425 opened this issue · comments
If the Ninja generator is used on Ubuntu 20.04 (which seems to be the default in VSCode CMake Tools) the configuration and build fails:
CMake Error:
Running
'/usr/bin/ninja' '-C' '/home/michael/Prog/Cpp/AuthVaultCore/build' '-t' 'recompact'
failed with:
ninja: warning: phony target 'third_party/cryptopp/cryptest.exe' names itself as an input; ignoring [-w phonycycle=warn]
ninja: error: build.ninja:1883: multiple rules generate
third_party/cryptopp/cryptest.exe [-w dupbuild=err]
Cryptocpp is added as a submodule via git and a subdirectory in cmake
cmake_minimum_required(VERSION 3.10)
project(TestCrypto LANGUAGES CXX VERSION 0.0.1)
add_subdirectory(${CMAKE_SOURCE_DIR}/third_party/cryptopp)
add_subdirectory(${CMAKE_SOURCE_DIR}/src)
It seems like Ninja doesn't like it when the executable is renamed to .exe and added as a dependency to itself ( https://github.com/noloader/cryptopp-cmake/blob/master/CMakeLists.txt#L1054-L1061 )
PS: Removing the lines actually fixes the issue, but I don't know if that would break compatibility with other systems. I don't really know if they serve any purpose.
Removing the lines actually fixes the issue, but I don't know if that would break compatibility with other systems. I don't really know if they serve any purpose.
Not sure.
If you have a patch, then please offer it.