BUILD_COVERAGE doesn't work out-of-the box on Ubuntu 22.10 with gcc 12.2.0
- Dominant language
- C++
- Stars
- 72
- Forks
- 14
- PR merge metrics
- No merged PRs in 30d
Description
I'm running Ubuntu 22.10 with qt6-base and libspdlog-dev installed, running `cmake .. -DBUILD_TESTING=ON -DBUILD_COVERAGE=ON` runs fine, but running `make` afterwards (gcc version 12.2.0 (Ubuntu 12.2.0-3ubuntu1) ) returns
```
[ 0%] Built target qspdlog_interface
[ 5%] Automatic MOC and UIC for target qspdlog_lib
[ 5%] Built target qspdlog_lib_autogen
[ 11%] Automatic RCC for qspdlog_resources.qrc
[ 16%] Building CXX object src/CMakeFiles/qspdlog_lib.dir/qspdlog_lib_autogen/mocs_compilation.cpp.o
c++: error: unrecognized command-line option ‘-fprofile-instr-generate’; did you mean ‘-fprofile-generate’?
c++: error: unrecognized command-line option ‘-fcoverage-mapping’
make[2]: *** [src/CMakeFiles/qspdlog_lib.dir/build.make:88: src/CMakeFiles/qspdlog_lib.dir/qspdlog_lib_autogen/mocs_compilation.cpp.o] Fehler 1
make[1]: *** [CMakeFiles/Makefile2:182: src/CMakeFiles/qspdlog_lib.dir/all] Fehler 2
make: *** [Makefile:101: all] Fehler 2
```
_Originally posted by @Overflwn in https://github.com/arsdever/qspdlog/issues/32#issuecomment-1403499506_
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reproducing the shown `cmake .. -DBUILD_TESTING=ON -DBUILD_COVERAGE=ON` and `make` commands on Ubuntu 22.10 with GCC 12.2.0, then inspect the CMake configuration that adds the coverage flags. Done means the project builds successfully with `BUILD_COVERAGE=ON` using this compiler.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cmake, cpp
- Domain
- build-system, testing
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100