-
-
Notifications
You must be signed in to change notification settings - Fork 810
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
在项目中使一些源文件不使用预编译头 #5960
Comments
Title: Make some source files in the project not use precompiled headers In what scenario do you need this function?Generally, all source files in a project will use the compiled header, but some source files do not want to be used. In VS, you can design a cpp independently without using the compiled header. I saw that xmake can set the compilation options of a single file, but I don’t know what the compilation options are without using precompiled headers, and I didn’t find any by searching the issues and communities. Describe possible solutionsCMAKE seems to be done by using SKIP_PRECOMPILE_HEADERS attached to the cpp attachment. Describe your alternativesAdd a command add_skip_pch_sources()? Other informationNo response |
/Y- 可禁用 |
/Y- can be disabled |
add_files("xxx.cpp",{cxxflags="/Y-"}),没有效果 |
add_files("xxx.cpp",{cxxflags="/Y-"}), has no effect |
这边测试可以的么,
add_rules("mode.debug", "mode.release")
target("main")
set_kind("binary")
set_languages("cxx11")
set_pcxxheader("src/header.h")
add_files("src/test7.cpp", {cxflags = "/Y-"})
add_files("src/*.cpp|test7.cpp", "src/*.c", "*.cpp")
|
Is it possible to test here?
add_rules("mode.debug", "mode.release")
target("main")
set_kind("binary")
set_languages("cxx11")
set_pcxxheader("src/header.h")
add_files("src/test7.cpp", {cxflags = "/Y-"})
add_files("src/*.cpp|test7.cpp", "src/*.c", "*.cpp")
|
看到同时有/Y- 和YU,不知道/Y-到底起效没有;我之前是通过转换成sln后,查看cpp对应属性页,发现还是使用预编译头,且对应的命令行中没找到/Y-选项。你所说明显停滞变慢了可能只是感觉,可能还需要验证下。 |
I saw /Y- and YU at the same time, and I don’t know if /Y- is effective. I checked the corresponding property page of cpp after converting it to sln, and found that the precompiled header was still used, and the corresponding command line was not found. /Y-option. The obvious stagnation and slowdown you said may just be a feeling, and it may need to be verified. |
用这个 patch 的 进程性能耗时统计特性,来提供数据验证。 xmake update -s github:xmake-io/xmake#profile test7.cpp 添加 /Y- 之后PS D:\projects\personal\xmake\tests\projects\c++\precompiled_header> $env:XMAKE_PROFILE = "perf:process"
PS D:\projects\personal\xmake\tests\projects\c++\precompiled_header> xmake -r
[ 7%]: compiling.release build\.gens\main\windows\x64\release\src\header.h
cl: 命令行 warning D9002 :忽略未知选项“-std:c++11”
[ 15%]: compiling.release src\test.c
[ 23%]: compiling.release src\test7.cpp
[ 30%]: compiling.release src\main.cpp
[ 38%]: compiling.release src\test.cpp
[ 46%]: compiling.release src\test2.cpp
[ 53%]: compiling.release src\test4.cpp
[ 61%]: compiling.release src\test5.cpp
cl: 命令行 warning D9002 :忽略未知选项“-std:c++11”
cl: 命令行 warning D9002 :忽略未知选项“-std:c++11”
[ 69%]: compiling.release src\test6.cpp
[ 76%]: compiling.release src\test8.cpp
cl: 命令行 warning D9002 :忽略未知选项“-std:c++11”
cl: 命令行 warning D9002 :忽略未知选项“-std:c++11”
cl: 命令行 warning D9002 :忽略未知选项“-std:c++11”
[ 84%]: compiling.release test3.cpp
cl: 命令行 warning D9002 :忽略未知选项“-std:c++11”
cl: 命令行 warning D9002 :忽略未知选项“-std:c++11”
cl: 命令行 warning D9002 :忽略未知选项“-std:c++11”
cl: 命令行 warning D9002 :忽略未知选项“-std:c++11”
[ 92%]: linking.release main.exe
[100%]: build ok, spent 1.765s
781.000, 22.83%, 1, C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.41.33923\bin\HostX64\x64\cl.exe -c -Yc -nologo -O2 -std:c++11 -FID:\projects\personal\xmake\tests\projects\c++\precompiled_header\build\.gens\main\windows\x64\release\src\header.h /EHsc -DNDEBUG /sourceDependencies C:\Users\WANGRU~1\AppData\Local\Temp\.xmake\241220\_4D8514E3509C42008412EAFE10550F00.json -TP -Fpbuild\.objs\main\windows\x64\release\gens\src\cxx\header.h_v143.pch -Fobuild\.objs\main\windows\x64\release\gens\src\cxx\header.h_v143.pch.obj build\.gens\main\windows\x64\release\src\header.h
657.000, 19.20%, 1, C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.41.33923\bin\HostX64\x64\cl.exe -c -nologo -O2 -std:c++11 -YuD:\projects\personal\xmake\tests\projects\c++\precompiled_header\build\.gens\main\windows\x64\release\src\header.h -FID:\projects\personal\xmake\tests\projects\c++\precompiled_header\build\.gens\main\windows\x64\release\src\header.h -Fpbuild\.objs\main\windows\x64\release\gens\src\cxx\header.h_v143.pch /EHsc -DNDEBUG /Y- /sourceDependencies C:\Users\WANGRU~1\AppData\Local\Temp\.xmake\241220\_1E184F2B5F404C408C47C48AFC7A5690.json -Fobuild\.objs\main\windows\x64\release\src\test7.cpp.obj src\test7.cpp
281.000, 8.21%, 1, C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.41.33923\bin\HostX64\x64\cl.exe -c -nologo -O2 -std:c++11 -YuD:\projects\personal\xmake\tests\projects\c++\precompiled_header\build\.gens\main\windows\x64\release\src\header.h -FID:\projects\personal\xmake\tests\projects\c++\precompiled_header\build\.gens\main\windows\x64\release\src\header.h -Fpbuild\.objs\main\windows\x64\release\gens\src\cxx\header.h_v143.pch /EHsc -DNDEBUG /sourceDependencies C:\Users\WANGRU~1\AppData\Local\Temp\.xmake\241220\_A2E0B57780E54810854D8C178438BF70.json -Fobuild\.objs\main\windows\x64\release\src\test4.cpp.obj src\test4.cpp
281.000, 8.21%, 1, C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.41.33923\bin\HostX64\x64\cl.exe -c -nologo -O2 -std:c++11 -YuD:\projects\personal\xmake\tests\projects\c++\precompiled_header\build\.gens\main\windows\x64\release\src\header.h -FID:\projects\personal\xmake\tests\projects\c++\precompiled_header\build\.gens\main\windows\x64\release\src\header.h -Fpbuild\.objs\main\windows\x64\release\gens\src\cxx\header.h_v143.pch /EHsc -DNDEBUG /sourceDependencies C:\Users\WANGRU~1\AppData\Local\Temp\.xmake\241220\_D0C5BEEAC35845308DE9E2D1B39CF680.json -Fobuild\.objs\main\windows\x64\release\src\main.cpp.obj src\main.cpp
250.000, 7.31%, 1, C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.41.33923\bin\HostX64\x64\cl.exe -c -nologo -O2 -std:c++11 -YuD:\projects\personal\xmake\tests\projects\c++\precompiled_header\build\.gens\main\windows\x64\release\src\header.h -FID:\projects\personal\xmake\tests\projects\c++\precompiled_header\build\.gens\main\windows\x64\release\src\header.h -Fpbuild\.objs\main\windows\x64\release\gens\src\cxx\header.h_v143.pch /EHsc -DNDEBUG /sourceDependencies C:\Users\WANGRU~1\AppData\Local\Temp\.xmake\241220\_0C42EC1459ED4A308E71EB1E5BED8C30.json -Fobuild\.objs\main\windows\x64\release\src\test8.cpp.obj src\test8.cpp
188.000, 5.50%, 1, C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.41.33923\bin\HostX64\x64\cl.exe -c -nologo -O2 -std:c++11 -YuD:\projects\personal\xmake\tests\projects\c++\precompiled_header\build\.gens\main\windows\x64\release\src\header.h -FID:\projects\personal\xmake\tests\projects\c++\precompiled_header\build\.gens\main\windows\x64\release\src\header.h -Fpbuild\.objs\main\windows\x64\release\gens\src\cxx\header.h_v143.pch /EHsc -DNDEBUG /sourceDependencies C:\Users\WANGRU~1\AppData\Local\Temp\.xmake\241220\_9097E1A2BA804770845450087885AD80.json -Fobuild\.objs\main\windows\x64\release\src\test2.cpp.obj src\test2.cpp
187.000, 5.47%, 1, C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.41.33923\bin\HostX64\x64\cl.exe -c -nologo -O2 -std:c++11 -YuD:\projects\personal\xmake\tests\projects\c++\precompiled_header\build\.gens\main\windows\x64\release\src\header.h -FID:\projects\personal\xmake\tests\projects\c++\precompiled_header\build\.gens\main\windows\x64\release\src\header.h -Fpbuild\.objs\main\windows\x64\release\gens\src\cxx\header.h_v143.pch /EHsc -DNDEBUG /sourceDependencies C:\Users\WANGRU~1\AppData\Local\Temp\.xmake\241220\_38035DFE971D4440808FBD9F6E5DFF80.json -Fobuild\.objs\main\windows\x64\release\src\test5.cpp.obj src\test5.cpp
172.000, 5.03%, 1, C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.41.33923\bin\HostX64\x64\cl.exe -c -nologo -O2 -std:c++11 -YuD:\projects\personal\xmake\tests\projects\c++\precompiled_header\build\.gens\main\windows\x64\release\src\header.h -FID:\projects\personal\xmake\tests\projects\c++\precompiled_header\build\.gens\main\windows\x64\release\src\header.h -Fpbuild\.objs\main\windows\x64\release\gens\src\cxx\header.h_v143.pch /EHsc -DNDEBUG /sourceDependencies C:\Users\WANGRU~1\AppData\Local\Temp\.xmake\241220\_259420B7C3C341208A2469FA0D0D7940.json -Fobuild\.objs\main\windows\x64\release\test3.cpp.obj test3.cpp
172.000, 5.03%, 1, C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.41.33923\bin\HostX64\x64\cl.exe -c -nologo -O2 -std:c++11 -YuD:\projects\personal\xmake\tests\projects\c++\precompiled_header\build\.gens\main\windows\x64\release\src\header.h -FID:\projects\personal\xmake\tests\projects\c++\precompiled_header\build\.gens\main\windows\x64\release\src\header.h -Fpbuild\.objs\main\windows\x64\release\gens\src\cxx\header.h_v143.pch /EHsc -DNDEBUG /sourceDependencies C:\Users\WANGRU~1\AppData\Local\Temp\.xmake\241220\_4DC14EA4C43D404088BF55AE66DFB650.json -Fobuild\.objs\main\windows\x64\release\src\test.cpp.obj src\test.cpp
141.000, 4.12%, 1, C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.41.33923\bin\HostX64\x64\link.exe -nologo -dynamicbase -nxcompat -machine:x64 /opt:ref /opt:icf -out:build\windows\x64\release\main.exe build\.objs\main\windows\x64\release\src\test7.cpp.obj build\.objs\main\windows\x64\release\src\main.cpp.obj build\.objs\main\windows\x64\release\src\test.cpp.obj build\.objs\main\windows\x64\release\src\test2.cpp.obj build\.objs\main\windows\x64\release\src\test4.cpp.obj build\.objs\main\windows\x64\release\src\test5.cpp.obj build\.objs\main\windows\x64\release\src\test6.cpp.obj build\.objs\main\windows\x64\release\src\test8.cpp.obj build\.objs\main\windows\x64\release\test3.cpp.obj build\.objs\main\windows\x64\release\src\test.c.obj build\.objs\main\windows\x64\release\gens\src\cxx\header.h_v143.pch.obj
140.000, 4.09%, 1, C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.41.33923\bin\HostX64\x64\cl.exe -c -nologo -O2 -std:c++11 -YuD:\projects\personal\xmake\tests\projects\c++\precompiled_header\build\.gens\main\windows\x64\release\src\header.h -FID:\projects\personal\xmake\tests\projects\c++\precompiled_header\build\.gens\main\windows\x64\release\src\header.h -Fpbuild\.objs\main\windows\x64\release\gens\src\cxx\header.h_v143.pch /EHsc -DNDEBUG /sourceDependencies C:\Users\WANGRU~1\AppData\Local\Temp\.xmake\241220\_07DB9DF1F81945608ED613C2051C1870.json -Fobuild\.objs\main\windows\x64\release\src\test6.cpp.obj src\test6.cpp
140.000, 4.09%, 1, C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.41.33923\bin\HostX64\x64\cl.exe -c -nologo -O2 /EHsc -DNDEBUG /sourceDependencies C:\Users\WANGRU~1\AppData\Local\Temp\.xmake\241220\_0E4990E10BDE41708A99EC5BB64D20F0.json -Fobuild\.objs\main\windows\x64\release\src\test.c.obj src\test.c test7.cpp 没有添加 /Y- 之前578.000, 12.98%, 1, C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.41.33923\bin\HostX64\x64\cl.exe -c -Yc -nologo -O2 -std:c++11 -FID:\projects\personal\xmake\tests\projects\c++\precompiled_header\build\.gens\main\windows\x64\release\src\header.h /EHsc -DNDEBUG /sourceDependencies C:\Users\WANGRU~1\AppData\Local\Temp\.xmake\241220\_3B76BE9739AF486080497EE6D0B261C0.json -TP -Fpbuild\.objs\main\windows\x64\release\gens\src\cxx\header.h_v143.pch -Fobuild\.objs\main\windows\x64\release\gens\src\cxx\header.h_v143.pch.obj build\.gens\main\windows\x64\release\src\header.h
407.000, 9.14%, 1, C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.41.33923\bin\HostX64\x64\cl.exe -c -nologo -O2 -std:c++11 -YuD:\projects\personal\xmake\tests\projects\c++\precompiled_header\build\.gens\main\windows\x64\release\src\header.h -FID:\projects\personal\xmake\tests\projects\c++\precompiled_header\build\.gens\main\windows\x64\release\src\header.h -Fpbuild\.objs\main\windows\x64\release\gens\src\cxx\header.h_v143.pch /EHsc -DNDEBUG /sourceDependencies C:\Users\WANGRU~1\AppData\Local\Temp\.xmake\241220\_298E8986E61D4A3083BB5FC1DBA79850.json -Fobuild\.objs\main\windows\x64\release\src\test4.cpp.obj src\test4.cpp
360.000, 8.08%, 1, C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.41.33923\bin\HostX64\x64\cl.exe -c -nologo /sourceDependencies C:\Users\WANGRU~1\AppData\Local\Temp\.xmake\241220\_BA00A7243D5E4C5080F3318D0169DF70.json -nologo -FoC:\Users\WANGRU~1\AppData\Local\Temp\.xmake\241220\_D549FF6D684C4F708A2F29E6147FE8E0 C:\Users\WANGRU~1\AppData\Local\Temp\.xmake\241220\_2A70BC855C6B47118314FA08E23BEC9B.c
344.000, 7.72%, 1, C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.41.33923\bin\HostX64\x64\cl.exe -c -nologo -O2 -std:c++11 -YuD:\projects\personal\xmake\tests\projects\c++\precompiled_header\build\.gens\main\windows\x64\release\src\header.h -FID:\projects\personal\xmake\tests\projects\c++\precompiled_header\build\.gens\main\windows\x64\release\src\header.h -Fpbuild\.objs\main\windows\x64\release\gens\src\cxx\header.h_v143.pch /EHsc -DNDEBUG /sourceDependencies C:\Users\WANGRU~1\AppData\Local\Temp\.xmake\241220\_101B4CFBFAB44B1085F7CC6ECC15B150.json -Fobuild\.objs\main\windows\x64\release\src\test5.cpp.obj src\test5.cpp
344.000, 7.72%, 1, C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.41.33923\bin\HostX64\x64\cl.exe -c -nologo -O2 -std:c++11 -YuD:\projects\personal\xmake\tests\projects\c++\precompiled_header\build\.gens\main\windows\x64\release\src\header.h -FID:\projects\personal\xmake\tests\projects\c++\precompiled_header\build\.gens\main\windows\x64\release\src\header.h -Fpbuild\.objs\main\windows\x64\release\gens\src\cxx\header.h_v143.pch /EHsc -DNDEBUG /sourceDependencies C:\Users\WANGRU~1\AppData\Local\Temp\.xmake\241220\_FFC797C49D6F4A508F1D7BF6D4AEC6C0.json -Fobuild\.objs\main\windows\x64\release\src\test2.cpp.obj src\test2.cpp
313.000, 7.03%, 1, C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.41.33923\bin\HostX64\x64\cl.exe -c -nologo -O2 -std:c++11 -YuD:\projects\personal\xmake\tests\projects\c++\precompiled_header\build\.gens\main\windows\x64\release\src\header.h -FID:\projects\personal\xmake\tests\projects\c++\precompiled_header\build\.gens\main\windows\x64\release\src\header.h -Fpbuild\.objs\main\windows\x64\release\gens\src\cxx\header.h_v143.pch /EHsc -DNDEBUG /sourceDependencies C:\Users\WANGRU~1\AppData\Local\Temp\.xmake\241220\_8C24AFC639054E3082F1430B3C96B680.json -Fobuild\.objs\main\windows\x64\release\src\main.cpp.obj src\main.cpp
312.000, 7.00%, 1, C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.41.33923\bin\HostX64\x64\cl.exe -c -FoC:\Users\WANGRU~1\AppData\Local\Temp\.xmake\241220\_83F3C06D084249708F2029E4A97B5B90.obj C:\Users\WANGRU~1\AppData\Local\Temp\.xmake\241220\_43BC133B2E03456084D41BE8340226A0.c
266.000, 5.97%, 2, where.exe nim.exe
249.000, 5.59%, 5, C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.41.33923\bin\HostX64\x64\cl.exe
235.000, 5.28%, 1, C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.41.33923\bin\HostX64\x64\cl.exe -c -nologo -O2 -std:c++11 -YuD:\projects\personal\xmake\tests\projects\c++\precompiled_header\build\.gens\main\windows\x64\release\src\header.h -FID:\projects\personal\xmake\tests\projects\c++\precompiled_header\build\.gens\main\windows\x64\release\src\header.h -Fpbuild\.objs\main\windows\x64\release\gens\src\cxx\header.h_v143.pch /EHsc -DNDEBUG /sourceDependencies C:\Users\WANGRU~1\AppData\Local\Temp\.xmake\241220\_1267EC2E4C9E4B308779107BB6CFCC90.json -Fobuild\.objs\main\windows\x64\release\src\test.cpp.obj src\test.cpp
157.000, 3.52%, 1, C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.41.33923\bin\HostX64\x64\cl.exe -c -nologo -O2 -std:c++11 -YuD:\projects\personal\xmake\tests\projects\c++\precompiled_header\build\.gens\main\windows\x64\release\src\header.h -FID:\projects\personal\xmake\tests\projects\c++\precompiled_header\build\.gens\main\windows\x64\release\src\header.h -Fpbuild\.objs\main\windows\x64\release\gens\src\cxx\header.h_v143.pch /EHsc -DNDEBUG /sourceDependencies C:\Users\WANGRU~1\AppData\Local\Temp\.xmake\241220\_4ED9DD472F564C108A48CE77C99E8E20.json -Fobuild\.objs\main\windows\x64\release\src\test8.cpp.obj src\test8.cpp
156.000, 3.50%, 1, C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.41.33923\bin\HostX64\x64\cl.exe -c -nologo -O2 -std:c++11 -YuD:\projects\personal\xmake\tests\projects\c++\precompiled_header\build\.gens\main\windows\x64\release\src\header.h -FID:\projects\personal\xmake\tests\projects\c++\precompiled_header\build\.gens\main\windows\x64\release\src\header.h -Fpbuild\.objs\main\windows\x64\release\gens\src\cxx\header.h_v143.pch /EHsc -DNDEBUG /sourceDependencies C:\Users\WANGRU~1\AppData\Local\Temp\.xmake\241220\_599A9C829DB049108497DFE01C676690.json -Fobuild\.objs\main\windows\x64\release\test3.cpp.obj test3.cpp
141.000, 3.17%, 1, C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.41.33923\bin\HostX64\x64\cl.exe -c -nologo -O2 -std:c++11 -YuD:\projects\personal\xmake\tests\projects\c++\precompiled_header\build\.gens\main\windows\x64\release\src\header.h -FID:\projects\personal\xmake\tests\projects\c++\precompiled_header\build\.gens\main\windows\x64\release\src\header.h -Fpbuild\.objs\main\windows\x64\release\gens\src\cxx\header.h_v143.pch /EHsc -DNDEBUG /sourceDependencies C:\Users\WANGRU~1\AppData\Local\Temp\.xmake\241220\_55189E9126D34E60856FF340F1BAAFB0.json -Fobuild\.objs\main\windows\x64\release\src\test6.cpp.obj src\test6.cpp
140.000, 3.14%, 1, C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.41.33923\bin\HostX64\x64\cl.exe -c -nologo -O2 -std:c++11 -YuD:\projects\personal\xmake\tests\projects\c++\precompiled_header\build\.gens\main\windows\x64\release\src\header.h -FID:\projects\personal\xmake\tests\projects\c++\precompiled_header\build\.gens\main\windows\x64\release\src\header.h -Fpbuild\.objs\main\windows\x64\release\gens\src\cxx\header.h_v143.pch /EHsc -DNDEBUG /sourceDependencies C:\Users\WANGRU~1\AppData\Local\Temp\.xmake\241220\_35803D00EF344E508F406994297EEFB0.json -Fobuild\.objs\main\windows\x64\release\src\test7.cpp.obj src\test7.cpp
140.000, 3.14%, 1, C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.41.33923\bin\HostX64\x64\link.exe -nologo -dynamicbase -nxcompat -machine:x64 /opt:ref /opt:icf -out:build\windows\x64\release\main.exe build\.objs\main\windows\x64\release\src\main.cpp.obj build\.objs\main\windows\x64\release\src\test.cpp.obj build\.objs\main\windows\x64\release\src\test2.cpp.obj build\.objs\main\windows\x64\release\src\test4.cpp.obj build\.objs\main\windows\x64\release\src\test5.cpp.obj build\.objs\main\windows\x64\release\src\test6.cpp.obj build\.objs\main\windows\x64\release\src\test7.cpp.obj build\.objs\main\windows\x64\release\src\test8.cpp.obj build\.objs\main\windows\x64\release\test3.cpp.obj build\.objs\main\windows\x64\release\src\test.c.obj build\.objs\main\windows\x64\release\gens\src\cxx\header.h_v143.pch.obj
140.000, 3.14%, 1, C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.41.33923\bin\HostX64\x64\cl.exe -c -nologo -O2 /EHsc -DNDEBUG /sourceDependencies C:\Users\WANGRU~1\AppData\Local\Temp\.xmake\241220\_A6DD26D14F004160855BC537EAE811A0.json -Fobuild\.objs\main\windows\x64\release\src\test.c.obj src\test.c
94.000, 2.11%, 1, C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.41.33923\bin\HostX64\x64\cl.exe -c -nologo /sourceDependencies C:\Users\WANGRU~1\AppData\Local\Temp\.xmake\241220\_B098962D255D492080CC2BAE33A7D830.json -nologo -FoC:\Users\WANGRU~1\AppData\Local\Temp\.xmake\241220\_D0AAB00193A14800882620E8A1026540 C:\Users\WANGRU~1\AppData\Local\Temp\.xmake\241220\_2A70BC855C6B47118314FA08E23BEC9B.cpp
47.000, 1.06%, 1, C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.41.33923\bin\HostX64\x64\link.exe -lib -out:C:\Users\WANGRU~1\AppData\Local\Temp\.xmake\241220\_B0FCE914DA564420868A4C368BDD0340.exe C:\Users\WANGRU~1\AppData\Local\Temp\.xmake\241220\_83F3C06D084249708F2029E4A97B5B90.obj 结果
可以看到, 所以,有数据验证确认,目前的配置就是生效的。 |
不要用 生成 sln 来验证,那个不支持 |
Use this patch's process performance time statistics feature to provide data verification. xmake update -s github:xmake-io/xmake#profile test7.cpp after adding /Y-PS D:\projects\personal\xmake\tests\projects\c++\precompiled_header> $env:XMAKE_PROFILE = "perf:process"
PS D:\projects\personal\xmake\tests\projects\c++\precompiled_header> xmake -r
[ 7%]: compiling.release build\.gens\main\windows\x64\release\src\header.h
cl: command line warning D9002: unknown option '-std:c++11' ignored
[15%]: compiling.release src\test.c
[23%]: compiling.release src\test7.cpp
[30%]: compiling.release src\main.cpp
[38%]: compiling.release src\test.cpp
[46%]: compiling.release src\test2.cpp
[53%]: compiling.release src\test4.cpp
[61%]: compiling.release src\test5.cpp
cl: command line warning D9002: unknown option '-std:c++11' ignored
cl: command line warning D9002: unknown option '-std:c++11' ignored
[69%]: compiling.release src\test6.cpp
[76%]: compiling.release src\test8.cpp
cl: command line warning D9002: unknown option '-std:c++11' ignored
cl: command line warning D9002: unknown option '-std:c++11' ignored
cl: command line warning D9002: unknown option '-std:c++11' ignored
[84%]: compiling.release test3.cpp
cl: command line warning D9002: unknown option '-std:c++11' ignored
cl: command line warning D9002: unknown option '-std:c++11' ignored
cl: command line warning D9002: unknown option '-std:c++11' ignored
cl: command line warning D9002: unknown option '-std:c++11' ignored
[92%]: linking.release main.exe
[100%]: build ok, spent 1.765s
781.000, 22.83%, 1, C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.41.33923\bin\HostX64\x64\cl.exe -c -Yc -nologo -O2 -std :c++11 -FID:\projects\personal\xmake\tests\projects\c++\precompiled_header\build\.gens\main\windows\x64\release\src\header.h /EHsc -DNDEBUG /sourceDependencies C:\Users\WANGRU~1\AppData\Local\Temp\.xmake\241220\_4D8514E3509C42008412EAFE10550F00.json -TP -Fpbuild\.objs\main\windows\x64\release\gens\src\cxx\header.h_v143.pch -Fobuild\.objs\main\windows\x64\release\gens\src\cxx\header.h_v143.pch.obj build\.gens\main\windows\x64\release\src\header.h
657.000, 19.20%, 1, C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.41.33923\bin\HostX64\x64\cl.exe -c -nologo -O2 -std:c ++11 -YuD:\projects\personal\xmake\tests\projects\c++\precompiled_header\build\.gens\main\windows\x64\release\src\header.h -FID:\projects\personal\xmake\tests\projects\ c++\precompiled_header\build\.gens\main\windows\x64\release\src\header.h -Fpbuild\.objs\main\windows\x64\release\gens\src\cxx\header.h_v143.pch /EHsc -DNDEBUG /Y- /sourceDependencies C:\Users\WANGRU~1\AppData\Local\Temp\.xmake\241220\_1E184F2B5F404C408C47C48AFC7A5690.json -Fobuild\.objs\main\windows\x64\release\src\test7.cpp.obj src\test7.cpp
281.000, 8.21%, 1, C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.41.33923\bin\HostX64\x64\cl.exe -c -nologo -O2 -std:c ++11 -YuD:\projects\personal\xmake\tests\projects\c++\precompiled_header\build\.gens\main\windows\x64\release\src\header.h -FID:\projects\personal\xmake\tests\projects\ c++\precompiled_header\build\.gens\main\windows\x64\release\src\header.h -Fpbuild\.objs\main\windows\x64\release\gens\src\cxx\header.h_v143.pch /EHsc -DNDEBUG /sourceDependencies C:\Users\WANGRU~1\AppData\Local\Temp\.xmake\241220\_A2E0B57780E54810854D8C178438BF70.json -Fobuild\.objs\main\windows\x64\release\src\test4.cpp.obj src\test4.cpp
281.000, 8.21%, 1, C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.41.33923\bin\HostX64\x64\cl.exe -c -nologo -O2 -std:c ++11 -YuD:\projects\personal\xmake\tests\projects\c++\precompiled_header\build\.gens\main\windows\x64\release\src\header.h -FID:\projects\personal\xmake\tests\projects\ c++\precompiled_header\build\.gens\main\windows\x64\release\src\header.h -Fpbuild\.objs\main\windows\x64\release\gens\src\cxx\header.h_v143.pch /EHsc -DNDEBUG /sourceDependencies C:\Users\WANGRU~1\AppData\Local\Temp\.xmake\241220\_D0C5BEEAC35845308DE9E2D1B39CF680.json -Fobuild\.objs\main\windows\x64\release\src\main.cpp.obj src\main.cpp
250.000, 7.31%, 1, C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.41.33923\bin\HostX64\x64\cl.exe -c -nologo -O2 -std:c ++11 -YuD:\projects\personal\xmake\tests\projects\c++\precompiled_header\build\.gens\main\windows\x64\release\src\header.h -FID:\projects\personal\xmake\tests\projects\ c++\precompiled_header\build\.gens\main\windows\x64\release\src\header.h -Fpbuild\.objs\main\windows\x64\release\gens\src\cxx\header.h_v143.pch /EHsc -DNDEBUG /sourceDependencies C:\Users\WANGRU~1\AppData\Local\Temp\.xmake\241220\_0C42EC1459ED4A308E71EB1E5BED8C30.json -Fobuild\.objs\main\windows\x64\release\src\test8.cpp.obj src\test8.cpp
188.000, 5.50%, 1, C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.41.33923\bin\HostX64\x64\cl.exe -c -nologo -O2 -std:c ++11 -YuD:\projects\personal\xmake\tests\projects\c++\precompiled_header\build\.gens\main\windows\x64\release\src\header.h -FID:\projects\personal\xmake\tests\projects\ c++\precompiled_header\build\.gens\main\windows\x64\release\src\header.h -Fpbuild\.objs\main\windows\x64\release\gens\src\cxx\header.h_v143.pch /EHsc -DNDEBUG /sourceDependencies C:\Users\WANGRU~1\AppData\Local\Temp\.xmake\241220\_9097E1A2BA804770845450087885AD80.json -Fobuild\.objs\main\windows\x64\release\src\test2.cpp.obj src\test2.cpp
187.000, 5.47%, 1, C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.41.33923\bin\HostX64\x64\cl.exe -c -nologo -O2 -std:c ++11 -YuD:\projects\personal\xmake\tests\projects\c++\precompiled_header\build\.gens\main\windows\x64\release\src\header.h -FID:\projects\personal\xmake\tests\projects\ c++\precompiled_header\build\.gens\main\windows\x64\release\src\header.h -Fpbuild\.objs\main\windows\x64\release\gens\src\cxx\header.h_v143.pch /EHsc -DNDEBUG /sourceDependencies C:\Users\WANGRU~1\AppData\Local\Temp\.xmake\241220\_38035DFE971D4440808FBD9F6E5DFF80.json -Fobuild\.objs\main\windows\x64\release\src\test5.cpp.obj src\test5.cpp
172.000, 5.03%, 1, C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.41.33923\bin\HostX64\x64\cl.exe -c -nologo -O2 -std:c ++11 -YuD:\projects\personal\xmake\tests\projects\c++\precompiled_header\build\.gens\main\windows\x64\release\src\header.h -FID:\projects\personal\xmake\tests\projects\ c++\precompiled_header\build\.gens\main\windows\x64\release\src\header.h -Fpbuild\.objs\main\windows\x64\release\gens\src\cxx\header.h_v143.pch /EHsc -DNDEBUG /sourceDependencies C:\Users\WANGRU~1\AppData\Local\Temp\.xmake\241220\_259420B7C3C341208A2469FA0D0D7940.json -Fobuild\.objs\main\windows\x64\release\test3.cpp.obj test3.cpp
172.000, 5.03%, 1, C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.41.33923\bin\HostX64\x64\cl.exe -c -nologo -O2 -std:c ++11 -YuD:\projects\personal\xmake\tests\projects\c++\precompiled_header\build\.gens\main\windows\x64\release\src\header.h -FID:\projects\personal\xmake\tests\projects\ c++\precompiled_header\build\.gens\main\windows\x64\release\src\header.h -Fpbuild\.objs\main\windows\x64\release\gens\src\cxx\header.h_v143.pch /EHsc -DNDEBUG /sourceDependencies C:\Users\WANGRU~1\AppData\Local\Temp\.xmake\241220\_4DC14EA4C43D404088BF55AE66DFB650.json -Fobuild\.objs\main\windows\x64\release\src\test.cpp.obj src\test.cpp
141.000, 4.12%, 1, C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.41.33923\bin\HostX64\x64\link.exe -nologo -dynamicbase -nxcompat -machine:x64 /opt:ref /opt:icf -out:build\windows\x64\release\main.exe build\.objs\main\windows\x64\release\src\test7.cpp.obj build\.objs\main\windows\x64\release\src\main .cpp.obj build\.objs\main\windows\x64\release\src\test.cpp.obj build\.objs\main\windows\x64\release\src\test2.cpp.obj build\.objs\main\windows\x64\release\src\test4.cpp.obj build\.objs\main\windows\x64 \release\src\test5.cpp.obj build\.objs\main\windows\x64\release\src\test6.cpp.obj build\.objs\main\windows\x64\release\src\test8.cpp.obj build\.objs\main\windows\x64 \release\test3.cpp.obj build\.objs\main\windows\x64\release\src\test.c.obj build\.objs\main\windows\x64\release\gens\src\cxx\header.h_v143.pch.obj
140.000, 4.09%, 1, C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.41.33923\bin\HostX64\x64\cl.exe -c -nologo -O2 -std:c ++11 -YuD:\projects\personal\xmake\tests\projects\c++\precompiled_header\build\.gens\main\windows\x64\release\src\header.h -FID:\projects\personal\xmake\tests\projects\ c++\precompiled_header\build\.gens\main\windows\x64\release\src\header.h -Fpbuild\.objs\main\windows\x64\release\gens\src\cxx\header.h_v143.pch /EHsc -DNDEBUG /sourceDependencies C:\Users\WANGRU~1\AppData\Local\Temp\.xmake\241220\_07DB9DF1F81945608ED613C2051C1870.json -Fobuild\.objs\main\windows\x64\release\src\test6.cpp.obj src\test6.cpp
140.000, 4.09%, 1, C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.41.33923\bin\HostX64\x64\cl.exe -c -nologo -O2 /EHsc -DNDEBUG /sourceDependencies C:\Users\WANGRU~1\AppData\Local\Temp\.xmake\241220\_0E4990E10BDE41708A99EC5BB64D20F0.json -Fobuild\.objs\main\windows\x64\release\src\test.c.obj src\test.c test7.cpp without adding /Y- before578.000, 12.98%, 1, C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.41.33923\bin\HostX64\x64\cl.exe -c -Yc -nologo -O2 -std :c++11 -FID:\projects\personal\xmake\tests\projects\c++\precompiled_header\build\.gens\main\windows\x64\release\src\header.h /EHsc -DNDEBUG /sourceDependencies C:\Users\WANGRU~1\AppData\Local\Temp\.xmake\241220\_3B76BE9739AF486080497EE6D0B261C0.json -TP -Fpbuild\.objs\main\windows\x64\release\gens\src\cxx\header.h_v143.pch -Fobuild\.objs\main\windows\x64\release\gens\src\cxx\header.h_v143.pch.obj build\.gens\main\windows\x64\release\src\header.h
407.000, 9.14%, 1, C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.41.33923\bin\HostX64\x64\cl.exe -c -nologo -O2 -std:c ++11 -YuD:\projects\personal\xmake\tests\projects\c++\precompiled_header\build\.gens\main\windows\x64\release\src\header.h -FID:\projects\personal\xmake\tests\projects\ c++\precompiled_header\build\.gens\main\windows\x64\release\src\header.h -Fpbuild\.objs\main\windows\x64\release\gens\src\cxx\header.h_v143.pch /EHsc -DNDEBUG /sourceDependencies C:\Users\WANGRU~1\AppData\Local\Temp\.xmake\241220\_298E8986E61D4A3083BB5FC1DBA79850.json -Fobuild\.objs\main\windows\x64\release\src\test4.cpp.obj src\test4.cpp
360.000, 8.08%, 1, C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.41.33923\bin\HostX64\x64\cl.exe -c -nologo /sourceDependencies C:\Users\WANGRU~1\AppData\Local\Temp\.xmake\241220\_BA00A7243D5E4C5080F3318D0169DF70.json -nologo -FoC:\Users\WANGRU~1\AppData\Local\Temp\.xmake\241220\_D549FF6D684C4F708A2F29E6147FE8E0 C:\Users\WANGRU~1\AppData\Local\Temp\.xmake\241220\_2A70BC855C6B47118314FA08E23BEC9B.c
344.000, 7.72%, 1, C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.41.33923\bin\HostX64\x64\cl.exe -c -nologo -O2 -std:c ++11 -YuD:\projects\personal\xmake\tests\projects\c++\precompiled_header\build\.gens\main\windows\x64\release\src\header.h -FID:\projects\personal\xmake\tests\projects\ c++\precompiled_header\build\.gens\main\windows\x64\release\src\header.h -Fpbuild\.objs\main\windows\x64\release\gens\src\cxx\header.h_v143.pch /EHsc -DNDEBUG /sourceDependencies C:\Users\WANGRU~1\AppData\Local\Temp\.xmake\241220\_101B4CFBFAB44B1085F7CC6ECC15B150.json -Fobuild\.objs\main\windows\x64\release\src\test5.cpp.obj src\test5.cpp
344.000, 7.72%, 1, C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.41.33923\bin\HostX64\x64\cl.exe -c -nologo -O2 -std:c ++11 -YuD:\projects\personal\xmake\tests\projects\c++\precompiled_header\build\.gens\main\windows\x64\release\src\header.h -FID:\projects\personal\xmake\tests\projects\ c++\precompiled_header\build\.gens\main\windows\x64\release\src\header.h -Fpbuild\.objs\main\windows\x64\release\gens\src\cxx\header.h_v143.pch /EHsc -DNDEBUG /sourceDependencies C:\Users\WANGRU~1\AppData\Local\Temp\.xmake\241220\_FFC797C49D6F4A508F1D7BF6D4AEC6C0.json -Fobuild\.objs\main\windows\x64\release\src\test2.cpp.obj src\test2.cpp
313.000, 7.03%, 1, C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.41.33923\bin\HostX64\x64\cl.exe -c -nologo -O2 -std:c ++11 -YuD:\projects\personal\xmake\tests\projects\c++\precompiled_header\build\.gens\main\windows\x64\release\src\header.h -FID:\projects\personal\xmake\tests\projects\ c++\precompiled_header\build\.gens\main\windows\x64\release\src\header.h -Fpbuild\.objs\main\windows\x64\release\gens\src\cxx\header.h_v143.pch /EHsc -DNDEBUG /sourceDependencies C:\Users\WANGRU~1\AppData\Local\Temp\.xmake\241220\_8C24AFC639054E3082F1430B3C96B680.json -Fobuild\.objs\main\windows\x64\release\src\main.cpp.obj src\main.cpp
312.000, 7.00%, 1, C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.41.33923\bin\HostX64\x64\cl.exe -c -FoC:\Users\WANGRU~1\AppData\Local\Temp\.xmake\241220\_83F3C06D084249708F2029E4A97B5B90.obj C:\Users\WANGRU~1\AppData\Local\Temp\.xmake\241220\_43BC133B2E03456084D41BE8340226A0.c
266.000, 5.97%, 2, where.exe nim.exe
249.000, 5.59%, 5, C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.41.33923\bin\HostX64\x64\cl.exe
235.000, 5.28%, 1, C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.41.33923\bin\HostX64\x64\cl.exe -c -nologo -O2 -std:c ++11 -YuD:\projects\personal\xmake\tests\projects\c++\precompiled_header\build\.gens\main\windows\x64\release\src\header.h -FID:\projects\personal\xmake\tests\projects\ c++\precompiled_header\build\.gens\main\windows\x64\release\src\header.h -Fpbuild\.objs\main\windows\x64\release\gens\src\cxx\header.h_v143.pch /EHsc -DNDEBUG /sourceDependencies C:\Users\WANGRU~1\AppData\Local\Temp\.xmake\241220\_1267EC2E4C9E4B308779107BB6CFCC90.json -Fobuild\.objs\main\windows\x64\release\src\test.cpp.obj src\test.cpp
157.000, 3.52%, 1, C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.41.33923\bin\HostX64\x64\cl.exe -c -nologo -O2 -std:c ++11 -YuD:\projects\personal\xmake\tests\projects\c++\precompiled_header\build\.gens\main\windows\x64\release\src\header.h -FID:\projects\personal\xmake\tests\projects\ c++\precompiled_header\build\.gens\main\windows\x64\release\src\header.h -Fpbuild\.objs\main\windows\x64\release\gens\src\cxx\header.h_v143.pch /EHsc -DNDEBUG /sourceDependencies C:\Users\WANGRU~1\AppData\Local\Temp\.xmake\241220\_4ED9DD472F564C108A48CE77C99E8E20.json -Fobuild\.objs\main\windows\x64\release\src\test8.cpp.obj src\test8.cpp
156.000, 3.50%, 1, C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.41.33923\bin\HostX64\x64\cl.exe -c -nologo -O2 -std:c ++11 -YuD:\projects\personal\xmake\tests\projects\c++\precompiled_header\build\.gens\main\windows\x64\release\src\header.h -FID:\projects\personal\xmake\tests\projects\ c++\precompiled_header\build\.gens\main\windows\x64\release\src\header.h -Fpbuild\.objs\main\windows\x64\release\gens\src\cxx\header.h_v143.pch /EHsc -DNDEBUG /sourceDependencies C:\Users\WANGRU~1\AppData\Local\Temp\.xmake\241220\_599A9C829DB049108497DFE01C676690.json -Fobuild\.objs\main\windows\x64\release\test3.cpp.obj test3.cpp
141.000, 3.17%, 1, C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.41.33923\bin\HostX64\x64\cl.exe -c -nologo -O2 -std:c ++11 -YuD:\projects\personal\xmake\tests\projects\c++\precompiled_header\build\.gens\main\windows\x64\release\src\header.h -FID:\projects\personal\xmake\tests\projects\ c++\precompiled_header\build\.gens\main\windows\x64\release\src\header.h -Fpbuild\.objs\main\windows\x64\release\gens\src\cxx\header.h_v143.pch /EHsc -DNDEBUG /sourceDependencies C:\Users\WANGRU~1\AppData\Local\Temp\.xmake\241220\_55189E9126D34E60856FF340F1BAAFB0.json -Fobuild\.objs\main\windows\x64\release\src\test6.cpp.obj src\test6.cpp
140.000, 3.14%, 1, C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.41.33923\bin\HostX64\x64\cl.exe -c -nologo -O2 -std:c ++11 -YuD:\projects\personal\xmake\tests\projects\c++\precompiled_header\build\.gens\main\windows\x64\release\src\header.h -FID:\projects\personal\xmake\tests\projects\ c++\precompiled_header\build\.gens\main\windows\x64\release\src\header.h -Fpbuild\.objs\main\windows\x64\release\gens\src\cxx\header.h_v143.pch /EHsc -DNDEBUG /sourceDependencies C:\Users\WANGRU~1\AppData\Local\Temp\.xmake\241220\_35803D00EF344E508F406994297EEFB0.json -Fobuild\.objs\main\windows\x64\release\src\test7.cpp.obj src\test7.cpp
140.000, 3.14%, 1, C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.41.33923\bin\HostX64\x64\link.exe -nologo -dynamicbase -nxcompat -machine:x64 /opt:ref /opt:icf -out:build\windows\x64\release\main.exe build\.objs\main\windows\x64\release\src\main.cpp.obj build\.objs\main\windows\x64\release\src\test .cpp.obj build\.objs\main\windows\x64\release\src\test2.cpp.obj build\.objs\main\windows\x64\release\src\test4.cpp.obj build\.objs\main\windows\x64\release\src\test5.cpp.obj build\.objs\main\windows\x64 \release\src\test6.cpp.obj build\.objs\main\windows\x64\release\src\test7.cpp.obj build\.objs\main\windows\x64\release\src\test8.cpp.obj build\.objs\main\windows\x64 \release\test3.cpp.obj build\.objs\main\windows\x64\release\src\test.c.obj build\.objs\main\windows\x64\release\gens\src\cxx\header.h_v143.pch.obj
140.000, 3.14%, 1, C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.41.33923\bin\HostX64\x64\cl.exe -c -nologo -O2 /EHsc -DNDEBUG /sourceDependencies C:\Users\WANGRU~1\AppData\Local\Temp\.xmake\241220\_A6DD26D14F004160855BC537EAE811A0.json -Fobuild\.objs\main\windows\x64\release\src\test.c.obj src\test.c
94.000, 2.11%, 1, C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.41.33923\bin\HostX64\x64\cl.exe -c -nologo /sourceDependencies C:\Users\WANGRU~1\AppData\Local\Temp\.xmake\241220\_B098962D255D492080CC2BAE33A7D830.json -nologo -FoC:\Users\WANGRU~1\AppData\Local\Temp\.xmake\241220\_D0AAB00193A14800882620E8A1026540 C:\Users\WANGRU~1\AppData\Local\Temp\.xmake\241220\_2A70BC855C6B47118314FA08E23BEC9B.cpp
47.000, 1.06%, 1, C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.41.33923\bin\HostX64\x64\link.exe -lib -out:C:\Users\WANGRU~1\AppData\Local\Temp\.xmake\241220\_B0FCE914DA564420868A4C368BDD0340.exe C:\Users\WANGRU~1\AppData\Local\Temp\.xmake\241220\_83F3C06D084249708F2029E4A97B5B90.obj result
It can be seen that after Therefore, with data verification and confirmation, the current configuration will take effect. |
Do not use generate sln for verification, that is not supported |
实测加入了/Y-后,预编译头还是起效了,
下述生成命令中/Y-已经加入
|
Actual testing shows that after adding /Y-, the precompiled header still works.
In the following generation command, /Y- has been added
|
加 但预编译确实应该已经禁用了。 |
Adding But precompilation should indeed be disabled. |
如何能够取消force include,msvc中一个cpp不使用预编译头文件时,我看他的完整编译选项中好像不会引入预编译头文件啊。
…---原始邮件---
发件人: ***@***.***>
发送时间: 2024年12月24日(周二) 上午10:02
收件人: ***@***.***>;
抄送: ***@***.***>;"State ***@***.***>;
主题: Re: [xmake-io/xmake] 在项目中使一些源文件不使用预编译头 (Issue #5960)
加 /Y- 只是禁止预编译。。force include 还是取消不掉的,不编译预编译头。。但还是会 force include src/pch.h ,你改了 pch.h ,就肯定还是会获取到改动后的 macros value
但预编译确实应该已经禁用了。
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you modified the open/close state.Message ID: ***@***.***>
|
取消不了,除非你不设置预编译 |
Cannot be canceled unless you do not set precompilation |
cmake_minimum_required(VERSION 3.5)
project("pchtest")
set_source_files_properties("src/main.cpp" PROPERTIES SKIP_PRECOMPILE_HEADERS ON)
add_executable("pchtest" "src/main.cpp")
target_precompile_headers("pchtest" PRIVATE "src/pch.h")
CMake设置SKIP_PRECOMPILE_HEADERS属性可以不强制包含预编译头文件
我感觉可以有两种方式改进,一种是像CMAKE这样,在configs上加,使得可以
add_files("xxx.cpp",{configs={"skippch"=true}})这样来取消预编译,且不强制包含。
第二种是像我开头说的那样,是否可以增加一行
add_skippch_files(“xx.cpp","xx1.cpp")
1121443108
***@***.***
…------------------ 原始邮件 ------------------
发件人: "xmake-io/xmake" ***@***.***>;
发送时间: 2024年12月24日(星期二) 中午1:50
***@***.***>;
***@***.***>;"State ***@***.***>;
主题: Re: [xmake-io/xmake] 在项目中使一些源文件不使用预编译头 (Issue #5960)
取消不了,除非你不设置预编译
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you modified the open/close state.Message ID: ***@***.***>
|
短时间内不考虑,没空支持,等后面有空了再说 |
I won’t consider it in the short term. I don’t have time to support it. I’ll talk about it later when I have time. |
你在什么场景下需要该功能?
一般项目所有源文件都会用到编译头,然而有个别源文件不想使用。在vs中,独立选中某个cpp可以设计不使用编译头。xmake我看到可以设置单个文件的编译选项,但我不知道不使用预编译头的编译选项是什么,搜索议题与社区也未发现有。
描述可能的解决方案
CMAKE中似乎是使用SKIP_PRECOMPILE_HEADERS附加到cpp附属来做的。
描述你认为的候选方案
加个命令add_skip_pch_sources()?
其他信息
No response
The text was updated successfully, but these errors were encountered: