Open MOYUtianming opened 3 months ago
cmake version 3.30.2
CMake suite maintained and supported by Kitware (kitware.com/cmake).
[main] 正在生成文件夹: d:/workspace/reference/opensource/c_cmake_workbench/build
[main] 正在配置项目: c_cmake_workbench
[proc] 执行命令: D:/Tools/msys64/mingw64/bin/cmake.exe -DCMAKE_BUILD_TYPE:STRING=Debug -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE -DCMAKE_C_COMPILER:FILEPATH=D:/Tools/msys64/mingw64/bin/clang.exe -DCMAKE_CXX_COMPILER:FILEPATH=D:/Tools/msys64/mingw64/bin/clang++.exe --no-warn-unused-cli -SD:/workspace/reference/opensource/c_cmake_workbench -Bd:/workspace/reference/opensource/c_cmake_workbench/build -G Ninja
[cmake] Not searching for unused variables given on the command line.
[cmake] -- Configuring done (0.3s)
[cmake] -- Generating done (0.1s)
[cmake] -- Build files have been written to: D:/workspace/reference/opensource/c_cmake_workbench/build
[build] 正在启动生成
[proc] 执行命令: D:/Tools/msys64/mingw64/bin/cmake.exe --build d:/workspace/reference/opensource/c_cmake_workbench/build --config Debug --target all --
[build] [1/4 25% :: 0.172] Scanning D:/workspace/reference/opensource/c_cmake_workbench/case/general_test.cpp for CXX dependencies
[build] [2/4 50% :: 0.269] Generating CXX dyndep file case/CMakeFiles/general_test.dir/CXX.dd
[driver] 生成完毕: 00:00:00.383
[build] 生成已完成,退出代码为 0
[main] 正在生成文件夹: d:/workspace/reference/opensource/c_cmake_workbench/build
[build] 正在启动生成
[proc] 执行命令: D:/Tools/msys64/mingw64/bin/cmake.exe --build d:/workspace/reference/opensource/c_cmake_workbench/build --config Debug --target all --
[build] [1/4 25% :: 0.105] Scanning D:/workspace/reference/opensource/c_cmake_workbench/case/general_test.cpp for CXX dependencies
[build] [2/4 50% :: 0.188] Generating CXX dyndep file case/CMakeFiles/general_test.dir/CXX.dd
[build] [3/4 75% :: 0.330] Building CXX object case/CMakeFiles/general_test.dir/general_test.cpp.obj
[build] FAILED: case/CMakeFiles/general_test.dir/general_test.cpp.obj
[build] D:\Tools\msys64\mingw64\bin\g++.exe -ID:/workspace/reference/opensource/c_cmake_workbench/code/core/public -g -std=gnu++20 --save-temps -MD -MT case/CMakeFiles/general_test.dir/general_test.cpp.obj -MF case\CMakeFiles\general_test.dir\general_test.cpp.obj.d -fmodules-ts -fmodule-mapper=case\CMakeFiles\general_test.dir\general_test.cpp.obj.modmap -MD -fdeps-format=p1689r5 -x c++ -o case/CMakeFiles/general_test.dir/general_test.cpp.obj -c D:/workspace/reference/opensource/c_cmake_workbench/case/general_test.cpp
[build]
[build] Segmentation fault
[build] 4 | }
[build] | ^
[build] Please submit a full bug report, with preprocessed source (by using -freport-bug).
[build] See <https://github.com/msys2/MINGW-packages/issues> for instructions.
[build] ninja: build stopped: subcommand failed.
[proc] 命令“D:/Tools/msys64/mingw64/bin/cmake.exe --build d:/workspace/reference/opensource/c_cmake_workbench/build --config Debug --target all --”已退出,代码为 1
[driver] 生成完毕: 00:00:00.452
[build] 生成已完成,退出代码为 1
Can you provide the code and a separate compiler command to build outside of cmake?
it is the simplest code that can cause the bug, without any other dependencies;
#include<stdio.h>
intmain() {
return0;
}
g++ ../case/general_test.cpp -g -std=gnu++20 --save-temps -o general_test.bin
it works too, so this segmentation fault maybe directly related to cmake;
file name maybe need to be replaced by yourself;
At 2024-08-29 20:29:48, "Peter0x44" @.***> wrote:
Can you provide the code and a separate compiler command to build outside of cmake?
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>
MOYUtianming/problem_report (github.com)
I have support the whole project in this repository, I can repeat the bug by the following steps:
<open MINGW64;>
<cd to this project's root dir>
mkdir build
cd build
cmake ..
cmake --build .
by the way, if I use
g++ --save-temps -std=gnu++20 ../case/general_test.cpp -o ./out.bin
the outfile out.bin can be used correctly;
so this error maybe is an error of cmake?
At 2024-08-29 20:29:48, "Peter0x44" @.***> wrote:
Can you provide the code and a separate compiler command to build outside of cmake?
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>
https://github.com/MOYUtianming/problem_report the whole abnormal project.
Description / Steps to reproduce the issue
brief
and
set_target_properties(<target>PROPERTIES CXX_STANDARD 20)
can't be used at the same time when i compile with g++.
but building with clang is not matter.
version
g++ version:
clang version:
code
error message
CMakeLists.txt
main CMakeLists.txt
sub CMakeLists.txt
Expected behavior
I hope i can use gcc build code with both --save-temps and c++20 standard;
Actual behavior
I can't use --save-temps and c++20 standard at the both time when I use g++ 14.2.0
Verification
Windows Version
MINGW64_NT-10.0-22631
MINGW environments affected
Are you willing to submit a PR?
No response