FrogTheFrog / moondeck-buddy

A server-side part of the MoonDeck plugin for the SteamDeck.
GNU Lesser General Public License v3.0
170 stars 10 forks source link

[Linux] Compiler errors #35

Closed loisgomez closed 1 year ago

loisgomez commented 1 year ago

Hi, thanks for the project. I am trying to get an aur package for Arch Linux for the linux build but I am facing some compiler issues when trying to build the linux version. Any pointers are appreciated Thanks

$> cmake --build build

FAILED: src/lib/shared/CMakeFiles/sharedlib.dir/sharedlib_autogen/mocs_compilation.cpp.o 
/usr/bin/cmake -E __run_co_compile --tidy="clang-tidy;--extra-arg-before=--driver-mode=g++" --source=/home/berto/Games/moondeck/moondeck-buddy/build/src/lib/shared/sharedlib_autogen/mocs_compilation.cpp -- /usr/bin/c++ -DQT_CORE_LIB -DQT_NO_DEBUG -I/home/berto/Games/moondeck/moondeck-buddy/build/src/lib/shared -I/home/berto/Games/moondeck/moondeck-buddy/src/lib/shared -I/home/berto/Games/moondeck/moondeck-buddy/build/src/lib/shared/sharedlib_autogen/include -I/home/berto/Games/moondeck/moondeck-buddy/src/lib/shared/.. -isystem /usr/include/qt6/QtCore -isystem /usr/include/qt6 -isystem /usr/lib/qt6/mkspecs/linux-g++ -O3 -DNDEBUG -std=gnu++20 -Wall -Wextra -pedantic -Werror -mno-direct-extern-access -MD -MT src/lib/shared/CMakeFiles/sharedlib.dir/sharedlib_autogen/mocs_compilation.cpp.o -MF src/lib/shared/CMakeFiles/sharedlib.dir/sharedlib_autogen/mocs_compilation.cpp.o.d -o src/lib/shared/CMakeFiles/sharedlib.dir/sharedlib_autogen/mocs_compilation.cpp.o -c /home/berto/Games/moondeck/moondeck-buddy/build/src/lib/shared/sharedlib_autogen/mocs_compilation.cpp
error: unknown argument: '-mno-direct-extern-access' [clang-diagnostic-error]
6 warnings and 1 error generated.
Error while processing /home/berto/Games/moondeck/moondeck-buddy/build/src/lib/shared/sharedlib_autogen/mocs_compilation.cpp.
Suppressed 6 warnings (6 with check filters).
Found compiler error(s).
[2/62] Building CXX object src/lib/shared/CMakeFiles/sharedlib.dir/loggingcategories.cpp.o
FAILED: src/lib/shared/CMakeFiles/sharedlib.dir/loggingcategories.cpp.o 
/usr/bin/cmake -E __run_co_compile --tidy="clang-tidy;--extra-arg-before=--driver-mode=g++" --source=/home/berto/Games/moondeck/moondeck-buddy/src/lib/shared/loggingcategories.cpp -- /usr/bin/c++ -DQT_CORE_LIB -DQT_NO_DEBUG -I/home/berto/Games/moondeck/moondeck-buddy/build/src/lib/shared -I/home/berto/Games/moondeck/moondeck-buddy/src/lib/shared -I/home/berto/Games/moondeck/moondeck-buddy/build/src/lib/shared/sharedlib_autogen/include -I/home/berto/Games/moondeck/moondeck-buddy/src/lib/shared/.. -isystem /usr/include/qt6/QtCore -isystem /usr/include/qt6 -isystem /usr/lib/qt6/mkspecs/linux-g++ -O3 -DNDEBUG -std=gnu++20 -Wall -Wextra -pedantic -Werror -mno-direct-extern-access -MD -MT src/lib/shared/CMakeFiles/sharedlib.dir/loggingcategories.cpp.o -MF src/lib/shared/CMakeFiles/sharedlib.dir/loggingcategories.cpp.o.d -o src/lib/shared/CMakeFiles/sharedlib.dir/loggingcategories.cpp.o -c /home/berto/Games/moondeck/moondeck-buddy/src/lib/shared/loggingcategories.cpp
error: unknown argument: '-mno-direct-extern-access' [clang-diagnostic-error]
54265 warnings and 1 error generated.
Error while processing /home/berto/Games/moondeck/moondeck-buddy/src/lib/shared/loggingcategories.cpp.
Suppressed 54266 warnings (54261 in non-user code, 1 NOLINT, 4 with check filters).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
Found compiler error(s).
[3/62] Building CXX object src/lib/shared/CMakeFiles/sharedlib.dir/appmetadata.cpp.o
FAILED: src/lib/shared/CMakeFiles/sharedlib.dir/appmetadata.cpp.o 
/usr/bin/cmake -E __run_co_compile --tidy="clang-tidy;--extra-arg-before=--driver-mode=g++" --source=/home/berto/Games/moondeck/moondeck-buddy/src/lib/shared/appmetadata.cpp -- /usr/bin/c++ -DQT_CORE_LIB -DQT_NO_DEBUG -I/home/berto/Games/moondeck/moondeck-buddy/build/src/lib/shared -I/home/berto/Games/moondeck/moondeck-buddy/src/lib/shared -I/home/berto/Games/moondeck/moondeck-buddy/build/src/lib/shared/sharedlib_autogen/include -I/home/berto/Games/moondeck/moondeck-buddy/src/lib/shared/.. -isystem /usr/include/qt6/QtCore -isystem /usr/include/qt6 -isystem /usr/lib/qt6/mkspecs/linux-g++ -O3 -DNDEBUG -std=gnu++20 -Wall -Wextra -pedantic -Werror -mno-direct-extern-access -MD -MT src/lib/shared/CMakeFiles/sharedlib.dir/appmetadata.cpp.o -MF src/lib/shared/CMakeFiles/sharedlib.dir/appmetadata.cpp.o.d -o src/lib/shared/CMakeFiles/sharedlib.dir/appmetadata.cpp.o -c /home/berto/Games/moondeck/moondeck-buddy/src/lib/shared/appmetadata.cpp
error: unknown argument: '-mno-direct-extern-access' [clang-diagnostic-error]
62794 warnings and 1 error generated.
Error while processing /home/berto/Games/moondeck/moondeck-buddy/src/lib/shared/appmetadata.cpp.
Suppressed 62804 warnings (62788 in non-user code, 10 NOLINT, 6 with check filters).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
Found compiler error(s).
ninja: build stopped: subcommand failed.
FrogTheFrog commented 1 year ago

At first glance it looks like clang-tidy is outdated, maybe?

You can disable it with a cmake variable (forgot how to set it myself, so no example :/): https://github.com/FrogTheFrog/moondeck-buddy/blob/ef0ceb99d6d03c3f370185d9c0c8745e8691f5b7/CMakeLists.txt#L47 (or just delete the cmake code block)

loisgomez commented 1 year ago

Thanks disabling clang_tidy did solve the issue.

cmake -DENABLE_CLANG_TIDY=False -DCMAKE_BUILD_TYPE:STRING=Release -B build -G Ninja