diff options
-rw-r--r-- | Modules/CheckFunctionExists.cmake | 30 | ||||
-rw-r--r-- | Modules/Compiler/Clang-CXX-FeatureTests.cmake | 3 | ||||
-rw-r--r-- | Modules/Compiler/Clang-CXX.cmake | 6 | ||||
-rw-r--r-- | Source/CMakeLists.txt | 9 | ||||
-rw-r--r-- | Source/CMakeVersion.cmake | 2 | ||||
-rw-r--r-- | Source/CTest/cmCTestRunTest.cxx | 2 | ||||
-rw-r--r-- | Tests/RunCMake/CTestCommandLine/repeat-until-fail-cmake.cmake | 2 |
7 files changed, 39 insertions, 15 deletions
diff --git a/Modules/CheckFunctionExists.cmake b/Modules/CheckFunctionExists.cmake index 5f049e7..ef08062 100644 --- a/Modules/CheckFunctionExists.cmake +++ b/Modules/CheckFunctionExists.cmake @@ -5,18 +5,16 @@ # CheckFunctionExists # ------------------- # -# Check if a C function can be linked +# Check if a C function can be linked:: # -# CHECK_FUNCTION_EXISTS(<function> <variable>) +# check_function_exists(<function> <variable>) # -# Check that the <function> is provided by libraries on the system and -# store the result in a <variable>. This does not verify that any -# system header file declares the function, only that it can be found at -# link time (consider using CheckSymbolExists). -# <variable> will be created as an internal cache variable. +# Check that the ``<function>`` is provided by libraries on the system and store +# the result in a ``<variable>``. ``<variable>`` will be created as an internal +# cache variable. # -# The following variables may be set before calling this macro to modify -# the way the check is run: +# The following variables may be set before calling this macro to modify the +# way the check is run: # # :: # @@ -25,6 +23,20 @@ # CMAKE_REQUIRED_INCLUDES = list of include directories # CMAKE_REQUIRED_LIBRARIES = list of libraries to link # CMAKE_REQUIRED_QUIET = execute quietly without messages +# +# .. note:: +# +# Prefer using :Module:`CheckSymbolExists` instead of this module, +# for the following reasons: +# +# * ``check_function_exists()`` can't detect functions that are inlined +# in headers or specified as a macro. +# +# * ``check_function_exists()`` can't detect anything in the 32-bit +# versions of the Win32 API, because of a mismatch in calling conventions. +# +# * ``check_function_exists()`` only verifies linking, it does not verify +# that the function is declared in system headers. macro(CHECK_FUNCTION_EXISTS FUNCTION VARIABLE) if(NOT DEFINED "${VARIABLE}" OR "x${${VARIABLE}}" STREQUAL "x${VARIABLE}") diff --git a/Modules/Compiler/Clang-CXX-FeatureTests.cmake b/Modules/Compiler/Clang-CXX-FeatureTests.cmake index df2e1a8..cd04190 100644 --- a/Modules/Compiler/Clang-CXX-FeatureTests.cmake +++ b/Modules/Compiler/Clang-CXX-FeatureTests.cmake @@ -2,7 +2,7 @@ # Reference: http://clang.llvm.org/cxx_status.html # http://clang.llvm.org/docs/LanguageExtensions.html -set(_cmake_oldestSupported "((__clang_major__ * 100) + __clang_minor__) >= 304") +set(_cmake_oldestSupported "((__clang_major__ * 100) + __clang_minor__) >= 301") include("${CMAKE_CURRENT_LIST_DIR}/Clang-CXX-TestableFeatures.cmake") @@ -15,7 +15,6 @@ set(_cmake_feature_test_cxx_digit_separators "${Clang34_CXX14}") # http://llvm.org/bugs/show_bug.cgi?id=19674 set(_cmake_feature_test_cxx_generic_lambdas "${Clang34_CXX14}") -# TODO: Should be supported by Clang 3.1 set(Clang31_CXX11 "${_cmake_oldestSupported} && __cplusplus >= 201103L") set(_cmake_feature_test_cxx_enum_forward_declarations "${Clang31_CXX11}") set(_cmake_feature_test_cxx_sizeof_member "${Clang31_CXX11}") diff --git a/Modules/Compiler/Clang-CXX.cmake b/Modules/Compiler/Clang-CXX.cmake index d0e2521..8ed3695 100644 --- a/Modules/Compiler/Clang-CXX.cmake +++ b/Modules/Compiler/Clang-CXX.cmake @@ -36,7 +36,7 @@ if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.5) set(CMAKE_CXX17_EXTENSION_COMPILE_OPTION "-std=gnu++1z") endif() -if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.4) +if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.1) if (NOT CMAKE_CXX_COMPILER_FORCED) if (NOT CMAKE_CXX_STANDARD_COMPUTED_DEFAULT) message(FATAL_ERROR "CMAKE_CXX_STANDARD_COMPUTED_DEFAULT should be set for ${CMAKE_CXX_COMPILER_ID} (${CMAKE_CXX_COMPILER}) version ${CMAKE_CXX_COMPILER_VERSION}") @@ -50,14 +50,14 @@ endif() macro(cmake_record_cxx_compile_features) set(_result 0) - if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.4) + if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.1) if(_result EQUAL 0 AND CMAKE_CXX17_STANDARD_COMPILE_OPTION) _record_compiler_features_cxx(17) endif() if(_result EQUAL 0 AND CMAKE_CXX14_STANDARD_COMPILE_OPTION) _record_compiler_features_cxx(14) endif() - if (_result EQUAL 0) + if (_result EQUAL 0 AND CMAKE_CXX11_STANDARD_COMPILE_OPTION) _record_compiler_features_cxx(11) endif() if (_result EQUAL 0) diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt index 57b7b25..2835ee6 100644 --- a/Source/CMakeLists.txt +++ b/Source/CMakeLists.txt @@ -787,6 +787,15 @@ target_link_libraries(CMakeLib cmsys ${CMake_KWIML_LIBRARIES} ) +if(CMAKE_SYSTEM_NAME STREQUAL "Linux" AND CMAKE_SYSTEM_PROCESSOR MATCHES "sparc") + # the atomic instructions are implemented using libatomic on some platforms, + # so linking to that may be required + check_library_exists(atomic __atomic_fetch_add_4 "" LIBATOMIC_NEEDED) + if(LIBATOMIC_NEEDED) + target_link_libraries(CMakeLib atomic) + endif() +endif() + # On Apple we need CoreFoundation if(APPLE) target_link_libraries(CMakeLib "-framework CoreFoundation") diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index fde01c1..0c64d70 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,5 +1,5 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 7) -set(CMake_VERSION_PATCH 20170112) +set(CMake_VERSION_PATCH 20170116) #set(CMake_VERSION_RC 1) diff --git a/Source/CTest/cmCTestRunTest.cxx b/Source/CTest/cmCTestRunTest.cxx index 5c45fe5..ac1644f 100644 --- a/Source/CTest/cmCTestRunTest.cxx +++ b/Source/CTest/cmCTestRunTest.cxx @@ -134,6 +134,7 @@ void cmCTestRunTest::CompressOutput() size_t rlen = cmsysBase64_Encode(out, strm.total_out, encoded_buffer, 1); + this->CompressedOutput.clear(); for (size_t i = 0; i < rlen; i++) { this->CompressedOutput += encoded_buffer[i]; } @@ -416,6 +417,7 @@ bool cmCTestRunTest::StartTest(size_t total) << std::setw(getNumWidth(this->TestHandler->GetMaxIndex())) << this->TestProperties->Index << ": " << this->TestProperties->Name << std::endl); + this->ProcessOutput.clear(); this->ComputeArguments(); std::vector<std::string>& args = this->TestProperties->Args; this->TestResult.Properties = this->TestProperties; diff --git a/Tests/RunCMake/CTestCommandLine/repeat-until-fail-cmake.cmake b/Tests/RunCMake/CTestCommandLine/repeat-until-fail-cmake.cmake index 4654416..ecb9a64 100644 --- a/Tests/RunCMake/CTestCommandLine/repeat-until-fail-cmake.cmake +++ b/Tests/RunCMake/CTestCommandLine/repeat-until-fail-cmake.cmake @@ -12,4 +12,6 @@ add_test(NAME test1 set_tests_properties(test1 PROPERTIES DEPENDS "initialization") add_test(hello ${CMAKE_COMMAND} -E echo hello) +set_tests_properties(hello PROPERTIES FAIL_REGULAR_EXPRESSION "hello.*hello") + add_test(goodbye ${CMAKE_COMMAND} -E echo goodbye) |