Skip to content

Commit

Permalink
google-benchmark: build as a static library
Browse files Browse the repository at this point in the history
This partially fixes the Windows build, which was broken
because the upstream package does not use Visual Studio
specific code annotations like __dllspec(dllexport) or any
other mechanism for exporting symbols.

There are two other reasons to fix it this way:

Upstream uses CMake's WINDOWS_EXPORT_ALL_SYMBOLS feature to
deal with the issue for DLL builds. Meson does not have a
similar feature (see
mesonbuild/meson#2132).

Google typically links benchmarks statically, so linking
statically even on non-Windows builds is closer to the way
upstream typically uses the library.
  • Loading branch information
matta committed Nov 8, 2021
1 parent bbe3c37 commit 1163e31
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions subprojects/packagefiles/google-benchmark/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ inc = include_directories('include')

thread_dep = dependency('threads')

lib_benchmark = library('gbenchmark',
lib_benchmark = static_library('gbenchmark',
benchmark_sources,
include_directories:inc,
cpp_args : '-DNDEBUG',
Expand All @@ -40,7 +40,7 @@ google_benchmark_dep = declare_dependency(
link_with:lib_benchmark,
include_directories:inc)

lib_benchmark_main = library('benchmark-main',
lib_benchmark_main = static_library('benchmark-main',
benchmark_main_sources,
include_directories:inc,
cpp_args : '-DNDEBUG',
Expand Down

0 comments on commit 1163e31

Please sign in to comment.