diff options
| author | George Karpenkov <ekarpenkov@apple.com> | 2017-07-28 00:50:56 +0000 |
|---|---|---|
| committer | George Karpenkov <ekarpenkov@apple.com> | 2017-07-28 00:50:56 +0000 |
| commit | 50dd3fe903c4cb3dcaede77277a8abdd7bd02339 (patch) | |
| tree | 2e60c43a8533060000cd8853f428aaaaeb5ad6c5 /compiler-rt/lib/interception/tests | |
| parent | 94d2ac716091fd049a09d54d3904a19076c1ae29 (diff) | |
| download | bcm5719-llvm-50dd3fe903c4cb3dcaede77277a8abdd7bd02339.tar.gz bcm5719-llvm-50dd3fe903c4cb3dcaede77277a8abdd7bd02339.zip | |
[sanitizers] Sanitizer tests CMake clean up: try #2
This patch addresses two issues:
Most of the time, hacks with `if/else` in order to get support for
multi-configuration builds are superfluous.
The variable `CMAKE_CFG_INTDIR` was created precisely for this purpose: it
expands to `.` on all single-configuration builds, and to a configuration
name otherwise.
The `if/else` hacks for the library name generation should also not be
done, as CMake has `TARGET_FILE` generator expression precisely for this
purpose, as it expands to the exact filename of the resulting target.
Differential Revision: https://reviews.llvm.org/D35952
llvm-svn: 309341
Diffstat (limited to 'compiler-rt/lib/interception/tests')
| -rw-r--r-- | compiler-rt/lib/interception/tests/CMakeLists.txt | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/compiler-rt/lib/interception/tests/CMakeLists.txt b/compiler-rt/lib/interception/tests/CMakeLists.txt index 5ea943f9a82..5f40331049c 100644 --- a/compiler-rt/lib/interception/tests/CMakeLists.txt +++ b/compiler-rt/lib/interception/tests/CMakeLists.txt @@ -74,16 +74,7 @@ function(get_interception_lib_for_arch arch lib lib_name) set(tgt_name "RTInterception.test.${arch}") endif() set(${lib} "${tgt_name}" PARENT_SCOPE) - if(CMAKE_CONFIGURATION_TYPES) - set(configuration_path "${CMAKE_CFG_INTDIR}/") - else() - set(configuration_path "") - endif() - if(NOT MSVC) - set(${lib_name} "${configuration_path}lib${tgt_name}.a" PARENT_SCOPE) - else() - set(${lib_name} "${configuration_path}${tgt_name}.lib" PARENT_SCOPE) - endif() + set(${lib_name} $<TARGET_FILE:${tgt_name}> PARENT_SCOPE) endfunction() # Interception unit tests testsuite. @@ -103,11 +94,7 @@ macro(add_interception_tests_for_arch arch) set(INTERCEPTION_TEST_OBJECTS) foreach(source ${INTERCEPTION_TEST_SOURCES}) get_filename_component(basename ${source} NAME) - if(CMAKE_CONFIGURATION_TYPES) - set(output_obj "${CMAKE_CFG_INTDIR}/${basename}.${arch}.o") - else() - set(output_obj "${basename}.${arch}.o") - endif() + set(output_obj "${CMAKE_CFG_RESOLVED_INTDIR}${basename}.${arch}.o") clang_compile(${output_obj} ${source} CFLAGS ${INTERCEPTION_TEST_CFLAGS_COMMON} ${TARGET_FLAGS} DEPS ${INTERCEPTION_TEST_COMPILE_DEPS}) |

