<div style="font-family: arial, helvetica, sans-serif"><font size="2">I had the same problem. Updating cmake to 2.8.8 helped to solve it.<br><br><div class="gmail_quote">On Thu, Jun 21, 2012 at 6:21 PM, Timur Iskhodzhanov <span dir="ltr"><<a href="mailto:timurrrr@google.com" target="_blank">timurrrr@google.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">it has broken my Windows VC9 build too, including our ASan/Win bot<br>
<div class="HOEnZb"><div class="h5"><br>
On Thu, Jun 21, 2012 at 3:29 AM, NAKAMURA Takumi <<a href="mailto:geek4civic@gmail.com">geek4civic@gmail.com</a>> wrote:<br>
> It broke my cmake-linux builders.<br>
> I guess something version mismatch. IIRC, they use 2.8.3.<br>
><br>
> I will fix tonight.<br>
><br>
> 2012/06/21 14:19 "Chandler Carruth" <<a href="mailto:chandlerc@gmail.com">chandlerc@gmail.com</a>>:<br>
><br>
>> Author: chandlerc<br>
>> Date: Thu Jun 21 00:16:58 2012<br>
>> New Revision: 158896<br>
>><br>
>> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=158896&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=158896&view=rev</a><br>
>> Log:<br>
>> Factor the logic for setting up a GoogleTest unit test executable into<br>
>> a helper function in CMake. This will allow us to share all of this<br>
>> logic with Clang, and eventually CompilerRT.<br>
>><br>
>> Modified:<br>
>> llvm/trunk/cmake/modules/AddLLVM.cmake<br>
>> llvm/trunk/unittests/CMakeLists.txt<br>
>><br>
>> Modified: llvm/trunk/cmake/modules/AddLLVM.cmake<br>
>> URL:<br>
>> <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/modules/AddLLVM.cmake?rev=158896&r1=158895&r2=158896&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/modules/AddLLVM.cmake?rev=158896&r1=158895&r2=158896&view=diff</a><br>
>><br>
>> ==============================================================================<br>
>> --- llvm/trunk/cmake/modules/AddLLVM.cmake (original)<br>
>> +++ llvm/trunk/cmake/modules/AddLLVM.cmake Thu Jun 21 00:16:58 2012<br>
>> @@ -147,3 +147,53 @@<br>
>> endif()<br>
>> endif()<br>
>> endmacro(add_llvm_external_project)<br>
>> +<br>
>> +# Generic support for adding a unittest.<br>
>> +function(add_unittest test_suite test_dirname)<br>
>> + string(REGEX MATCH "([^/]+)$" test_name ${test_dirname})<br>
>> + if (CMAKE_BUILD_TYPE)<br>
>> + set(CMAKE_RUNTIME_OUTPUT_DIRECTORY<br>
>> + ${CMAKE_CURRENT_BINARY_DIR}/${test_dirname}/${CMAKE_BUILD_TYPE})<br>
>> + else()<br>
>> + set(CMAKE_RUNTIME_OUTPUT_DIRECTORY<br>
>> + ${CMAKE_CURRENT_BINARY_DIR}/${test_dirname})<br>
>> + endif()<br>
>> + if( NOT LLVM_BUILD_TESTS )<br>
>> + set(EXCLUDE_FROM_ALL ON)<br>
>> + endif()<br>
>> +<br>
>> + add_llvm_executable(${test_name} ${ARGN})<br>
>> + target_link_libraries(${test_name}<br>
>> + gtest<br>
>> + gtest_main<br>
>> + LLVMSupport # gtest needs it for raw_ostream.<br>
>> + )<br>
>> +<br>
>> + add_dependencies(${test_suite} ${test_name})<br>
>> + get_target_property(test_suite_folder ${test_suite} FOLDER)<br>
>> + if (NOT ${test_suite_folder} STREQUAL "NOTFOUND")<br>
>> + set_property(TARGET ${test_name} PROPERTY FOLDER<br>
>> "${test_suite_folder}")<br>
>> + endif ()<br>
>> +<br>
>> + # Visual Studio 2012 only supports up to 8 template parameters in<br>
>> + # std::tr1::tuple by default, but gtest requires 10<br>
>> + if (MSVC AND MSVC_VERSION EQUAL 1700)<br>
>> + set_property(TARGET ${test_name} APPEND PROPERTY COMPILE_DEFINITIONS<br>
>> _VARIADIC_MAX=10)<br>
>> + endif ()<br>
>> +<br>
>> +<br>
>> include_directories(${LLVM_MAIN_SRC_DIR}/utils/unittest/googletest/include)<br>
>> + set_property(TARGET ${test_name} APPEND PROPERTY COMPILE_DEFINITIONS<br>
>> GTEST_HAS_RTTI=0)<br>
>> + if (LLVM_COMPILER_IS_GCC_COMPATIBLE)<br>
>> + set_property(TARGET ${test_name} APPEND_STRING PROPERTY COMPILE_FLAGS<br>
>> " -fno-rtti")<br>
>> + elseif (MSVC)<br>
>> + set_property(TARGET ${test_name} APPEND_STRING PROPERTY COMPILE_FLAGS<br>
>> " /GR-")<br>
>> + endif ()<br>
>> +<br>
>> + if (NOT LLVM_ENABLE_THREADS)<br>
>> + set_property(TARGET ${test_name} APPEND PROPERTY COMPILE_DEFINITIONS<br>
>> GTEST_HAS_PTHREAD=0)<br>
>> + endif ()<br>
>> +<br>
>> + if (SUPPORTS_NO_VARIADIC_MACROS_FLAG)<br>
>> + set_property(TARGET ${test_name} APPEND_STRING PROPERTY COMPILE_FLAGS<br>
>> " -Wno-variadic-macros")<br>
>> + endif ()<br>
>> +endfunction()<br>
>><br>
>> Modified: llvm/trunk/unittests/CMakeLists.txt<br>
>> URL:<br>
>> <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/CMakeLists.txt?rev=158896&r1=158895&r2=158896&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/CMakeLists.txt?rev=158896&r1=158895&r2=158896&view=diff</a><br>
>><br>
>> ==============================================================================<br>
>> --- llvm/trunk/unittests/CMakeLists.txt (original)<br>
>> +++ llvm/trunk/unittests/CMakeLists.txt Thu Jun 21 00:16:58 2012<br>
>> @@ -1,51 +1,9 @@<br>
>> -function(add_llvm_unittest test_dirname)<br>
>> - string(REGEX MATCH "([^/]+)$" test_name ${test_dirname})<br>
>> - if (CMAKE_BUILD_TYPE)<br>
>> - set(CMAKE_RUNTIME_OUTPUT_DIRECTORY<br>
>> - ${LLVM_BINARY_DIR}/unittests/${test_dirname}/${CMAKE_BUILD_TYPE})<br>
>> - else()<br>
>> - set(CMAKE_RUNTIME_OUTPUT_DIRECTORY<br>
>> - ${LLVM_BINARY_DIR}/unittests/${test_dirname})<br>
>> - endif()<br>
>> - if( NOT LLVM_BUILD_TESTS )<br>
>> - set(EXCLUDE_FROM_ALL ON)<br>
>> - endif()<br>
>> -<br>
>> - add_llvm_executable(${test_name} ${ARGN})<br>
>> - target_link_libraries(${test_name}<br>
>> - gtest<br>
>> - gtest_main<br>
>> - LLVMSupport # gtest needs it for raw_ostream.<br>
>> - )<br>
>> -<br>
>> - add_dependencies(UnitTests ${test_name})<br>
>> - set_target_properties(${test_name} PROPERTIES FOLDER "Tests")<br>
>> -endfunction()<br>
>> -<br>
>> -# Visual Studio 2012 only supports up to 8 template parameters in<br>
>> -# std::tr1::tuple by default, but gtest requires 10<br>
>> -if(MSVC AND MSVC_VERSION EQUAL 1700)<br>
>> - add_definitions(-D_VARIADIC_MAX=10)<br>
>> -endif ()<br>
>> -<br>
>> add_custom_target(UnitTests)<br>
>> set_target_properties(UnitTests PROPERTIES FOLDER "Tests")<br>
>><br>
>><br>
>> -include_directories(${LLVM_MAIN_SRC_DIR}/utils/unittest/googletest/include)<br>
>> -add_definitions(-DGTEST_HAS_RTTI=0)<br>
>> -if( LLVM_COMPILER_IS_GCC_COMPATIBLE )<br>
>> - llvm_replace_compiler_option(CMAKE_CXX_FLAGS "-frtti" "-fno-rtti")<br>
>> -elseif( MSVC )<br>
>> - llvm_replace_compiler_option(CMAKE_CXX_FLAGS "/GR" "/GR-")<br>
>> -endif()<br>
>> -<br>
>> -if (NOT LLVM_ENABLE_THREADS)<br>
>> - add_definitions(-DGTEST_HAS_PTHREAD=0)<br>
>> -endif()<br>
>> -<br>
>> -if(SUPPORTS_NO_VARIADIC_MACROS_FLAG)<br>
>> - add_definitions("-Wno-variadic-macros")<br>
>> -endif()<br>
>> +function(add_llvm_unittest test_dirname)<br>
>> + add_unittest(UnitTests ${test_dirname} ${ARGN})<br>
>> +endfunction()<br>
>><br>
>> set(LLVM_LINK_COMPONENTS<br>
>> jit<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>
><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>
><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><div><font color="#666666"><span style="border-top-width:2px;border-right-width:0px;border-bottom-width:0px;border-left-width:0px;border-top-style:solid;border-right-style:solid;border-bottom-style:solid;border-left-style:solid;border-top-color:rgb(213,15,37);border-right-color:rgb(213,15,37);border-bottom-color:rgb(213,15,37);border-left-color:rgb(213,15,37);padding-top:2px;margin-top:2px">Alexander Kornienko |</span><span style="border-top-width:2px;border-right-width:0px;border-bottom-width:0px;border-left-width:0px;border-top-style:solid;border-right-style:solid;border-bottom-style:solid;border-left-style:solid;border-top-color:rgb(51,105,232);border-right-color:rgb(51,105,232);border-bottom-color:rgb(51,105,232);border-left-color:rgb(51,105,232);padding-top:2px;margin-top:2px"> Software Engineer |</span></font><span style="border-top-width:2px;border-right-width:0px;border-bottom-width:0px;border-left-width:0px;border-top-style:solid;border-right-style:solid;border-bottom-style:solid;border-left-style:solid;border-top-color:rgb(0,153,57);border-right-color:rgb(0,153,57);border-bottom-color:rgb(0,153,57);border-left-color:rgb(0,153,57);padding-top:2px;margin-top:2px"><font color="#666666"> </font><a href="mailto:alexfh@google.com" style="color:rgb(17,85,204)" target="_blank">alexfh@google.com</a> |</span><span style="border-top-width:2px;border-right-width:0px;border-bottom-width:0px;border-left-width:0px;border-top-style:solid;border-right-style:solid;border-bottom-style:solid;border-left-style:solid;border-top-color:rgb(238,178,17);border-right-color:rgb(238,178,17);border-bottom-color:rgb(238,178,17);border-left-color:rgb(238,178,17);padding-top:2px;margin-top:2px"> <a value="+35315435283" style="color:rgb(17,85,204)">+49 151 221 77 957</a></span></div>
</div><div><font color="#666666"><span style="background-color:rgb(255,255,255);font-family:Arial,Verdana,sans-serif">Google Germany GmbH | </span><span style="background-color:rgb(255,255,255);font-family:Arial,Verdana,sans-serif">Dienerstr. 12 | </span><span style="background-color:rgb(255,255,255);font-family:Arial,Verdana,sans-serif">80331 München</span></font></div>
<br>
</font></div>