-
Notifications
You must be signed in to change notification settings - Fork 1k
Closed
Description
Description
Running CMake with Ninja as it's generator specified using the -G parameter seems to be broken, at least when used with fetch content.
Example/How to Reproduce
- Create a project with the following structure and run the following commands:
│ CMakeLists.txt
│
├───build
└───src
main.cpp
cmake_minimum_required (VERSION 3.8)
project(testproj
VERSION 1.0 DESCRIPTION "awesome"
LANGUAGES C CXX
)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
include(FetchContent)
FetchContent_Declare(cpr GIT_REPOSITORY https://github.com/libcpr/cpr.git
GIT_TAG 2553fc41450301cd09a9271c8d2c3e0cf3546b73) # The commit hash for 1.10.x. Replace with the latest from: https://github.com/libcpr/cpr/releases
FetchContent_MakeAvailable(cpr)
file(GLOB_RECURSE SOURCES "src/*.cpp")
add_executable(testproj ${SOURCES})
target_include_directories(testproj PUBLIC include)
target_link_libraries(testproj PRIVATE cpr::cpr)- Open x64 Native Tools Command Prompt for VS 2022
cd buildcmake -G "Ninja" -DCMAKE_C_COMPILER=clang-cl -DCMAKE_CXX_COMPILER=clang-cl ..ninja- Observe the wall of errors
Possible Fix
No response
Where did you get it from?
GitHub (branch e.g. master)
Additional Context/Your Environment
- OS: Windows 10 22H2
- Additional context: Clang-cl does seem to work without ninja, if you just run the command
cmake -DCMAKE_C_COMPILER=clang-cl -DCMAKE_CXX_COMPILER=clang-cl ..(this uses Visual Studio 17 2022)
Reactions are currently unavailable