Replies: 1 comment 1 reply
-
|
我不知道你说的重复编译,指的是什么,增量编译失效?ccache 失效? 不管哪种,我这都正常 没法复现。 target("test")
set_kind("binary")
add_files("src/*.cpp")
on_load(function (target)
target:add("files", "test/test.cpp")
end)ruki:test ruki$ xmake
[ 19%]: cache compiling.release src/main.cpp
[ 19%]: cache compiling.release test/test.cpp
[ 56%]: linking.release test
[100%]: build ok, spent 2.295s
ruki:test ruki$ xmake <--------------- 增量编译 works,没有重编
[100%]: build ok, spent 0.031sruki:test ruki$ xmake -rvD
[ 19%]: cache compiling.release src/main.cpp
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -c -Qunused-arguments -arch x86_64 -target x86_64-apple-macos15.2 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk -fvisibility=hidden -fvisibility-inlines-hidden -O3 -DNDEBUG -o build/.objs/test/macosx/x86_64/release/src/main.cpp.o src/main.cpp
[ 19%]: cache compiling.release test/test.cpp
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -c -Qunused-arguments -arch x86_64 -target x86_64-apple-macos15.2 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk -fvisibility=hidden -fvisibility-inlines-hidden -O3 -DNDEBUG -o build/.objs/test/macosx/x86_64/release/test/test.cpp.o test/test.cpp
[ 56%]: linking.release test
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -o build/macosx/x86_64/release/test build/.objs/test/macosx/x86_64/release/src/main.cpp.o build/.objs/test/macosx/x86_64/release/test/test.cpp.o -arch x86_64 -target x86_64-apple-macos15.2 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk -lz -Wl,-x -Wl,-dead_strip
build cache stats:
cache directory: /private/tmp/test/build/.build_cache
cache hit rate: 100%
cache hit: 2 <----------------------------------- 两个 cpp 都命中了 cache,也没重编。
cache hit total time: 0.006s
cache miss: 0
cache miss total time: 0.000s
new cached files: 0
remote cache hit: 0
remote new cached files: 0
preprocess failed: 0
compile fallback count: 0
compile total time: 0.000s
[100%]: build ok, spent 0.521s |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
这个阶段根据条件添加的文件总是会重复编译,很消耗时间
尝试使用
set_policy("build.ccache", true)也不起作用Beta Was this translation helpful? Give feedback.
All reactions