cpp-best-practices / cpp-best-practices/cmake_template

Build in Visual Studio IDE is broken

Open
#79 4 comments 1 reaction 0 assignees View on GitHub
Dominant language
CMake
Stars
1.8k
Forks
204
PR merge metrics
No merged PRs in 30d

Description

Building intro.exe using Visual Studio IDE (17.8.5) is broken due to warnings emitted by clang-tidy and cppcheck. There are also compile errors involving `lefticus::tools`. Building on the command line using CMake seems to work.

1. clang-tidy complains about many missing includes (`misc-include-cleaner`) in `main.cpp`:
![image](https://github.com/cpp-best-practices/cmake_template/assets/5554082/b59ca82b-0053-49ee-bc9e-785a5ec16d9e)
2. The compiler (both cl and clang-cl) throws an error when attempting to add an int literal to a `lefticus::tools::uint_np8_t`:
![image](https://github.com/cpp-best-practices/cmake_template/assets/5554082/94b80e2c-0423-4e5f-8951-77f5b5dcbabf)
![image](https://github.com/cpp-best-practices/cmake_template/assets/5554082/014577de-9bf6-4539-b177-8803e2749236)
3. cppcheck issues warnings (treated as errors) when checking the constexpr tests:
![image](https://github.com/cpp-best-practices/cmake_template/assets/5554082/9dd1cbcc-1cc5-4f94-91bc-017656f0a1f1)

There are other build issues as well, such as Debug builds being broken due to the use of address sanitizer with the `-MDd` compiler option (see #59). I realize that perhaps building was intended to be done from the command line with this template (as mentioned before, command line builds seem to work), but when developing on windows being able to make use of Visual Studio for editing and running/debugging my code is important. This template should be made compatible with Visual Studio IDE builds.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.