cpp-best-practices / gui_starter_template

A template CMake project to get you started with C++ and tooling

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

build error on OSX

ClausKlein opened this issue · comments

It seems that your CI does not test all variants?

bash-3.2$ clang-tidy --version
Homebrew LLVM version 13.0.1
  Optimized build.
  Default target: x86_64-apple-darwin21.4.0
  Host CPU: skylake
bash-3.2$ 

bash-3.2$ cmake --build --preset=linux-clang-debug --target all
CMake Error: No such build preset in /Users/clausklein/Workspace/cpp/cpp_starter_project: "linux-clang-debug"
bash-3.2$ ninja -C build                                       
ninja: Entering directory `build'
[1/13] Building CXX object src/fltk/CMakeFiles/test_fltk.dir/test_fltk.cpp.o
Checking /Users/clausklein/Workspace/cpp/cpp_starter_project/src/fltk/test_fltk.cpp ...
Checking /Users/clausklein/Workspace/cpp/cpp_starter_project/src/fltk/test_fltk.cpp: NDEBUG=1...
[2/13] Building CXX object test/CMakeFiles/relaxed_constexpr_tests.dir/constexpr_tests.cpp.o
Checking /Users/clausklein/Workspace/cpp/cpp_starter_project/test/constexpr_tests.cpp ...
Checking /Users/clausklein/Workspace/cpp/cpp_starter_project/test/constexpr_tests.cpp: CATCH_CONFIG_RUNTIME_STATIC_REQUIRE=1;NDEBUG=1...
[3/13] Building CXX object test/CMakeFiles/tests.dir/tests.cpp.o
Checking /Users/clausklein/Workspace/cpp/cpp_starter_project/test/tests.cpp ...
Checking /Users/clausklein/Workspace/cpp/cpp_starter_project/test/tests.cpp: NDEBUG=1...
[5/13] Building CXX object test/CMakeFiles/constexpr_tests.dir/constexpr_tests.cpp.o
Checking /Users/clausklein/Workspace/cpp/cpp_starter_project/test/constexpr_tests.cpp ...
Checking /Users/clausklein/Workspace/cpp/cpp_starter_project/test/constexpr_tests.cpp: NDEBUG=1...
[6/13] Building CXX object src/CMakeFiles/intro.dir/main.cpp.o
FAILED: src/CMakeFiles/intro.dir/main.cpp.o 
/usr/local/Cellar/cmake/3.23.0/bin/cmake -E __run_co_compile --launcher=/usr/local/bin/ccache --tidy="/usr/local/opt/llvm/bin/clang-tidy;-extra-arg=-Wno-unknown-warning-option;-extra-arg=-std=c++20;-warnings-as-errors=*;--extra-arg-before=--driver-mode=g++" --cppcheck="/usr/local/bin/cppcheck;--template=gcc;--enable=style,performance,warning,portability;--inline-suppr;--suppress=internalAstError;--suppress=unmatchedSuppression;--inconclusive;--std=c++20;--error-exitcode=2" --source=/Users/clausklein/Workspace/cpp/cpp_starter_project/src/main.cpp -- /usr/local/opt/llvm/bin/clang++ -DFMT_HEADER_ONLY=1 -DSPDLOG_FMT_EXTERNAL -I/Users/clausklein/Workspace/cpp/cpp_starter_project/build/configured_files/include -isystem /Users/clausklein/.conan/data/docopt.cpp/0.6.3/_/_/package/7468abe1f1eb06df52d12480f8484579d06c14e7/include -isystem /Users/clausklein/.conan/data/fmt/8.1.1/_/_/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/include -isystem /Users/clausklein/.conan/data/spdlog/1.9.2/_/_/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/include -O2 -g -DNDEBUG -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk -fcolor-diagnostics -fsanitize=address,undefined -Wall -Wextra -Wshadow -Wnon-virtual-dtor -Wold-style-cast -Wcast-align -Wunused -Woverloaded-virtual -Wpedantic -Wconversion -Wsign-conversion -Wnull-dereference -Wdouble-promotion -Wformat=2 -Wimplicit-fallthrough -Werror -std=c++20 -MD -MT src/CMakeFiles/intro.dir/main.cpp.o -MF src/CMakeFiles/intro.dir/main.cpp.o.d -o src/CMakeFiles/intro.dir/main.cpp.o -c /Users/clausklein/Workspace/cpp/cpp_starter_project/src/main.cpp
/Users/clausklein/Workspace/cpp/cpp_starter_project/src/main.cpp:30:5: error: an exception may be thrown in function 'main' which should not throw exceptions [bugprone-exception-escape,-warnings-as-errors]
int main(int argc, const char **argv)
    ^
97409 warnings generated.
Suppressed 97408 warnings (97408 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
1 warning treated as error
[7/13] Building CXX object src/sdl/CMakeFiles/sdl-example.dir/main.cpp.o
FAILED: src/sdl/CMakeFiles/sdl-example.dir/main.cpp.o 
/usr/local/Cellar/cmake/3.23.0/bin/cmake -E __run_co_compile --launcher=/usr/local/bin/ccache --tidy="/usr/local/opt/llvm/bin/clang-tidy;-extra-arg=-Wno-unknown-warning-option;-extra-arg=-std=c++20;-warnings-as-errors=*;--extra-arg-before=--driver-mode=g++" --cppcheck="/usr/local/bin/cppcheck;--template=gcc;--enable=style,performance,warning,portability;--inline-suppr;--suppress=internalAstError;--suppress=unmatchedSuppression;--inconclusive;--std=c++20;--error-exitcode=2" --source=/Users/clausklein/Workspace/cpp/cpp_starter_project/src/sdl/main.cpp -- /usr/local/opt/llvm/bin/clang++ -DFMT_HEADER_ONLY=1 -DSPDLOG_FMT_EXTERNAL -isystem /Users/clausklein/.conan/data/spdlog/1.9.2/_/_/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/include -isystem /Users/clausklein/.conan/data/fmt/8.1.1/_/_/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/include -isystem /Users/clausklein/.conan/data/sdl/2.0.20/_/_/package/18fda1a0ec36a22da68ed04943be2bbc81e26011/include -isystem /Users/clausklein/.conan/data/sdl/2.0.20/_/_/package/18fda1a0ec36a22da68ed04943be2bbc81e26011/include/SDL2 -isystem /Users/clausklein/.conan/data/libiconv/1.16/_/_/package/9d5dc103d27d4a9fa8487d47da91e071cfc99b66/include -O2 -g -DNDEBUG -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk -fcolor-diagnostics -Wall -Wextra -Wshadow -Wnon-virtual-dtor -Wold-style-cast -Wcast-align -Wunused -Woverloaded-virtual -Wpedantic -Wconversion -Wsign-conversion -Wnull-dereference -Wdouble-promotion -Wformat=2 -Wimplicit-fallthrough -Werror -fsanitize=address,undefined -std=c++20 -MD -MT src/sdl/CMakeFiles/sdl-example.dir/main.cpp.o -MF src/sdl/CMakeFiles/sdl-example.dir/main.cpp.o.d -o src/sdl/CMakeFiles/sdl-example.dir/main.cpp.o -c /Users/clausklein/Workspace/cpp/cpp_starter_project/src/sdl/main.cpp
/Users/clausklein/Workspace/cpp/cpp_starter_project/src/sdl/main.cpp:44:5: error: an exception may be thrown in function 'main' which should not throw exceptions [bugprone-exception-escape,-warnings-as-errors]
int main([[maybe_unused]] int argc, [[maybe_unused]] char **argv)
    ^
148092 warnings generated.
Suppressed 148101 warnings (148091 in non-user code, 10 NOLINT).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
1 warning treated as error
[8/13] Building CXX object test/CMakeFiles/catch_main.dir/catch_main.cpp.o
Checking /Users/clausklein/Workspace/cpp/cpp_starter_project/test/catch_main.cpp ...
Checking /Users/clausklein/Workspace/cpp/cpp_starter_project/test/catch_main.cpp: NDEBUG=1...
ninja: build stopped: subcommand failed.
bash-3.2$ history 5
 1439  ll
 1440  cmake -S . -B build --preset=linux-clang-debug
 1441  cmake --build --preset=linux-clang-debug --target all
 1442  ninja -C build
 1443  history 5
bash-3.2$ 

@ClausKlein It was very difficult to find a set of CI targets that worked consistently with conan and this set of GUI projects, so I filtered it down to one compiler per OS, to make sure all OSes were covered.

I'm happy to add another CI target back, if we can get that working and have more variants covered.

-- update

I'm unable to reproduce this with clang-tidy 13.0.1 locally.