使用 clang++ 编译 quickshell-git 失败

paru -G quickshell-git
cd quickshell-git
CC=clang CXX=clang++ makepkg -sC

错误摘要:

FAILED: [code=1] src/services/pipewire/CMakeFiles/quickshell-service-pipewire.dir/quickshell-service-pipewire_autogen/mocs_compilation.cpp.o 
/usr/bin/clang++ -DQT_CORE_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_NO_DEBUG -DQT_OPENGL_LIB -DQT_QMLINTEGRATION_LIB -DQT_QML_LIB -DQT_QUICK_LIB -D_REENTRANT -I/home/tom/.cache/paru/clone/quickshell-git/src/quickshell/build/src/services/pipewire/quickshell-service-pipewire_autogen/include -I/home/tom/.cache/paru/clone/quickshell-git/src/quickshell/src/services/pipewire -isystem /usr/include/qt6/QtQml -isystem /usr/include/qt6 -isystem /usr/include/qt6/QtCore -isystem /usr/lib/qt6/mkspecs/linux-g++ -isystem /usr/include/qt6/QtQmlIntegration -isystem /usr/include/qt6/QtNetwork -isystem /usr/include/pipewire-0.3 -isystem /usr/include/spa-0.2 -isystem /usr/include/qt6/QtQuick -isystem /usr/include/qt6/QtGui -isystem /usr/include/qt6/QtOpenGL -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions         -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security         -fstack-clash-protection -fcf-protection         -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/home/tom/.cache/paru/clone/quickshell-git/src=/usr/src/debug/quickshell-git -flto=auto -O2 -g -DNDEBUG -std=gnu++20 -Wall -Wextra -Wno-vla-cxx-extension -fno-direct-access-external-data -D_REENTRANT -fno-strict-aliasing -fno-strict-overflow -Winvalid-pch -Xclang -include-pch -Xclang /home/tom/.cache/paru/clone/quickshell-git/src/quickshell/build/CMakeFiles/qs-pchset-common.dir/cmake_pch.hxx.pch -Xclang -include -Xclang /home/tom/.cache/paru/clone/quickshell-git/src/quickshell/build/CMakeFiles/qs-pchset-common.dir/cmake_pch.hxx -MD -MT src/services/pipewire/CMakeFiles/quickshell-service-pipewire.dir/quickshell-service-pipewire_autogen/mocs_compilation.cpp.o -MF src/services/pipewire/CMakeFiles/quickshell-service-pipewire.dir/quickshell-service-pipewire_autogen/mocs_compilation.cpp.o.d -o src/services/pipewire/CMakeFiles/quickshell-service-pipewire.dir/quickshell-service-pipewire_autogen/mocs_compilation.cpp.o -c /home/tom/.cache/paru/clone/quickshell-git/src/quickshell/build/src/services/pipewire/quickshell-service-pipewire_autogen/mocs_compilation.cpp
error: signed integer overflow handling differs in precompiled file '/home/tom/.cache/paru/clone/quickshell-git/src/quickshell/build/CMakeFiles/qs-pchset-common.dir/cmake_pch.hxx.pch' vs. current file

我怎么创建不了“C++”这个标签?

看起来是标签名里不支持+字符?

1 Like


来自

尝试修改 PKGBUILD

build() {
  cd "$_pkgname"
  cmake -GNinja -B build \
    -DCMAKE_C_COMPILER=clang \
    -DCMAKE_CXX_COMPILER=clang++ \
    -DCMAKE_BUILD_TYPE="RelWithDebInfo" \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DDISTRIBUTOR="AUR (package: quickshell-git)" \
    -DDISTRIBUTOR_DEBUGINFO_AVAILABLE=NO \
    -DINSTALL_QML_PREFIX=lib/qt6/qml \
    -DNO_PCH=ON

  cmake --build build
}

添加 -DCMAKE_C_COMPILER=clang-DCMAKE_CXX_COMPILER=clang++、-DNO_PCH=ON

关掉 PCH 之后编译速度慢了好多,反而不如 gcc 划算了 :joy: (28m5s vs 13m2s)