← All tasks
cppgabime/spdlog #722Not a task: not reproduced

CMake config enforces 32/64 bitness

envgap__gabime__spdlog-722

01 / FAILURE SIGNATURE

As reported upstream

Could not find a configuration file for package "spdlog" that is compatible
Not a benchmark task.
  • In a clean container the reported failure did not reproduce, or the known fix did not make the project run.

02 / ENVIRONMENT RECIPE

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

03 / ORIGINAL ISSUE TEXT

gabime/spdlog #722 · read the original issue
spdlog is enforcing 32 or 64 bit mode in the CMake config, which I don't think makes sense for a header-only library.



Package spdlog 0.17.0 using [the instructions](https://github.com/gabime/spdlog/wiki/9.-CMake):



```

[spdlog]> cmake -H. -B_builds -DCMAKE_INSTALL_PREFIX=/path/to/install -DCMAKE_BUILD_TYPE=Release

[spdlog]> cmake --build _builds --target install

```



On Windows 7 with the Visual Studio 2015 generator, but I believe the principle is generic, if you use the 32-bit compiler then `spdlogConfigVersion.cmake` enforces that:



```cmake

# if the installed or the using project don't have CMAKE_SIZEOF_VOID_P set, ignore it:

if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "" OR "4" STREQUAL "")

   return()

endif()



# check that the installed version has the same 32/64bit-ness as the one which is currently searching:

if(NOT CMAKE_SIZEOF_VOID_P STREQUAL "4")

  math(EXPR installedBits "4 * 8")

  set(PACKAGE_VERSION "${PACKAGE_VERSION} (${installedBits}bit)")

  set(PACKAGE_VERSION_UNSUITABLE TRUE)

endif()

```



And vice-versa if building for 64-bit.



So this can fail:



```cmake

find_package(spdlog 0.17.0 CONFIG REQUIRED)

```



With:



```

CMake Error at CMakeLists.txt:14 (find_package):

  Could not find a configuration file for package "spdlog" that is compatible

  with requested version "0.17.0".



  The following configuration files were considered but not accepted:



    C:/tools/spdlog-0.17.0/lib/cmake/spdlog/spdlogConfig.cmake, version: 0.17.0 (32bit)

```



Even though the right version is present.
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
[]