diff options
author | Eric Fiselier <eric@efcs.ca> | 2018-11-13 23:08:31 +0000 |
---|---|---|
committer | Eric Fiselier <eric@efcs.ca> | 2018-11-13 23:08:31 +0000 |
commit | 02f8e7c3558685e87a4c440ccfaedb8c35a5297d (patch) | |
tree | 6780930e1dfd775073ec9f5fbba683faac80e54c /libcxx/cmake/Modules | |
parent | 3c87c2a3c50bdc35a65af101318e6282e51d0d9c (diff) | |
download | bcm5719-llvm-02f8e7c3558685e87a4c440ccfaedb8c35a5297d.tar.gz bcm5719-llvm-02f8e7c3558685e87a4c440ccfaedb8c35a5297d.zip |
Add cxx-benchmark-unittests target
This patch adds the cxx-benchmark-unittests target so we can start
getting test coverage on the benchmarks, including building with
sanitizers. Because we're only looking for test-coverage, the benchmarks
run for the shortest time possible, and in parallel.
The target is excluded from all by default. It only
builds and runs the libcxx configurations of the benchmarks, and not
any versions built against the systems native standard library.
llvm-svn: 346811
Diffstat (limited to 'libcxx/cmake/Modules')
-rw-r--r-- | libcxx/cmake/Modules/HandleLibcxxFlags.cmake | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/libcxx/cmake/Modules/HandleLibcxxFlags.cmake b/libcxx/cmake/Modules/HandleLibcxxFlags.cmake index 24fe0c5d5fb..fb60318a330 100644 --- a/libcxx/cmake/Modules/HandleLibcxxFlags.cmake +++ b/libcxx/cmake/Modules/HandleLibcxxFlags.cmake @@ -45,6 +45,29 @@ macro(check_flag_supported flag) check_cxx_compiler_flag("${flag}" "LIBCXX_SUPPORTS_${flagname}_FLAG") endmacro() +macro(append_flags DEST) + foreach(value ${ARGN}) + list(APPEND ${DEST} ${value}) + list(APPEND ${DEST} ${value}) + endforeach() +endmacro() + +# If the specified 'condition' is true then append the specified list of flags to DEST +macro(append_flags_if condition DEST) + if (${condition}) + list(APPEND ${DEST} ${ARGN}) + endif() +endmacro() + +# Add each flag in the list specified by DEST if that flag is supported by the current compiler. +macro(append_flags_if_supported DEST) + foreach(flag ${ARGN}) + mangle_name("${flag}" flagname) + check_cxx_compiler_flag("${flag}" "LIBCXX_SUPPORTS_${flagname}_FLAG") + append_flags_if(LIBCXX_SUPPORTS_${flagname}_FLAG ${DEST} ${flag}) + endforeach() +endmacro() + # Add a macro definition if condition is true. macro(define_if condition def) if (${condition}) |