[compiler-rt] r208526 - [ASan tests] Use clang-cl to build tests on Windows
Timur Iskhodzhanov
timurrrr at google.com
Mon May 12 01:55:21 PDT 2014
Author: timurrrr
Date: Mon May 12 03:55:20 2014
New Revision: 208526
URL: http://llvm.org/viewvc/llvm-project?rev=208526&view=rev
Log:
[ASan tests] Use clang-cl to build tests on Windows
Reviewed at http://reviews.llvm.org/D3680
Modified:
compiler-rt/trunk/CMakeLists.txt
compiler-rt/trunk/cmake/Modules/AddCompilerRT.cmake
compiler-rt/trunk/cmake/Modules/CompilerRTCompile.cmake
Modified: compiler-rt/trunk/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/CMakeLists.txt?rev=208526&r1=208525&r2=208526&view=diff
==============================================================================
--- compiler-rt/trunk/CMakeLists.txt (original)
+++ compiler-rt/trunk/CMakeLists.txt Mon May 12 03:55:20 2014
@@ -57,8 +57,17 @@ if (NOT COMPILER_RT_STANDALONE_BUILD)
${LLVM_INCLUDE_TESTS})
option(COMPILER_RT_ENABLE_WERROR "Fail and stop if warning is triggered"
${LLVM_ENABLE_WERROR})
- # Use just-built Clang to compile/link tests.
- set(COMPILER_RT_TEST_COMPILER ${LLVM_RUNTIME_OUTPUT_INTDIR}/clang)
+ # Use just-built Clang to compile/link tests on all platforms, except for
+ # Windows where we need to use clang-cl instead.
+ if(NOT MSVC)
+ set(COMPILER_RT_TEST_COMPILER ${LLVM_RUNTIME_OUTPUT_INTDIR}/clang)
+ set(COMPILER_RT_TEST_COMPILER_EXE "-o")
+ set(COMPILER_RT_TEST_COMPILER_OBJ "-o")
+ else()
+ set(COMPILER_RT_TEST_COMPILER ${LLVM_RUNTIME_OUTPUT_INTDIR}/clang-cl.exe)
+ set(COMPILER_RT_TEST_COMPILER_EXE "-Fe")
+ set(COMPILER_RT_TEST_COMPILER_OBJ "-Fo")
+ endif()
else()
# Take output dir and install path from the user.
set(COMPILER_RT_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR} CACHE PATH
Modified: compiler-rt/trunk/cmake/Modules/AddCompilerRT.cmake
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/cmake/Modules/AddCompilerRT.cmake?rev=208526&r1=208525&r2=208526&view=diff
==============================================================================
--- compiler-rt/trunk/cmake/Modules/AddCompilerRT.cmake (original)
+++ compiler-rt/trunk/cmake/Modules/AddCompilerRT.cmake Mon May 12 03:55:20 2014
@@ -137,7 +137,9 @@ macro(add_compiler_rt_test test_suite te
list(APPEND TEST_DEPS clang)
endif()
add_custom_target(${test_name}
- COMMAND ${COMPILER_RT_TEST_COMPILER} ${TEST_OBJECTS} -o "${output_bin}"
+ # MSVS CL doesn't allow a space between -Fe and the output file name.
+ COMMAND ${COMPILER_RT_TEST_COMPILER} ${TEST_OBJECTS}
+ ${COMPILER_RT_TEST_COMPILER_EXE}"${output_bin}"
${TEST_LINK_FLAGS}
DEPENDS ${TEST_DEPS})
# Make the test suite depend on the binary.
Modified: compiler-rt/trunk/cmake/Modules/CompilerRTCompile.cmake
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/cmake/Modules/CompilerRTCompile.cmake?rev=208526&r1=208525&r2=208526&view=diff
==============================================================================
--- compiler-rt/trunk/cmake/Modules/CompilerRTCompile.cmake (original)
+++ compiler-rt/trunk/cmake/Modules/CompilerRTCompile.cmake Mon May 12 03:55:20 2014
@@ -23,7 +23,9 @@ macro(clang_compile object_file source)
set(compile_flags ${global_flags} ${SOURCE_CFLAGS})
add_custom_command(
OUTPUT ${object_file}
- COMMAND ${COMPILER_RT_TEST_COMPILER} ${compile_flags} -c -o "${object_file}"
+ # MSVS CL doesn't allow a space between -Fo and the object file name.
+ COMMAND ${COMPILER_RT_TEST_COMPILER} ${compile_flags} -c
+ ${COMPILER_RT_TEST_COMPILER_OBJ}"${object_file}"
${source_rpath}
MAIN_DEPENDENCY ${source}
DEPENDS ${SOURCE_DEPS})
More information about the llvm-commits
mailing list