<div style="font-family: arial, helvetica, sans-serif; font-size: 10pt"><div dir="ltr"><div class="gmail_default" style>On Thu, Dec 20, 2012 at 9:19 PM, David Blaikie <span dir="ltr"><<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a>></span> wrote:<br>
</div><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On Thu, Dec 20, 2012 at 6:38 AM, Alexey Samsonov <<a href="mailto:samsonov@google.com">samsonov@google.com</a>> wrote:<br>
> Author: samsonov<br>
> Date: Thu Dec 20 08:38:02 2012<br>
> New Revision: 170698<br>
><br>
> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=170698&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=170698&view=rev</a><br>
> Log:<br>
> [Sanitizer] Fix CMake build rules for sanitizer_common tests to respect universal static libraries on Mac<br>
><br>
> Modified:<br>
> compiler-rt/trunk/lib/sanitizer_common/tests/CMakeLists.txt<br>
<br>
</div>I'm seeing warnings from ninja that appear to be related to this change:<br>
<br>
ninja: warning: multiple rules generate<br>
projects/compiler-rt/lib/sanitizer_common/tests/libRTSanitizerCommon.test.i386.a.<br>
build will not be correct; continuing anyway<br>
ninja: warning: multiple rules generate<br>
projects/compiler-rt/lib/sanitizer_common/tests/libRTSanitizerCommon.test.x86_64.a.<br>
build will not be correct; continuing anyway<br></blockquote><div><br></div><div style>Yes, I can reproduce this warning in a clean tree. Will take a look tomorrow (hope this doesn't block you badly).</div><div> </div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
(I haven't tried a full clean rebuild yet, though)<br>
<div class="HOEnZb"><div class="h5"><br>
><br>
> Modified: compiler-rt/trunk/lib/sanitizer_common/tests/CMakeLists.txt<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/tests/CMakeLists.txt?rev=170698&r1=170697&r2=170698&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/tests/CMakeLists.txt?rev=170698&r1=170697&r2=170698&view=diff</a><br>
> ==============================================================================<br>
> --- compiler-rt/trunk/lib/sanitizer_common/tests/CMakeLists.txt (original)<br>
> +++ compiler-rt/trunk/lib/sanitizer_common/tests/CMakeLists.txt Thu Dec 20 08:38:02 2012<br>
> @@ -15,6 +15,24 @@<br>
> include_directories(..)<br>
> include_directories(../..)<br>
><br>
> +# Adds static library which contains sanitizer_common object file<br>
> +# (universal binary on Mac and arch-specific object files on Linux).<br>
> +macro(add_sanitizer_common_lib library)<br>
> + add_library(${library} STATIC ${ARGN})<br>
> + set_target_properties(${library} PROPERTIES<br>
> + ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})<br>
> + set(lib_name "lib${library}.a")<br>
> + add_custom_target(${lib_name} DEPENDS ${library})<br>
> +endmacro()<br>
> +<br>
> +function(get_sanitizer_common_lib_for_arch arch lib_name)<br>
> + if(APPLE)<br>
> + set(${lib_name} "libRTSanitizerCommon.test.osx.a" PARENT_SCOPE)<br>
> + else()<br>
> + set(${lib_name} "libRTSanitizerCommon.test.${arch}.a" PARENT_SCOPE)<br>
> + endif()<br>
> +endfunction()<br>
> +<br>
> # Sanitizer_common unit tests testsuite.<br>
> add_custom_target(SanitizerUnitTests)<br>
> set_target_properties(SanitizerUnitTests PROPERTIES<br>
> @@ -40,16 +58,7 @@<br>
> DEPS gtest ${SANITIZER_RUNTIME_LIBRARIES})<br>
> list(APPEND SANITIZER_TEST_OBJECTS ${output_obj})<br>
> endforeach()<br>
> - # Add static library which contains sanitizer_common<br>
> - # object files for given arch.<br>
> - set(SANITIZER_COMMON_LIB "RTSanitizerCommon.test.${arch}")<br>
> - add_library(${SANITIZER_COMMON_LIB} STATIC<br>
> - $<TARGET_OBJECTS:RTSanitizerCommon.${arch}>)<br>
> - set_target_properties(${SANITIZER_COMMON_LIB} PROPERTIES<br>
> - ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})<br>
> - set(SANITIZER_COMMON_LIB_NAME "lib${SANITIZER_COMMON_LIB}.a")<br>
> - add_custom_target(${SANITIZER_COMMON_LIB_NAME}<br>
> - DEPENDS ${SANITIZER_COMMON_LIB})<br>
> + get_sanitizer_common_lib_for_arch(${arch} SANITIZER_COMMON_LIB_NAME)<br>
> # Add unittest target.<br>
> set(SANITIZER_TEST_NAME "Sanitizer-${arch}-Test")<br>
> add_compiler_rt_test(SanitizerUnitTests ${SANITIZER_TEST_NAME}<br>
> @@ -59,6 +68,19 @@<br>
> endmacro()<br>
><br>
> if("${CMAKE_HOST_SYSTEM}" STREQUAL "${CMAKE_SYSTEM}" AND UNIX AND NOT ANDROID)<br>
> + if(APPLE)<br>
> + add_sanitizer_common_lib("RTSanitizerCommon.test.osx"<br>
> + $<TARGET_OBJECTS:RTSanitizerCommon.osx>)<br>
> + else()<br>
> + if(CAN_TARGET_X86_64)<br>
> + add_sanitizer_common_lib("RTSanitizerCommon.test.x86_64"<br>
> + $<TARGET_OBJECTS:RTSanitizerCommon.x86_64>)<br>
> + endif()<br>
> + if(CAN_TARGET_I386)<br>
> + add_sanitizer_common_lib("RTSanitizerCommon.test.i386"<br>
> + $<TARGET_OBJECTS:RTSanitizerCommon.i386>)<br>
> + endif()<br>
> + endif()<br>
> if(CAN_TARGET_X86_64)<br>
> add_sanitizer_tests_for_arch(x86_64)<br>
> endif()<br>
><br>
><br>
> _______________________________________________<br>
> llvm-commits mailing list<br>
> <a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div>Alexey Samsonov, MSK</div><br>
</div></div></div>