diff options
author | Jeremy Ong <jeremycong@gmail.com> | 2020-08-27 04:17:19 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-27 11:17:19 +0100 |
commit | 01c0ab7cbb8afdf8af46baed06514f8fae7ee2fb (patch) | |
tree | df1a0a075e33dc7285ed6382799f48fddc7ede3a /cmake | |
parent | 4857962394266165790de2266a695f328fc144f3 (diff) | |
download | google-benchmark-01c0ab7cbb8afdf8af46baed06514f8fae7ee2fb.tar.gz |
Fix Clang builds on Windows (#1021)
Fixes #974. The `cxx_feature_check` now has an additional
optional argument which can be used to supply extra cmake flags
to pass to the `try_compile` command. The `CMAKE_CXX_STANDARD=14`
flag was determined to be the minimum flag necessary to correctly
compile and run the regex feature checks when compiling with Clang
under Windows (n.b. this does *not* refer to clang-cl, the frontend
to the MSVC compiler). The additional flag is not enabled for any
other compiler/platform tuple.
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/CXXFeatureCheck.cmake | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/cmake/CXXFeatureCheck.cmake b/cmake/CXXFeatureCheck.cmake index 059d510..62e6741 100644 --- a/cmake/CXXFeatureCheck.cmake +++ b/cmake/CXXFeatureCheck.cmake @@ -27,6 +27,11 @@ function(cxx_feature_check FILE) return() endif() + if (ARGC GREATER 1) + message(STATUS "Enabling additional flags: ${ARGV1}") + list(APPEND BENCHMARK_CXX_LINKER_FLAGS ${ARGV1}) + endif() + if (NOT DEFINED COMPILE_${FEATURE}) message(STATUS "Performing Test ${FEATURE}") if(CMAKE_CROSSCOMPILING) |