xmake-io / xmake

🔥 A cross-platform build utility based on Lua
https://xmake.io
Apache License 2.0
10.05k stars 787 forks source link

compile unchanged pch in every build on Linux. #4134

Closed 1821746019 closed 1 year ago

1821746019 commented 1 year ago

Xmake Version

xmake v2.8.2+20230828

Operating System Version and Architecture

Linux Mint 21.2

Describe Bug

compile unchanged pch in every build on Linux.

Expected Behavior

compile pch only when it is changed.

Project Configuration

-- includes("xmake/*.lua")
function commonCfg()
    add_rules("mode.debug", "mode.releasedbg")
    set_languages("c++23")
    set_runtimes("MD")
    set_policy("build.c++.modules", false)
    add_rules("plugin.vsxmake.autoupdate", "plugin.compile_commands.autoupdate")
    set_warnings("all")
    add_includedirs("src")
end
function add_requiresEx(...)
    add_requires(...)
    local pkgs = {...}
    for _, v in ipairs(pkgs) do
        local space_pos = string.find(v, " ")
        if space_pos then
            v = string.sub(v, 1, space_pos - 1)
        end
        add_packages(v)
    end
end

function addQtPch()
    local pch_dir = [[/home/oem/Desktop/repository/c++/by_myself/pch/]]
    local pch_path = pch_dir .. "#Qt.Widget_pch.h"
    set_pcxxheader(pch_path)

end
commonCfg()
add_requiresEx("ffmpeg 5.1.2")
target("SpeedPlayer")
    add_rules("qt.widgetapp")
    add_headerfiles("src/*.h")
    add_files("src/*.cpp")
    add_files("src/mainwindow.ui")
    -- add files with Q_OBJECT meta (only for qt.moc)
    add_files("src/mainwindow.h")
    add_frameworks("QtNetwork","QtQml")
    addQtPch()

Additional Information and Error Logs

oem@braveSugar-LinuxMint:~/Desktop/vsCode/#xmake/SpeedPlayer$ xmake -rvD
checking for gcc ... /usr/bin/gcc
checkinfo: cannot runv(zig version), No such file or directory
checking for zig ... no
checkinfo: cannot runv(zig version), No such file or directory
checking for zig ... no
checking for unzip ... /usr/bin/unzip
checking for git ... /usr/bin/git
checking for gzip ... /usr/bin/gzip
checking for tar ... /usr/bin/tar
/usr/bin/git rev-parse HEAD
checking for yasm ... no
finding ffmpeg from xmake ..
checking for xmake::ffmpeg ... ffmpeg 5.1.2
checking for Qt SDK directory ... /home/oem/Qt5.14.2/5.14.2/gcc_64
checking for Qt SDK version ... 5.14.2
checking for gcc ... /usr/bin/gcc
checking for the c++ compiler (cxx) ... gcc
checking for /usr/bin/gcc ... ok
checking for flags (-fPIC) ... ok
> gcc "-fPIC" "-m64"
checking for flags (-fvisibility-inlines-hidden) ... ok
> gcc "-fvisibility-inlines-hidden" "-m64"
checking for flags (-O0) ... ok
> gcc "-O0" "-m64"
checking for flags (-std=c++23) ... ok
> gcc "-std=c++23" "-m64"
checking for flags (-fPIC) ... ok
> gcc "-fPIC" "-m64"
[  0%]: cache compiling.debug /home/oem/Desktop/repository/c++/by_myself/pch/#Qt.Widget_pch.h
/usr/bin/gcc -c -m64 -g -Wall -O0 -std=c++23 -Isrc -I/home/oem/Desktop/vsCode/#xmake/SpeedPlayer/build/.gens/SpeedPlayer/linux/x86_64/debug/rules/qt/ui -DQT_QML_DEBUG -DQT_DEPRECATED_WARNINGS -DQT_NETWORK_LIB -DQT_QML_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -DQT_CORE_LIB -I build/.objs/SpeedPlayer/linux/x86_64/debug/home/oem/Desktop/repository/c++/by_myself/pch/cxx -isystem /home/oem/Qt5.14.2/5.14.2/gcc_64/include/QtNetwork -isystem /home/oem/Qt5.14.2/5.14.2/gcc_64/include/QtNetwork/5.14.2 -isystem /home/oem/Qt5.14.2/5.14.2/gcc_64/include/QtNetwork/5.14.2/QtNetwork -isystem /home/oem/Qt5.14.2/5.14.2/gcc_64/include/QtQml -isystem /home/oem/Qt5.14.2/5.14.2/gcc_64/include/QtQml/5.14.2 -isystem /home/oem/Qt5.14.2/5.14.2/gcc_64/include/QtQml/5.14.2/QtQml -isystem /home/oem/Qt5.14.2/5.14.2/gcc_64/include/QtGui -isystem /home/oem/Qt5.14.2/5.14.2/gcc_64/include/QtGui/5.14.2 -isystem /home/oem/Qt5.14.2/5.14.2/gcc_64/include/QtGui/5.14.2/QtGui -isystem /home/oem/Qt5.14.2/5.14.2/gcc_64/include/QtWidgets -isystem /home/oem/Qt5.14.2/5.14.2/gcc_64/include/QtWidgets/5.14.2 -isystem /home/oem/Qt5.14.2/5.14.2/gcc_64/include/QtWidgets/5.14.2/QtWidgets -isystem /home/oem/Qt5.14.2/5.14.2/gcc_64/include/QtCore -isystem /home/oem/Qt5.14.2/5.14.2/gcc_64/include/QtCore/5.14.2 -isystem /home/oem/Qt5.14.2/5.14.2/gcc_64/include/QtCore/5.14.2/QtCore -isystem /home/oem/Qt5.14.2/5.14.2/gcc_64/include -isystem /home/oem/Qt5.14.2/5.14.2/gcc_64/mkspecs/linux-g++ -isystem /home/oem/.xmake/packages/f/ffmpeg/5.1.2/f3a3ad5b23ac4bc9b18de56d6628d565/include -fPIC -x c++-header -o build/.objs/SpeedPlayer/linux/x86_64/debug/home/oem/Desktop/repository/c++/by_myself/pch/cxx/#Qt.Widget_pch.h.gch /home/oem/Desktop/repository/c++/by_myself/pch/#Qt.Widget_pch.h
checking for flags (-MMD -MF) ... ok
> gcc "-MMD" "-MF" "/dev/null" "-m64"
checking for flags (-fdiagnostics-color=always) ... ok
> gcc "-fdiagnostics-color=always" "-m64"
[ 14%]: compiling.qt.ui src/mainwindow.ui
/home/oem/Qt5.14.2/5.14.2/gcc_64/bin/uic src/mainwindow.ui -o build/.gens/SpeedPlayer/linux/x86_64/debug/rules/qt/ui/ui_mainwindow.h
[ 28%]: compiling.qt.moc src/mainwindow.h
/home/oem/Qt5.14.2/5.14.2/gcc_64/bin/moc -DQT_QML_DEBUG -DQT_DEPRECATED_WARNINGS -DQT_NETWORK_LIB -DQT_QML_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -DQT_CORE_LIB -Isrc -I/home/oem/Desktop/vsCode/#xmake/SpeedPlayer/build/.gens/SpeedPlayer/linux/x86_64/debug/rules/qt/ui -I/home/oem/Qt5.14.2/5.14.2/gcc_64/include/QtNetwork -I/home/oem/Qt5.14.2/5.14.2/gcc_64/include/QtNetwork/5.14.2 -I/home/oem/Qt5.14.2/5.14.2/gcc_64/include/QtNetwork/5.14.2/QtNetwork -I/home/oem/Qt5.14.2/5.14.2/gcc_64/include/QtQml -I/home/oem/Qt5.14.2/5.14.2/gcc_64/include/QtQml/5.14.2 -I/home/oem/Qt5.14.2/5.14.2/gcc_64/include/QtQml/5.14.2/QtQml -I/home/oem/Qt5.14.2/5.14.2/gcc_64/include/QtGui -I/home/oem/Qt5.14.2/5.14.2/gcc_64/include/QtGui/5.14.2 -I/home/oem/Qt5.14.2/5.14.2/gcc_64/include/QtGui/5.14.2/QtGui -I/home/oem/Qt5.14.2/5.14.2/gcc_64/include/QtWidgets -I/home/oem/Qt5.14.2/5.14.2/gcc_64/include/QtWidgets/5.14.2 -I/home/oem/Qt5.14.2/5.14.2/gcc_64/include/QtWidgets/5.14.2/QtWidgets -I/home/oem/Qt5.14.2/5.14.2/gcc_64/include/QtCore -I/home/oem/Qt5.14.2/5.14.2/gcc_64/include/QtCore/5.14.2 -I/home/oem/Qt5.14.2/5.14.2/gcc_64/include/QtCore/5.14.2/QtCore -I/home/oem/Qt5.14.2/5.14.2/gcc_64/include -I/home/oem/Qt5.14.2/5.14.2/gcc_64/mkspecs/linux-g++ -I/home/oem/.xmake/packages/f/ffmpeg/5.1.2/f3a3ad5b23ac4bc9b18de56d6628d565/include src/mainwindow.h -o build/.gens/SpeedPlayer/linux/x86_64/debug/src/moc_mainwindow.cpp
/usr/bin/gcc -c -m64 -g -Wall -O0 -std=c++23 -Isrc -I/home/oem/Desktop/vsCode/#xmake/SpeedPlayer/build/.gens/SpeedPlayer/linux/x86_64/debug/rules/qt/ui -DQT_QML_DEBUG -DQT_DEPRECATED_WARNINGS -DQT_NETWORK_LIB -DQT_QML_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -DQT_CORE_LIB -include #Qt.Widget_pch.h -I build/.objs/SpeedPlayer/linux/x86_64/debug/home/oem/Desktop/repository/c++/by_myself/pch/cxx -isystem /home/oem/Qt5.14.2/5.14.2/gcc_64/include/QtNetwork -isystem /home/oem/Qt5.14.2/5.14.2/gcc_64/include/QtNetwork/5.14.2 -isystem /home/oem/Qt5.14.2/5.14.2/gcc_64/include/QtNetwork/5.14.2/QtNetwork -isystem /home/oem/Qt5.14.2/5.14.2/gcc_64/include/QtQml -isystem /home/oem/Qt5.14.2/5.14.2/gcc_64/include/QtQml/5.14.2 -isystem /home/oem/Qt5.14.2/5.14.2/gcc_64/include/QtQml/5.14.2/QtQml -isystem /home/oem/Qt5.14.2/5.14.2/gcc_64/include/QtGui -isystem /home/oem/Qt5.14.2/5.14.2/gcc_64/include/QtGui/5.14.2 -isystem /home/oem/Qt5.14.2/5.14.2/gcc_64/include/QtGui/5.14.2/QtGui -isystem /home/oem/Qt5.14.2/5.14.2/gcc_64/include/QtWidgets -isystem /home/oem/Qt5.14.2/5.14.2/gcc_64/include/QtWidgets/5.14.2 -isystem /home/oem/Qt5.14.2/5.14.2/gcc_64/include/QtWidgets/5.14.2/QtWidgets -isystem /home/oem/Qt5.14.2/5.14.2/gcc_64/include/QtCore -isystem /home/oem/Qt5.14.2/5.14.2/gcc_64/include/QtCore/5.14.2 -isystem /home/oem/Qt5.14.2/5.14.2/gcc_64/include/QtCore/5.14.2/QtCore -isystem /home/oem/Qt5.14.2/5.14.2/gcc_64/include -isystem /home/oem/Qt5.14.2/5.14.2/gcc_64/mkspecs/linux-g++ -isystem /home/oem/.xmake/packages/f/ffmpeg/5.1.2/f3a3ad5b23ac4bc9b18de56d6628d565/include -fPIC -o build/.objs/SpeedPlayer/linux/x86_64/debug/gens/src/moc_mainwindow.cpp.o build/.gens/SpeedPlayer/linux/x86_64/debug/src/moc_mainwindow.cpp
[ 42%]: cache compiling.debug src/mainwindow.cpp
/usr/bin/gcc -c -m64 -g -Wall -O0 -std=c++23 -Isrc -I/home/oem/Desktop/vsCode/#xmake/SpeedPlayer/build/.gens/SpeedPlayer/linux/x86_64/debug/rules/qt/ui -DQT_QML_DEBUG -DQT_DEPRECATED_WARNINGS -DQT_NETWORK_LIB -DQT_QML_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -DQT_CORE_LIB -include #Qt.Widget_pch.h -I build/.objs/SpeedPlayer/linux/x86_64/debug/home/oem/Desktop/repository/c++/by_myself/pch/cxx -isystem /home/oem/Qt5.14.2/5.14.2/gcc_64/include/QtNetwork -isystem /home/oem/Qt5.14.2/5.14.2/gcc_64/include/QtNetwork/5.14.2 -isystem /home/oem/Qt5.14.2/5.14.2/gcc_64/include/QtNetwork/5.14.2/QtNetwork -isystem /home/oem/Qt5.14.2/5.14.2/gcc_64/include/QtQml -isystem /home/oem/Qt5.14.2/5.14.2/gcc_64/include/QtQml/5.14.2 -isystem /home/oem/Qt5.14.2/5.14.2/gcc_64/include/QtQml/5.14.2/QtQml -isystem /home/oem/Qt5.14.2/5.14.2/gcc_64/include/QtGui -isystem /home/oem/Qt5.14.2/5.14.2/gcc_64/include/QtGui/5.14.2 -isystem /home/oem/Qt5.14.2/5.14.2/gcc_64/include/QtGui/5.14.2/QtGui -isystem /home/oem/Qt5.14.2/5.14.2/gcc_64/include/QtWidgets -isystem /home/oem/Qt5.14.2/5.14.2/gcc_64/include/QtWidgets/5.14.2 -isystem /home/oem/Qt5.14.2/5.14.2/gcc_64/include/QtWidgets/5.14.2/QtWidgets -isystem /home/oem/Qt5.14.2/5.14.2/gcc_64/include/QtCore -isystem /home/oem/Qt5.14.2/5.14.2/gcc_64/include/QtCore/5.14.2 -isystem /home/oem/Qt5.14.2/5.14.2/gcc_64/include/QtCore/5.14.2/QtCore -isystem /home/oem/Qt5.14.2/5.14.2/gcc_64/include -isystem /home/oem/Qt5.14.2/5.14.2/gcc_64/mkspecs/linux-g++ -isystem /home/oem/.xmake/packages/f/ffmpeg/5.1.2/f3a3ad5b23ac4bc9b18de56d6628d565/include -fPIC -o build/.objs/SpeedPlayer/linux/x86_64/debug/src/mainwindow.cpp.o src/mainwindow.cpp
[ 42%]: cache compiling.debug src/main.cpp
/usr/bin/gcc -c -m64 -g -Wall -O0 -std=c++23 -Isrc -I/home/oem/Desktop/vsCode/#xmake/SpeedPlayer/build/.gens/SpeedPlayer/linux/x86_64/debug/rules/qt/ui -DQT_QML_DEBUG -DQT_DEPRECATED_WARNINGS -DQT_NETWORK_LIB -DQT_QML_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -DQT_CORE_LIB -include #Qt.Widget_pch.h -I build/.objs/SpeedPlayer/linux/x86_64/debug/home/oem/Desktop/repository/c++/by_myself/pch/cxx -isystem /home/oem/Qt5.14.2/5.14.2/gcc_64/include/QtNetwork -isystem /home/oem/Qt5.14.2/5.14.2/gcc_64/include/QtNetwork/5.14.2 -isystem /home/oem/Qt5.14.2/5.14.2/gcc_64/include/QtNetwork/5.14.2/QtNetwork -isystem /home/oem/Qt5.14.2/5.14.2/gcc_64/include/QtQml -isystem /home/oem/Qt5.14.2/5.14.2/gcc_64/include/QtQml/5.14.2 -isystem /home/oem/Qt5.14.2/5.14.2/gcc_64/include/QtQml/5.14.2/QtQml -isystem /home/oem/Qt5.14.2/5.14.2/gcc_64/include/QtGui -isystem /home/oem/Qt5.14.2/5.14.2/gcc_64/include/QtGui/5.14.2 -isystem /home/oem/Qt5.14.2/5.14.2/gcc_64/include/QtGui/5.14.2/QtGui -isystem /home/oem/Qt5.14.2/5.14.2/gcc_64/include/QtWidgets -isystem /home/oem/Qt5.14.2/5.14.2/gcc_64/include/QtWidgets/5.14.2 -isystem /home/oem/Qt5.14.2/5.14.2/gcc_64/include/QtWidgets/5.14.2/QtWidgets -isystem /home/oem/Qt5.14.2/5.14.2/gcc_64/include/QtCore -isystem /home/oem/Qt5.14.2/5.14.2/gcc_64/include/QtCore/5.14.2 -isystem /home/oem/Qt5.14.2/5.14.2/gcc_64/include/QtCore/5.14.2/QtCore -isystem /home/oem/Qt5.14.2/5.14.2/gcc_64/include -isystem /home/oem/Qt5.14.2/5.14.2/gcc_64/mkspecs/linux-g++ -isystem /home/oem/.xmake/packages/f/ffmpeg/5.1.2/f3a3ad5b23ac4bc9b18de56d6628d565/include -fPIC -o build/.objs/SpeedPlayer/linux/x86_64/debug/src/main.cpp.o src/main.cpp
checking for g++ ... /usr/bin/g++
checking for the linker (ld) ... g++
checking for /usr/bin/g++ ... ok
checking for flags (-fPIC) ... ok
> g++ "-fPIC" "-m64" "-m64"
checking for flags (-Wl,-rpath=/home/oem/Qt5.14.2/5.14.2/gcc_64/lib) ... ok
> g++ "-Wl,-rpath=/home/oem/Qt5.14.2/5.14.2/gcc_64/lib" "-m64" "-m64"
checking for flags (-Wl,-Bsymbolic) ... ok
> g++ "-Wl,-Bsymbolic" "-m64" "-m64"
[ 71%]: linking.debug SpeedPlayer
/usr/bin/g++ -o build/linux/x86_64/debug/SpeedPlayer build/.objs/SpeedPlayer/linux/x86_64/debug/src/mainwindow.cpp.o build/.objs/SpeedPlayer/linux/x86_64/debug/src/main.cpp.o build/.objs/SpeedPlayer/linux/x86_64/debug/gens/src/moc_mainwindow.cpp.o -m64 -L/home/oem/Qt5.14.2/5.14.2/gcc_64/lib -L/home/oem/.xmake/packages/f/ffmpeg/5.1.2/f3a3ad5b23ac4bc9b18de56d6628d565/lib -Wl,-rpath=/home/oem/Qt5.14.2/5.14.2/gcc_64/lib -lavfilter -lavdevice -lavformat -lavcodec -lswscale -lswresample -lavutil -lQt5Network -lQt5Qml -lQt5Gui -lQt5Widgets -lQt5Core -lqtlibpng -lpthread -Wl,-Bsymbolic

build cache stats:
cache directory: build/.build_cache
cache hit rate: 0%
cache hit: 0
cache miss: 0
new cached files: 0
remote cache hit: 0
remote new cached files: 0
preprocess failed: 3
compile fallback count: 0

create ok!
compile_commands.json updated!
[100%]: build ok, spent 10.214s
warning: : target(SpeedPlayer) maybe is not compatible with license(GPL-3.0) of package(ffmpeg), 
you can use set_license()/set_policy() to modify/disable license!
oem@braveSugar-LinuxMint:~/Desktop/vsCode/#xmake/SpeedPlayer$ xmake -vD
[  0%]: cache compiling.debug /home/oem/Desktop/repository/c++/by_myself/pch/#Qt.Widget_pch.h
/usr/bin/gcc -c -m64 -g -Wall -O0 -std=c++23 -Isrc -I/home/oem/Desktop/vsCode/#xmake/SpeedPlayer/build/.gens/SpeedPlayer/linux/x86_64/debug/rules/qt/ui -DQT_QML_DEBUG -DQT_DEPRECATED_WARNINGS -DQT_NETWORK_LIB -DQT_QML_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -DQT_CORE_LIB -I build/.objs/SpeedPlayer/linux/x86_64/debug/home/oem/Desktop/repository/c++/by_myself/pch/cxx -isystem /home/oem/Qt5.14.2/5.14.2/gcc_64/include/QtNetwork -isystem /home/oem/Qt5.14.2/5.14.2/gcc_64/include/QtNetwork/5.14.2 -isystem /home/oem/Qt5.14.2/5.14.2/gcc_64/include/QtNetwork/5.14.2/QtNetwork -isystem /home/oem/Qt5.14.2/5.14.2/gcc_64/include/QtQml -isystem /home/oem/Qt5.14.2/5.14.2/gcc_64/include/QtQml/5.14.2 -isystem /home/oem/Qt5.14.2/5.14.2/gcc_64/include/QtQml/5.14.2/QtQml -isystem /home/oem/Qt5.14.2/5.14.2/gcc_64/include/QtGui -isystem /home/oem/Qt5.14.2/5.14.2/gcc_64/include/QtGui/5.14.2 -isystem /home/oem/Qt5.14.2/5.14.2/gcc_64/include/QtGui/5.14.2/QtGui -isystem /home/oem/Qt5.14.2/5.14.2/gcc_64/include/QtWidgets -isystem /home/oem/Qt5.14.2/5.14.2/gcc_64/include/QtWidgets/5.14.2 -isystem /home/oem/Qt5.14.2/5.14.2/gcc_64/include/QtWidgets/5.14.2/QtWidgets -isystem /home/oem/Qt5.14.2/5.14.2/gcc_64/include/QtCore -isystem /home/oem/Qt5.14.2/5.14.2/gcc_64/include/QtCore/5.14.2 -isystem /home/oem/Qt5.14.2/5.14.2/gcc_64/include/QtCore/5.14.2/QtCore -isystem /home/oem/Qt5.14.2/5.14.2/gcc_64/include -isystem /home/oem/Qt5.14.2/5.14.2/gcc_64/mkspecs/linux-g++ -isystem /home/oem/.xmake/packages/f/ffmpeg/5.1.2/f3a3ad5b23ac4bc9b18de56d6628d565/include -fPIC -x c++-header -o build/.objs/SpeedPlayer/linux/x86_64/debug/home/oem/Desktop/repository/c++/by_myself/pch/cxx/#Qt.Widget_pch.h.gch /home/oem/Desktop/repository/c++/by_myself/pch/#Qt.Widget_pch.h
[ 42%]: cache compiling.debug src/mainwindow.cpp
/usr/bin/gcc -c -m64 -g -Wall -O0 -std=c++23 -Isrc -I/home/oem/Desktop/vsCode/#xmake/SpeedPlayer/build/.gens/SpeedPlayer/linux/x86_64/debug/rules/qt/ui -DQT_QML_DEBUG -DQT_DEPRECATED_WARNINGS -DQT_NETWORK_LIB -DQT_QML_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -DQT_CORE_LIB -include #Qt.Widget_pch.h -I build/.objs/SpeedPlayer/linux/x86_64/debug/home/oem/Desktop/repository/c++/by_myself/pch/cxx -isystem /home/oem/Qt5.14.2/5.14.2/gcc_64/include/QtNetwork -isystem /home/oem/Qt5.14.2/5.14.2/gcc_64/include/QtNetwork/5.14.2 -isystem /home/oem/Qt5.14.2/5.14.2/gcc_64/include/QtNetwork/5.14.2/QtNetwork -isystem /home/oem/Qt5.14.2/5.14.2/gcc_64/include/QtQml -isystem /home/oem/Qt5.14.2/5.14.2/gcc_64/include/QtQml/5.14.2 -isystem /home/oem/Qt5.14.2/5.14.2/gcc_64/include/QtQml/5.14.2/QtQml -isystem /home/oem/Qt5.14.2/5.14.2/gcc_64/include/QtGui -isystem /home/oem/Qt5.14.2/5.14.2/gcc_64/include/QtGui/5.14.2 -isystem /home/oem/Qt5.14.2/5.14.2/gcc_64/include/QtGui/5.14.2/QtGui -isystem /home/oem/Qt5.14.2/5.14.2/gcc_64/include/QtWidgets -isystem /home/oem/Qt5.14.2/5.14.2/gcc_64/include/QtWidgets/5.14.2 -isystem /home/oem/Qt5.14.2/5.14.2/gcc_64/include/QtWidgets/5.14.2/QtWidgets -isystem /home/oem/Qt5.14.2/5.14.2/gcc_64/include/QtCore -isystem /home/oem/Qt5.14.2/5.14.2/gcc_64/include/QtCore/5.14.2 -isystem /home/oem/Qt5.14.2/5.14.2/gcc_64/include/QtCore/5.14.2/QtCore -isystem /home/oem/Qt5.14.2/5.14.2/gcc_64/include -isystem /home/oem/Qt5.14.2/5.14.2/gcc_64/mkspecs/linux-g++ -isystem /home/oem/.xmake/packages/f/ffmpeg/5.1.2/f3a3ad5b23ac4bc9b18de56d6628d565/include -fPIC -o build/.objs/SpeedPlayer/linux/x86_64/debug/src/mainwindow.cpp.o src/mainwindow.cpp
[ 42%]: cache compiling.debug src/main.cpp
/usr/bin/gcc -c -m64 -g -Wall -O0 -std=c++23 -Isrc -I/home/oem/Desktop/vsCode/#xmake/SpeedPlayer/build/.gens/SpeedPlayer/linux/x86_64/debug/rules/qt/ui -DQT_QML_DEBUG -DQT_DEPRECATED_WARNINGS -DQT_NETWORK_LIB -DQT_QML_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -DQT_CORE_LIB -include #Qt.Widget_pch.h -I build/.objs/SpeedPlayer/linux/x86_64/debug/home/oem/Desktop/repository/c++/by_myself/pch/cxx -isystem /home/oem/Qt5.14.2/5.14.2/gcc_64/include/QtNetwork -isystem /home/oem/Qt5.14.2/5.14.2/gcc_64/include/QtNetwork/5.14.2 -isystem /home/oem/Qt5.14.2/5.14.2/gcc_64/include/QtNetwork/5.14.2/QtNetwork -isystem /home/oem/Qt5.14.2/5.14.2/gcc_64/include/QtQml -isystem /home/oem/Qt5.14.2/5.14.2/gcc_64/include/QtQml/5.14.2 -isystem /home/oem/Qt5.14.2/5.14.2/gcc_64/include/QtQml/5.14.2/QtQml -isystem /home/oem/Qt5.14.2/5.14.2/gcc_64/include/QtGui -isystem /home/oem/Qt5.14.2/5.14.2/gcc_64/include/QtGui/5.14.2 -isystem /home/oem/Qt5.14.2/5.14.2/gcc_64/include/QtGui/5.14.2/QtGui -isystem /home/oem/Qt5.14.2/5.14.2/gcc_64/include/QtWidgets -isystem /home/oem/Qt5.14.2/5.14.2/gcc_64/include/QtWidgets/5.14.2 -isystem /home/oem/Qt5.14.2/5.14.2/gcc_64/include/QtWidgets/5.14.2/QtWidgets -isystem /home/oem/Qt5.14.2/5.14.2/gcc_64/include/QtCore -isystem /home/oem/Qt5.14.2/5.14.2/gcc_64/include/QtCore/5.14.2 -isystem /home/oem/Qt5.14.2/5.14.2/gcc_64/include/QtCore/5.14.2/QtCore -isystem /home/oem/Qt5.14.2/5.14.2/gcc_64/include -isystem /home/oem/Qt5.14.2/5.14.2/gcc_64/mkspecs/linux-g++ -isystem /home/oem/.xmake/packages/f/ffmpeg/5.1.2/f3a3ad5b23ac4bc9b18de56d6628d565/include -fPIC -o build/.objs/SpeedPlayer/linux/x86_64/debug/src/main.cpp.o src/main.cpp
[ 71%]: linking.debug SpeedPlayer
/usr/bin/g++ -o build/linux/x86_64/debug/SpeedPlayer build/.objs/SpeedPlayer/linux/x86_64/debug/src/mainwindow.cpp.o build/.objs/SpeedPlayer/linux/x86_64/debug/src/main.cpp.o build/.objs/SpeedPlayer/linux/x86_64/debug/gens/src/moc_mainwindow.cpp.o -m64 -L/home/oem/Qt5.14.2/5.14.2/gcc_64/lib -L/home/oem/.xmake/packages/f/ffmpeg/5.1.2/f3a3ad5b23ac4bc9b18de56d6628d565/lib -Wl,-rpath=/home/oem/Qt5.14.2/5.14.2/gcc_64/lib -lavfilter -lavdevice -lavformat -lavcodec -lswscale -lswresample -lavutil -lQt5Network -lQt5Qml -lQt5Gui -lQt5Widgets -lQt5Core -lqtlibpng -lpthread -Wl,-Bsymbolic

build cache stats:
cache directory: build/.build_cache
cache hit rate: 0%
cache hit: 0
cache miss: 0
new cached files: 0
remote cache hit: 0
remote new cached files: 0
preprocess failed: 3
compile fallback count: 0

[100%]: build ok, spent 9.037s
warning: : target(SpeedPlayer) maybe is not compatible with license(GPL-3.0) of package(ffmpeg), 
you can use set_license()/set_policy() to modify/disable license!
oem@braveSugar-LinuxMint:~/Desktop/vsCode/#xmake/SpeedPlayer$ 
waruqi commented 1 year ago

给个最小可复现的 完整工程 example

Issues-translate-bot commented 1 year ago

Bot detected the issue body's language is not English, translate it automatically.


Give a minimal reproducible complete project example

1821746019 commented 1 year ago

the project based on the qt.widgetapp . project.zip

waruqi commented 1 year ago

是因为你路径里加了 #, #Qt.Widget_pch

这会导致 gcc 生成的 .d 头文件依赖数据里面,会自动转义成 \#Qt.Widget_pch.h

build/.objs/SpeedPlayer/macosx/x86_64/release/cxx/\#Qt.Widget_pch.h.pch:   \#Qt.Widget_pch.h

xmake 里面没去处理这个转义,所以会导致 \#Qt.Widget_pch.h 这个路径一直不存在,mtime 获取总是 0,就会一直触发 changed。

刚改了下,再试试 xmake update -s dev

Issues-translate-bot commented 1 year ago

Bot detected the issue body's language is not English, translate it automatically.


It is because you added #, #Qt.Widget_pch to your path

This will cause the .d header files generated by gcc to rely on data, which will be automatically escaped into \#Qt.Widget_pch.h

build/.objs/SpeedPlayer/macosx/x86_64/release/cxx/\#Qt.Widget_pch.h.pch: \#Qt.Widget_pch.h

This escape is not handled in xmake, so the path \#Qt.Widget_pch.h will never exist, and the mtime acquisition will always be 0, which will always trigger changed.

Just changed it, try xmake update -s dev

1821746019 commented 1 year ago

fixed.