← All tasks
cppgabime/spdlog #1104Not a task: already works

CMake config imposes -Wextra -Wconversion on library users

envgap__gabime__spdlog-1104

01 / FAILURE SIGNATURE

As reported upstream

No identifying execution failure has been captured.
Not a benchmark task.
  • The project already builds and runs before the fix, so there is nothing to repair.

02 / ENVIRONMENT RECIPE

Base commit
e0b4ec54bd044e414081d0554b71994b6ce74e25
Manifest
CMakeLists.txt
Reproduce
Awaiting issue-specific recipe
Run under trace
Awaiting a meaningful runtime command

03 / ORIGINAL ISSUE TEXT

gabime/spdlog #1104 · read the original issue
In my installation, file `lib64/spdlog/cmake/spdlogConfigTargets.cmake` contains the following code:

```cmake

set_target_properties(spdlog::spdlog_header_only PROPERTIES

  INTERFACE_COMPILE_OPTIONS "-Wall;-Wextra;-Wconversion;-pedantic;-Wfatal-errors"

  INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include"

  INTERFACE_LINK_LIBRARIES "Threads::Threads"

)

```

This means that simply using `spdlog` in my application, for example like this:

```cmake

find_package(spdlog REQUIRED)

target_link_libraries(foo spdlog::spdlog)

```

...will build my code with `-Wall -Wextra -Wconversion -pedantic -Wfatal-errors`. That is very wrong.



I think that this was introduced in 6636ae6e633b3f888ab5504db09f91091fdab9a5 and 54f1941691ac0f8b51d8122a98c259c87cf8026b. That code looks like something that was probably supposed to kick in only when building `spdlog` itself, but it actually affects the resulting CMake configuration files as well. So, when I use CMake to *build* spdlog, these only-for-spdlog options actually taint the resulting CMake config files, and these extra warnings are imposed on code which only "uses" `spdlog`.
Continue on GitHub ↗

04 / LABELS

Labels from the report text only; not yet run

No supported category has been assigned.

Label rules and the text that matched
[]