Skip to content

[Question] Consider making BENCHMARK_STATIC_DEFINE a public compile definition #1457

@jcar87

Description

@jcar87

Describe the bug
Linking a consumer project against the generated CMake imported targets fails on Windows/MSVC due to missing symbols.

System
Which OS, compiler, and compiler version are you using:

  • OS: Windows
  • Compiler and version: Visual C++

To reproduce
Issue very well described here: #1450
and also happening here: conan-io/conan-center-index#11912

External projects that link against the generated CMake imported targets, now need to define BENCHMARK_STATIC_DEFINE on their end. I think this effectively means that users on Windows would have to define that on their side when updating to 1.7.0.

This gives me the impression that this could be a "public" compile definition that is propagated transitively to consumers, such that they do not have to define this on their end. I believe introduced here: https://github.com/google/benchmark/pull/1435/files.

I would venture a guess that prior to this change, the value was already set in the generated file.

I'm happy to open a pull request to address it, just want to make sure it would not negatively impact other platforms.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions