Update upstream source from tag 'upstream/3.12.3'

Update to upstream version '3.12.3'
with Debian dir 10e95e6a68e207c81e8f25b4a611aca6c757f812
This commit is contained in:
Felix Geyer 2018-10-07 12:27:37 +02:00
commit 6bcf7a2112
50 changed files with 247 additions and 93 deletions

View File

@ -4,4 +4,4 @@ TESTS
List of tests. List of tests.
This read-only property holds a :ref:`;-list <CMake Language Lists>` of tests This read-only property holds a :ref:`;-list <CMake Language Lists>` of tests
defined so far by the :command:`add_test` command. defined so far, in the current directory, by the :command:`add_test` command.

View File

@ -30,7 +30,8 @@ set to specify the STL variant to be used. The value may be one of:
``stlport_shared`` ``stlport_shared``
STLport Shared STLport Shared
The default value is ``gnustl_static``. Note that this default differs from The default value is ``gnustl_static`` on NDK versions that provide it
and otherwise ``c++_static``. Note that this default differs from
the native NDK build system because CMake may be used to build projects for the native NDK build system because CMake may be used to build projects for
Android that are not natively implemented for it and use the C++ standard Android that are not natively implemented for it and use the C++ standard
library. library.

View File

@ -9,5 +9,5 @@ created. For example:
.. code-block:: cmake .. code-block:: cmake
set(CMAKE_CXX_CLANG_TIDY clang-tidy checks=-*,readability-*) set(CMAKE_CXX_CLANG_TIDY clang-tidy -checks=-*,readability-*)
add_executable(foo foo.cxx) add_executable(foo foo.cxx)

View File

@ -185,7 +185,7 @@ if(__IMPLICT_DLINK_DIRS)
endif() endif()
set(__IMPLICT_DLINK_FLAGS ) set(__IMPLICT_DLINK_FLAGS )
foreach(dir ${__IMPLICT_DLINK_DIRS}) foreach(dir ${__IMPLICT_DLINK_DIRS})
if(EXISTS "${dir}/libcublas_device.a") if(EXISTS "${dir}/libcurand_static.a")
string(APPEND __IMPLICT_DLINK_FLAGS " -L\"${dir}\"") string(APPEND __IMPLICT_DLINK_FLAGS " -L\"${dir}\"")
endif() endif()
endforeach() endforeach()

View File

@ -56,13 +56,14 @@ include(CMakeParseArguments) # cmake_parse_arguments
# X_RESULT - name of the final result variable # X_RESULT - name of the final result variable
# X_OUTPUT - name of the variable with information about error # X_OUTPUT - name of the variable with information about error
macro(_ipo_not_supported output) macro(_ipo_not_supported output)
string(COMPARE EQUAL "${X_RESULT}" "" is_empty) if(NOT X_RESULT)
if(is_empty)
message(FATAL_ERROR "IPO is not supported (${output}).") message(FATAL_ERROR "IPO is not supported (${output}).")
endif() endif()
set("${X_RESULT}" NO PARENT_SCOPE) set("${X_RESULT}" NO PARENT_SCOPE)
set("${X_OUTPUT}" "${output}" PARENT_SCOPE) if(X_OUTPUT)
set("${X_OUTPUT}" "${output}" PARENT_SCOPE)
endif()
endmacro() endmacro()
# Run IPO/LTO test # Run IPO/LTO test
@ -125,7 +126,13 @@ macro(_ipo_run_language_check language)
) )
if(NOT result) if(NOT result)
_ipo_not_supported("${output}") file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"${language} compiler IPO check failed with the following output:\n"
"${output}\n")
_ipo_not_supported("check failed to compile")
if(X_OUTPUT)
set("${X_OUTPUT}" "${output}" PARENT_SCOPE)
endif()
return() return()
endif() endif()
endmacro() endmacro()

View File

@ -881,7 +881,11 @@ function(_Boost_COMPONENT_HEADERS component _hdrs)
set(_Boost_CHRONO_HEADERS "boost/chrono.hpp") set(_Boost_CHRONO_HEADERS "boost/chrono.hpp")
set(_Boost_CONTAINER_HEADERS "boost/container/container_fwd.hpp") set(_Boost_CONTAINER_HEADERS "boost/container/container_fwd.hpp")
set(_Boost_CONTRACT_HEADERS "boost/contract.hpp") set(_Boost_CONTRACT_HEADERS "boost/contract.hpp")
set(_Boost_CONTEXT_HEADERS "boost/context/detail/fcontext.hpp") if(Boost_VERSION VERSION_LESS 106100)
set(_Boost_CONTEXT_HEADERS "boost/context/all.hpp")
else()
set(_Boost_CONTEXT_HEADERS "boost/context/detail/fcontext.hpp")
endif()
set(_Boost_COROUTINE_HEADERS "boost/coroutine/all.hpp") set(_Boost_COROUTINE_HEADERS "boost/coroutine/all.hpp")
set(_Boost_DATE_TIME_HEADERS "boost/date_time/date.hpp") set(_Boost_DATE_TIME_HEADERS "boost/date_time/date.hpp")
set(_Boost_EXCEPTION_HEADERS "boost/exception/exception.hpp") set(_Boost_EXCEPTION_HEADERS "boost/exception/exception.hpp")

View File

@ -971,7 +971,8 @@ if(NOT CUDA_VERSION VERSION_LESS "3.2")
find_cuda_helper_libs(nvcuvid) find_cuda_helper_libs(nvcuvid)
endif() endif()
endif() endif()
if(CUDA_VERSION VERSION_GREATER "5.0") if(CUDA_VERSION VERSION_GREATER "5.0" AND CUDA_VERSION VERSION_LESS "9.2")
# In CUDA 9.2 cublas_device was deprecated
find_cuda_helper_libs(cublas_device) find_cuda_helper_libs(cublas_device)
endif() endif()

View File

@ -370,6 +370,9 @@ Deprecated Hint Variables
#]=======================================================================] #]=======================================================================]
cmake_policy(PUSH)
cmake_policy(SET CMP0057 NEW) # if IN_LIST
# For backwards compatibility support # For backwards compatibility support
if(Doxygen_FIND_QUIETLY) if(Doxygen_FIND_QUIETLY)
set(DOXYGEN_FIND_QUIETLY TRUE) set(DOXYGEN_FIND_QUIETLY TRUE)
@ -1108,3 +1111,5 @@ doxygen_add_docs() for target ${targetName}")
) )
endfunction() endfunction()
cmake_policy(POP)

View File

@ -1680,7 +1680,7 @@ foreach(LANG IN ITEMS C CXX Fortran)
set(MPI_${LANG}_INCLUDE_PATH "${MPI_${LANG}_INCLUDE_DIRS}") set(MPI_${LANG}_INCLUDE_PATH "${MPI_${LANG}_INCLUDE_DIRS}")
unset(MPI_${LANG}_COMPILE_FLAGS) unset(MPI_${LANG}_COMPILE_FLAGS)
if(MPI_${LANG}_COMPILE_OPTIONS) if(MPI_${LANG}_COMPILE_OPTIONS)
set(MPI_${LANG}_COMPILE_FLAGS "${MPI_${LANG}_COMPILE_OPTIONS}") list(JOIN MPI_${LANG}_COMPILE_FLAGS " " MPI_${LANG}_COMPILE_OPTIONS)
endif() endif()
if(MPI_${LANG}_COMPILE_DEFINITIONS) if(MPI_${LANG}_COMPILE_DEFINITIONS)
foreach(_MPI_DEF IN LISTS MPI_${LANG}_COMPILE_DEFINITIONS) foreach(_MPI_DEF IN LISTS MPI_${LANG}_COMPILE_DEFINITIONS)

View File

@ -1216,21 +1216,6 @@ function(_Matlab_find_instances_win32 matlab_roots)
extract_matlab_versions_from_registry_brute_force(_matlab_versions_from_registry) extract_matlab_versions_from_registry_brute_force(_matlab_versions_from_registry)
endif() endif()
# filtering the results with the registry keys
matlab_get_all_valid_matlab_roots_from_registry("${_matlab_versions_from_registry}" _matlab_possible_roots)
unset(_matlab_versions_from_registry)
set(_matlab_versions_from_registry)
matlab_extract_all_installed_versions_from_registry(CMAKE_CL_64 _matlab_versions_from_registry)
# the returned list is empty, doing the search on all known versions
if(NOT _matlab_versions_from_registry)
if(MATLAB_FIND_DEBUG)
message(STATUS "[MATLAB] Search for Matlab from the registry unsuccessful, testing all supported versions")
endif()
extract_matlab_versions_from_registry_brute_force(_matlab_versions_from_registry)
endif()
# filtering the results with the registry keys # filtering the results with the registry keys
matlab_get_all_valid_matlab_roots_from_registry("${_matlab_versions_from_registry}" _matlab_possible_roots) matlab_get_all_valid_matlab_roots_from_registry("${_matlab_versions_from_registry}" _matlab_possible_roots)
set(${matlab_roots} ${_matlab_possible_roots} PARENT_SCOPE) set(${matlab_roots} ${_matlab_possible_roots} PARENT_SCOPE)

View File

@ -32,8 +32,10 @@ if(CMAKE_ANDROID_NDK)
) )
endif() endif()
unset(_ANDROID_STL_TYPE_FOUND) unset(_ANDROID_STL_TYPE_FOUND)
else() elseif(IS_DIRECTORY ${CMAKE_ANDROID_NDK}/sources/cxx-stl/gnu-libstdc++)
set(CMAKE_ANDROID_STL_TYPE "gnustl_static") set(CMAKE_ANDROID_STL_TYPE "gnustl_static")
else()
set(CMAKE_ANDROID_STL_TYPE "c++_static")
endif() endif()
unset(_ANDROID_STL_TYPES) unset(_ANDROID_STL_TYPES)

View File

@ -35,7 +35,18 @@ elseif(CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION)
endif() endif()
set(_ANDROID_TOOL_PATTERNS "*-${CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION}") set(_ANDROID_TOOL_PATTERNS "*-${CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION}")
else() else()
set(_ANDROID_TOOL_PATTERNS "*-[0-9].[0-9]") # If we can find any gcc toolchains then use one by default.
# Otherwise we look for clang toolchains (e.g. NDK r18+).
file(GLOB _ANDROID_CONFIG_MKS_FOR_GCC
"${CMAKE_ANDROID_NDK}/build/core/toolchains/*-[0-9].[0-9]/config.mk"
"${CMAKE_ANDROID_NDK}/toolchains/*-[0-9].[0-9]/config.mk"
)
if(_ANDROID_CONFIG_MKS_FOR_GCC)
set(_ANDROID_TOOL_PATTERNS "*-[0-9].[0-9]")
else()
set(_ANDROID_TOOL_PATTERNS "*-clang")
endif()
unset(_ANDROID_CONFIG_MKS_FOR_GCC)
endif() endif()
set(_ANDROID_CONFIG_MK_PATTERNS) set(_ANDROID_CONFIG_MK_PATTERNS)
foreach(base "build/core/toolchains" "toolchains") foreach(base "build/core/toolchains" "toolchains")

View File

@ -44,7 +44,7 @@ if(__IMPLICT_DLINK_DIRS)
endif() endif()
set(__IMPLICT_DLINK_FLAGS ) set(__IMPLICT_DLINK_FLAGS )
foreach(dir ${__IMPLICT_DLINK_DIRS}) foreach(dir ${__IMPLICT_DLINK_DIRS})
if(EXISTS "${dir}/cublas_device.lib") if(EXISTS "${dir}/curand_static.lib")
string(APPEND __IMPLICT_DLINK_FLAGS " -L\"${dir}\"") string(APPEND __IMPLICT_DLINK_FLAGS " -L\"${dir}\"")
endif() endif()
endforeach() endforeach()

View File

@ -1,5 +1,5 @@
# CMake version number components. # CMake version number components.
set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MAJOR 3)
set(CMake_VERSION_MINOR 12) set(CMake_VERSION_MINOR 12)
set(CMake_VERSION_PATCH 1) set(CMake_VERSION_PATCH 3)
#set(CMake_VERSION_RC 0) #set(CMake_VERSION_RC 0)

View File

@ -5,7 +5,6 @@
#include "cmAffinity.h" #include "cmAffinity.h"
#include "cmCTest.h" #include "cmCTest.h"
#include "cmCTestRunTest.h" #include "cmCTestRunTest.h"
#include "cmCTestScriptHandler.h"
#include "cmCTestTestHandler.h" #include "cmCTestTestHandler.h"
#include "cmSystemTools.h" #include "cmSystemTools.h"
#include "cmWorkingDirectory.h" #include "cmWorkingDirectory.h"
@ -53,6 +52,7 @@ cmCTestMultiProcessHandler::cmCTestMultiProcessHandler()
{ {
this->ParallelLevel = 1; this->ParallelLevel = 1;
this->TestLoad = 0; this->TestLoad = 0;
this->FakeLoadForTesting = 0;
this->Completed = 0; this->Completed = 0;
this->RunningCount = 0; this->RunningCount = 0;
this->ProcessorsAvailable = cmAffinity::GetProcessorsAvailable(); this->ProcessorsAvailable = cmAffinity::GetProcessorsAvailable();
@ -97,6 +97,16 @@ void cmCTestMultiProcessHandler::SetParallelLevel(size_t level)
void cmCTestMultiProcessHandler::SetTestLoad(unsigned long load) void cmCTestMultiProcessHandler::SetTestLoad(unsigned long load)
{ {
this->TestLoad = load; this->TestLoad = load;
std::string fake_load_value;
if (cmSystemTools::GetEnv("__CTEST_FAKE_LOAD_AVERAGE_FOR_TESTING",
fake_load_value)) {
if (!cmSystemTools::StringToULong(fake_load_value.c_str(),
&this->FakeLoadForTesting)) {
cmSystemTools::Error("Failed to parse fake load value: ",
fake_load_value.c_str());
}
}
} }
void cmCTestMultiProcessHandler::RunTests() void cmCTestMultiProcessHandler::RunTests()
@ -259,12 +269,19 @@ bool cmCTestMultiProcessHandler::StartTest(int test)
void cmCTestMultiProcessHandler::StartNextTests() void cmCTestMultiProcessHandler::StartNextTests()
{ {
size_t numToStart = 0; if (this->TestLoadRetryTimer.get() != nullptr) {
// This timer may be waiting to call StartNextTests again.
// Since we have been called it is no longer needed.
uv_timer_stop(this->TestLoadRetryTimer);
}
if (this->Tests.empty()) { if (this->Tests.empty()) {
this->TestLoadRetryTimer.reset();
return; return;
} }
size_t numToStart = 0;
if (this->RunningCount < this->ParallelLevel) { if (this->RunningCount < this->ParallelLevel) {
numToStart = this->ParallelLevel - this->RunningCount; numToStart = this->ParallelLevel - this->RunningCount;
} }
@ -280,7 +297,6 @@ void cmCTestMultiProcessHandler::StartNextTests()
} }
bool allTestsFailedTestLoadCheck = false; bool allTestsFailedTestLoadCheck = false;
bool usedFakeLoadForTesting = false;
size_t minProcessorsRequired = this->ParallelLevel; size_t minProcessorsRequired = this->ParallelLevel;
std::string testWithMinProcessors; std::string testWithMinProcessors;
@ -293,15 +309,11 @@ void cmCTestMultiProcessHandler::StartNextTests()
allTestsFailedTestLoadCheck = true; allTestsFailedTestLoadCheck = true;
// Check for a fake load average value used in testing. // Check for a fake load average value used in testing.
std::string fake_load_value; if (this->FakeLoadForTesting > 0) {
if (cmSystemTools::GetEnv("__CTEST_FAKE_LOAD_AVERAGE_FOR_TESTING", systemLoad = this->FakeLoadForTesting;
fake_load_value)) { // Drop the fake load for the next iteration to a value low enough
usedFakeLoadForTesting = true; // that the next iteration will start tests.
if (!cmSystemTools::StringToULong(fake_load_value.c_str(), this->FakeLoadForTesting = 1;
&systemLoad)) {
cmSystemTools::Error("Failed to parse fake load value: ",
fake_load_value.c_str());
}
} }
// If it's not set, look up the true load average. // If it's not set, look up the true load average.
else { else {
@ -385,18 +397,25 @@ void cmCTestMultiProcessHandler::StartNextTests()
} }
cmCTestLog(this->CTest, HANDLER_OUTPUT, "*****" << std::endl); cmCTestLog(this->CTest, HANDLER_OUTPUT, "*****" << std::endl);
if (usedFakeLoadForTesting) { // Wait between 1 and 5 seconds before trying again.
// Break out of the infinite loop of waiting for our fake load unsigned int milliseconds = (cmSystemTools::RandomSeed() % 5 + 1) * 1000;
// to come down. if (this->FakeLoadForTesting) {
this->StopTimePassed = true; milliseconds = 10;
} else {
// Wait between 1 and 5 seconds before trying again.
cmCTestScriptHandler::SleepInSeconds(cmSystemTools::RandomSeed() % 5 +
1);
} }
if (this->TestLoadRetryTimer.get() == nullptr) {
this->TestLoadRetryTimer.init(this->Loop, this);
}
this->TestLoadRetryTimer.start(
&cmCTestMultiProcessHandler::OnTestLoadRetryCB, milliseconds, 0);
} }
} }
void cmCTestMultiProcessHandler::OnTestLoadRetryCB(uv_timer_t* timer)
{
auto self = static_cast<cmCTestMultiProcessHandler*>(timer->data);
self->StartNextTests();
}
void cmCTestMultiProcessHandler::FinishTestProcess(cmCTestRunTest* runner, void cmCTestMultiProcessHandler::FinishTestProcess(cmCTestRunTest* runner,
bool started) bool started)
{ {

View File

@ -12,6 +12,7 @@
#include <string> #include <string>
#include <vector> #include <vector>
#include "cmUVHandlePtr.h"
#include "cm_uv.h" #include "cm_uv.h"
class cmCTest; class cmCTest;
@ -101,6 +102,8 @@ protected:
void EraseTest(int index); void EraseTest(int index);
void FinishTestProcess(cmCTestRunTest* runner, bool started); void FinishTestProcess(cmCTestRunTest* runner, bool started);
static void OnTestLoadRetryCB(uv_timer_t* timer);
void RemoveTest(int index); void RemoveTest(int index);
// Check if we need to resume an interrupted test set // Check if we need to resume an interrupted test set
void CheckResume(); void CheckResume();
@ -135,7 +138,9 @@ protected:
std::vector<cmCTestTestHandler::cmCTestTestResult>* TestResults; std::vector<cmCTestTestHandler::cmCTestTestResult>* TestResults;
size_t ParallelLevel; // max number of process that can be run at once size_t ParallelLevel; // max number of process that can be run at once
unsigned long TestLoad; unsigned long TestLoad;
unsigned long FakeLoadForTesting;
uv_loop_t Loop; uv_loop_t Loop;
cm::uv_timer_ptr TestLoadRetryTimer;
cmCTestTestHandler* TestHandler; cmCTestTestHandler* TestHandler;
cmCTest* CTest; cmCTest* CTest;
bool HasCycles; bool HasCycles;

View File

@ -478,11 +478,13 @@ int cmCTest::Initialize(const char* binary_dir, cmCTestStartCommand* command)
tag.clear(); tag.clear();
} }
std::string track; std::string track;
if (cmSystemTools::GetLineFromStream(tfin, track)) { if (cmSystemTools::GetLineFromStream(tfin, track) &&
!this->Parts[PartStart] && !command) {
this->SpecificTrack = track; this->SpecificTrack = track;
} }
std::string model; std::string model;
if (cmSystemTools::GetLineFromStream(tfin, model)) { if (cmSystemTools::GetLineFromStream(tfin, model) &&
!this->Parts[PartStart] && !command) {
this->TestModel = GetTestModelFromString(model.c_str()); this->TestModel = GetTestModelFromString(model.c_str());
} }
tfin.close(); tfin.close();

View File

@ -1143,6 +1143,11 @@ bool cmExportFileGenerator::PopulateExportProperties(
return false; return false;
} }
auto propertyValue = targetProperties.GetPropertyValue(prop); auto propertyValue = targetProperties.GetPropertyValue(prop);
if (propertyValue == nullptr) {
// Asked to export a property that isn't defined on the target. Do not
// consider this an error, there's just nothing to export.
continue;
}
std::string evaluatedValue = cmGeneratorExpression::Preprocess( std::string evaluatedValue = cmGeneratorExpression::Preprocess(
propertyValue, cmGeneratorExpression::StripAllGeneratorExpressions); propertyValue, cmGeneratorExpression::StripAllGeneratorExpressions);
if (evaluatedValue != propertyValue) { if (evaluatedValue != propertyValue) {

View File

@ -5227,10 +5227,14 @@ bool cmGeneratorTarget::HasLanguage(std::string const& language,
{ {
std::set<std::string> languages; std::set<std::string> languages;
this->GetLanguages(languages, config); this->GetLanguages(languages, config);
// The "exclusive" check applies only to source files and not
// the linker language which may be affected by dependencies.
if (exclusive && languages.size() > 1) {
return false;
}
// add linker language (if it is different from compiler languages) // add linker language (if it is different from compiler languages)
languages.insert(this->GetLinkerLanguage(config)); languages.insert(this->GetLinkerLanguage(config));
return (languages.size() == 1 || !exclusive) && return languages.count(language) > 0;
languages.count(language) > 0;
} }
void cmGeneratorTarget::ComputeLinkImplementationLanguages( void cmGeneratorTarget::ComputeLinkImplementationLanguages(

View File

@ -366,7 +366,7 @@ public:
// Evaluate if the target uses the given language for compilation // Evaluate if the target uses the given language for compilation
// and/or linking. If 'exclusive' is true, 'language' is expected // and/or linking. If 'exclusive' is true, 'language' is expected
// to be the only language used for the target. // to be the only language used in source files for the target.
bool HasLanguage(std::string const& language, std::string const& config, bool HasLanguage(std::string const& language, std::string const& config,
bool exclusive = true) const; bool exclusive = true) const;

View File

@ -170,3 +170,10 @@ void cmGlobVerificationManager::AddCacheEntry(
value.Backtraces.emplace_back(variable, backtrace); value.Backtraces.emplace_back(variable, backtrace);
} }
} }
void cmGlobVerificationManager::Reset()
{
this->Cache.clear();
this->VerifyScript.clear();
this->VerifyStamp.clear();
}

View File

@ -37,6 +37,9 @@ protected:
const std::string& variable, const std::string& variable,
const cmListFileBacktrace& bt); const cmListFileBacktrace& bt);
///! Clear the glob cache for state reset.
void Reset();
///! Check targets should be written in generated build system. ///! Check targets should be written in generated build system.
bool DoWriteVerifyTarget() const; bool DoWriteVerifyTarget() const;

View File

@ -267,6 +267,7 @@ cmStateSnapshot cmState::Reset()
{ {
this->GlobalProperties.clear(); this->GlobalProperties.clear();
this->PropertyDefinitions.clear(); this->PropertyDefinitions.clear();
this->GlobVerificationManager->Reset();
cmStateDetail::PositionType pos = this->SnapshotData.Truncate(); cmStateDetail::PositionType pos = this->SnapshotData.Truncate();
this->ExecutionListFiles.Truncate(); this->ExecutionListFiles.Truncate();

View File

@ -1207,7 +1207,11 @@ void cmVisualStudio10TargetGenerator::WriteCustomCommands(Elem& e0)
this->GeneratorTarget->GetName() != CMAKE_CHECK_BUILD_SYSTEM_TARGET) { this->GeneratorTarget->GetName() != CMAKE_CHECK_BUILD_SYSTEM_TARGET) {
if (cmSourceFile const* sf = if (cmSourceFile const* sf =
this->LocalGenerator->CreateVCProjBuildRule()) { this->LocalGenerator->CreateVCProjBuildRule()) {
this->WriteCustomCommand(e0, sf); // Write directly rather than through WriteCustomCommand because
// we do not want the de-duplication and it has no dependencies.
if (cmCustomCommand const* command = sf->GetCustomCommand()) {
this->WriteCustomRule(e0, sf, *command);
}
} }
} }
} }
@ -2409,10 +2413,12 @@ bool cmVisualStudio10TargetGenerator::ComputeClOptions(
} }
// Choose a language whose flags to use for ClCompile. // Choose a language whose flags to use for ClCompile.
static const char* clLangs[] = { "CXX", "C", "Fortran", "CSharp" }; static const char* clLangs[] = { "CXX", "C", "Fortran" };
std::string langForClCompile; std::string langForClCompile;
if (std::find(cm::cbegin(clLangs), cm::cend(clLangs), linkLanguage) != if (this->ProjectType == csproj) {
cm::cend(clLangs)) { langForClCompile = "CSharp";
} else if (std::find(cm::cbegin(clLangs), cm::cend(clLangs), linkLanguage) !=
cm::cend(clLangs)) {
langForClCompile = linkLanguage; langForClCompile = linkLanguage;
} else { } else {
std::set<std::string> languages; std::set<std::string> languages;

View File

@ -21,3 +21,9 @@ target_link_libraries(CSharpLinkToCxx CLIApp)
# because it is unmanaged # because it is unmanaged
add_library(CppNativeApp SHARED cpp_native.hpp cpp_native.cpp) add_library(CppNativeApp SHARED cpp_native.hpp cpp_native.cpp)
target_link_libraries(CSharpLinkToCxx CppNativeApp) target_link_libraries(CSharpLinkToCxx CppNativeApp)
# Link a static C++ library into the CSharp executable.
# We do not actually use any symbols but this helps cover
# link language selection.
add_library(CppStaticLib STATIC cpp_static.cpp)
target_link_libraries(CSharpLinkToCxx CppStaticLib)

View File

@ -0,0 +1,3 @@
void cpp_static()
{
}

View File

@ -3,6 +3,9 @@
#include <cuda_runtime.h> #include <cuda_runtime.h>
#include <iostream> #include <iostream>
// this test only makes sense for versions of CUDA that ships
// static libraries that have separable compilation device symbols
#if __CUDACC_VER_MAJOR__ <= 9
__global__ void deviceCublasSgemm(int n, float alpha, float beta, __global__ void deviceCublasSgemm(int n, float alpha, float beta,
const float* d_A, const float* d_B, const float* d_A, const float* d_B,
float* d_C) float* d_C)
@ -22,6 +25,7 @@ __global__ void deviceCublasSgemm(int n, float alpha, float beta,
cublasDestroy(cnpHandle); cublasDestroy(cnpHandle);
} }
#endif
int choose_cuda_device() int choose_cuda_device()
{ {
@ -63,6 +67,7 @@ int main(int argc, char** argv)
return 0; return 0;
} }
#if __CUDACC_VER_MAJOR__ <= 9
// initial values that will make sure that the cublasSgemm won't actually // initial values that will make sure that the cublasSgemm won't actually
// do any work // do any work
int n = 0; int n = 0;
@ -72,6 +77,7 @@ int main(int argc, char** argv)
float* d_B = nullptr; float* d_B = nullptr;
float* d_C = nullptr; float* d_C = nullptr;
deviceCublasSgemm<<<1, 1>>>(n, alpha, beta, d_A, d_B, d_C); deviceCublasSgemm<<<1, 1>>>(n, alpha, beta, d_A, d_B, d_C);
#endif
return 0; return 0;
} }

View File

@ -61,8 +61,12 @@ foreach(ndk IN LISTS TEST_ANDROID_NDK)
list(APPEND _abis_${_version} ${_abis}) list(APPEND _abis_${_version} ${_abis})
endif() endif()
endforeach() endforeach()
set(_abis_ ${_abis_${_latest_gcc}})
set(_abis_clang ${_abis_${_latest_clang}}) set(_abis_clang ${_abis_${_latest_clang}})
if(_latest_gcc)
set(_abis_ ${_abis_${_latest_gcc}})
else()
set(_abis_ ${_abis_clang})
endif()
if(_versions MATCHES "clang") if(_versions MATCHES "clang")
set(_versions "clang" ${_versions}) set(_versions "clang" ${_versions})
endif() endif()
@ -132,10 +136,11 @@ foreach(ndk IN LISTS TEST_ANDROID_NDK)
set(stl_types set(stl_types
none none
system system
gnustl_static
gnustl_shared
) )
if(IS_DIRECTORY "${ndk}/sources/cxx-stl/gnu-libstdc++")
list(APPEND stl_types gnustl_static gnustl_shared)
endif()
if(IS_DIRECTORY "${ndk}/sources/cxx-stl/gabi++/libs") if(IS_DIRECTORY "${ndk}/sources/cxx-stl/gabi++/libs")
list(APPEND stl_types gabi++_static gabi++_shared) list(APPEND stl_types gabi++_static gabi++_shared)
endif() endif()

View File

@ -8,7 +8,6 @@ endif()
foreach(f foreach(f
"${CMAKE_C_ANDROID_TOOLCHAIN_PREFIX}gcc${CMAKE_C_ANDROID_TOOLCHAIN_SUFFIX}" "${CMAKE_C_ANDROID_TOOLCHAIN_PREFIX}gcc${CMAKE_C_ANDROID_TOOLCHAIN_SUFFIX}"
"${CMAKE_CXX_ANDROID_TOOLCHAIN_PREFIX}g++${CMAKE_CXX_ANDROID_TOOLCHAIN_SUFFIX}" "${CMAKE_CXX_ANDROID_TOOLCHAIN_PREFIX}g++${CMAKE_CXX_ANDROID_TOOLCHAIN_SUFFIX}"
"${CMAKE_CXX_ANDROID_TOOLCHAIN_PREFIX}cpp${CMAKE_CXX_ANDROID_TOOLCHAIN_SUFFIX}"
"${CMAKE_CXX_ANDROID_TOOLCHAIN_PREFIX}ar${CMAKE_CXX_ANDROID_TOOLCHAIN_SUFFIX}" "${CMAKE_CXX_ANDROID_TOOLCHAIN_PREFIX}ar${CMAKE_CXX_ANDROID_TOOLCHAIN_SUFFIX}"
"${CMAKE_CXX_ANDROID_TOOLCHAIN_PREFIX}ld${CMAKE_CXX_ANDROID_TOOLCHAIN_SUFFIX}" "${CMAKE_CXX_ANDROID_TOOLCHAIN_PREFIX}ld${CMAKE_CXX_ANDROID_TOOLCHAIN_SUFFIX}"
) )
@ -61,10 +60,12 @@ execute_process(
if(NOT _res EQUAL 0) if(NOT _res EQUAL 0)
message(SEND_ERROR "Failed to run 'gcc -dumpmachine':\n ${_res}") message(SEND_ERROR "Failed to run 'gcc -dumpmachine':\n ${_res}")
endif() endif()
if(NOT _out STREQUAL "${CMAKE_C_ANDROID_TOOLCHAIN_MACHINE}") string(REPLACE "--" "-" _out_check "${_out}")
if(NOT _out_check STREQUAL "${CMAKE_C_ANDROID_TOOLCHAIN_MACHINE}"
AND NOT (_out STREQUAL "arm--linux-android" AND CMAKE_C_ANDROID_TOOLCHAIN_MACHINE STREQUAL "arm-linux-androideabi"))
message(SEND_ERROR "'gcc -dumpmachine' produced:\n" message(SEND_ERROR "'gcc -dumpmachine' produced:\n"
" ${_out}\n" " ${_out}\n"
"which is not equal to CMAKE_C_ANDROID_TOOLCHAIN_MACHINE:\n" "which does not match CMAKE_C_ANDROID_TOOLCHAIN_MACHINE:\n"
" ${CMAKE_C_ANDROID_TOOLCHAIN_MACHINE}" " ${CMAKE_C_ANDROID_TOOLCHAIN_MACHINE}"
) )
endif() endif()

View File

@ -111,8 +111,8 @@ endfunction()
set(ENV{__CTEST_FAKE_LOAD_AVERAGE_FOR_TESTING} 5) set(ENV{__CTEST_FAKE_LOAD_AVERAGE_FOR_TESTING} 5)
# Verify that new tests are not started when the load average exceeds # Verify that new tests are not started when the load average exceeds
# our threshold. # our threshold and that they then run once the load average drops.
run_TestLoad(test-load-fail 2) run_TestLoad(test-load-wait 3)
# Verify that warning message is displayed but tests still start when # Verify that warning message is displayed but tests still start when
# an invalid argument is given. # an invalid argument is given.

View File

@ -1 +0,0 @@
No tests were found!!!

View File

@ -1,2 +0,0 @@
^Test project .*/Tests/RunCMake/CTestCommandLine/TestLoad
\*\*\*\*\* WAITING, System Load: 5, Max Allowed Load: 2, Smallest test TestLoad[1-2] requires 1\*\*\*\*\*

View File

@ -0,0 +1,8 @@
^Test project .*/Tests/RunCMake/CTestCommandLine/TestLoad
\*\*\*\*\* WAITING, System Load: 5, Max Allowed Load: 3, Smallest test TestLoad[1-2] requires 1\*\*\*\*\*
Start 1: TestLoad1
Start 2: TestLoad2
1/2 Test #[1-2]: TestLoad[1-2] ........................ Passed +[0-9.]+ sec
2/2 Test #[1-2]: TestLoad[1-2] ........................ Passed +[0-9.]+ sec
+
100% tests passed, 0 tests failed out of 2

View File

@ -0,0 +1,8 @@
Run dashboard with model Experimental
Source directory: .*/Tests/RunCMake/ctest_start/NoAppendDifferentTrack
Build directory: .*/Tests/RunCMake/ctest_start/NoAppendDifferentTrack-build
Track: ExperimentalDifferent
Reading ctest configuration file: .*/Tests/RunCMake/ctest_start/NoAppendDifferentTrack/CTestConfig.cmake
Site: test-site
Build name: test-build-name
Use ExperimentalDifferent tag: [0-9-]+

View File

@ -30,6 +30,7 @@ run_ctest_start(AppendSameModel Continuous APPEND)
run_ctest_start(AppendDifferentModel Experimental APPEND) run_ctest_start(AppendDifferentModel Experimental APPEND)
run_ctest_start(AppendNoModel APPEND) run_ctest_start(AppendNoModel APPEND)
run_ctest_start(AppendDifferentTrack TRACK ExperimentalDifferent APPEND) run_ctest_start(AppendDifferentTrack TRACK ExperimentalDifferent APPEND)
run_ctest_start(NoAppendDifferentTrack Experimental TRACK ExperimentalDifferent)
run_ctest_start(AppendNoMatchingTrack Continuous APPEND) run_ctest_start(AppendNoMatchingTrack Continuous APPEND)
run_ctest_start(AppendOldContinuous Continuous APPEND) run_ctest_start(AppendOldContinuous Continuous APPEND)
run_ctest_start(AppendOldNoModel APPEND) run_ctest_start(AppendOldNoModel APPEND)

View File

@ -14,7 +14,7 @@ function(setup_tests)
ctest_start(${ctest_start_args}) ctest_start(${ctest_start_args})
endfunction() endfunction()
if("@CASE_NAME@" MATCHES "^Append") if("@CASE_NAME@" MATCHES "^(No)?Append")
if("@CASE_NAME@" MATCHES "^AppendNoMatchingTrack$") if("@CASE_NAME@" MATCHES "^AppendNoMatchingTrack$")
file(WRITE "${CTEST_BINARY_DIRECTORY}/Testing/TAG" "19551112-2204\nSomeWeirdTrackName\n") file(WRITE "${CTEST_BINARY_DIRECTORY}/Testing/TAG" "19551112-2204\nSomeWeirdTrackName\n")
else() else()

View File

@ -1 +0,0 @@
(-1|255)

View File

@ -1 +0,0 @@
No tests were found!!!

View File

@ -1,2 +0,0 @@
Test project .*/Tests/RunCMake/ctest_test/CTestTestLoadFail-build
\*\*\*\*\* WAITING, System Load: 5, Max Allowed Load: 4, Smallest test RunCMakeVersion requires 1\*\*\*\*\*$

View File

@ -0,0 +1,8 @@
Test project .*/Tests/RunCMake/ctest_test/CTestTestLoadWait-build
\*\*\*\*\* WAITING, System Load: 5, Max Allowed Load: 4, Smallest test RunCMakeVersion requires 1\*\*\*\*\*
Start 1: RunCMakeVersion
1/1 Test #1: RunCMakeVersion .................. Passed +[0-9.]+ sec
+
100% tests passed, 0 tests failed out of 1
+
Total Test time \(real\) = +[0-9.]+ sec$

View File

@ -21,8 +21,8 @@ set(ENV{__CTEST_FAKE_LOAD_AVERAGE_FOR_TESTING} 5)
run_ctest_test(TestLoadPass TEST_LOAD 6) run_ctest_test(TestLoadPass TEST_LOAD 6)
# Verify that new tests are not started when the load average exceeds # Verify that new tests are not started when the load average exceeds
# our threshold. # our threshold and that they then run once the load average drops.
run_ctest_test(TestLoadFail TEST_LOAD 2) run_ctest_test(TestLoadWait TEST_LOAD 2)
# Verify that when an invalid "TEST_LOAD" value is given, a warning # Verify that when an invalid "TEST_LOAD" value is given, a warning
# message is displayed and the value is ignored. # message is displayed and the value is ignored.
@ -34,9 +34,9 @@ set(CASE_CTEST_TEST_LOAD 7)
run_ctest_test(CTestTestLoadPass) run_ctest_test(CTestTestLoadPass)
# Verify that new tests are not started when the load average exceeds # Verify that new tests are not started when the load average exceeds
# our threshold. # our threshold and that they then run once the load average drops.
set(CASE_CTEST_TEST_LOAD 4) set(CASE_CTEST_TEST_LOAD 4)
run_ctest_test(CTestTestLoadFail) run_ctest_test(CTestTestLoadWait)
# Verify that when an invalid "CTEST_TEST_LOAD" value is given, # Verify that when an invalid "CTEST_TEST_LOAD" value is given,
# a warning message is displayed and the value is ignored. # a warning message is displayed and the value is ignored.

View File

@ -1 +0,0 @@
(-1|255)

View File

@ -1 +0,0 @@
No tests were found!!!

View File

@ -1,2 +0,0 @@
Test project .*/Tests/RunCMake/ctest_test/TestLoadFail-build
\*\*\*\*\* WAITING, System Load: 5, Max Allowed Load: 2, Smallest test RunCMakeVersion requires 1\*\*\*\*\*$

View File

@ -0,0 +1,8 @@
Test project .*/Tests/RunCMake/ctest_test/TestLoadWait-build
\*\*\*\*\* WAITING, System Load: 5, Max Allowed Load: 2, Smallest test RunCMakeVersion requires 1\*\*\*\*\*
Start 1: RunCMakeVersion
1/1 Test #1: RunCMakeVersion .................. Passed +[0-9.]+ sec
+
100% tests passed, 0 tests failed out of 1
+
Total Test time \(real\) = +[0-9.]+ sec$

View File

@ -0,0 +1,11 @@
enable_language(CXX)
add_library(foo empty.cpp)
set_target_properties(foo PROPERTIES
EXPORT_PROPERTIES "NotDefinedProp"
)
export(TARGETS foo FILE "${CMAKE_CURRENT_BINARY_DIR}/foo.cmake")
install(TARGETS foo EXPORT fooExport
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
)

View File

@ -8,3 +8,4 @@ run_cmake(NoExportSet)
run_cmake(ForbiddenToExportInterfaceProperties) run_cmake(ForbiddenToExportInterfaceProperties)
run_cmake(ForbiddenToExportImportedProperties) run_cmake(ForbiddenToExportImportedProperties)
run_cmake(ForbiddenToExportPropertyWithGenExp) run_cmake(ForbiddenToExportPropertyWithGenExp)
run_cmake(ExportPropertiesUndefined)

View File

@ -28,7 +28,8 @@
#include <openssl/hmac.h> #include <openssl/hmac.h>
#include <openssl/opensslv.h> #include <openssl/opensslv.h>
#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER) #if OPENSSL_VERSION_NUMBER < 0x10100000L || \
(defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x20700000L)
#include <stdlib.h> /* malloc, free */ #include <stdlib.h> /* malloc, free */
#include <string.h> /* memset */ #include <string.h> /* memset */
static inline HMAC_CTX *HMAC_CTX_new(void) static inline HMAC_CTX *HMAC_CTX_new(void)

View File

@ -425,19 +425,22 @@ static ssize_t uv__fs_scandir(uv_fs_t* req) {
return n; return n;
} }
#if defined(_POSIX_PATH_MAX)
# define UV__FS_PATH_MAX _POSIX_PATH_MAX
#elif defined(PATH_MAX)
# define UV__FS_PATH_MAX PATH_MAX
#else
# define UV__FS_PATH_MAX_FALLBACK 8192
# define UV__FS_PATH_MAX UV__FS_PATH_MAX_FALLBACK
#endif
static ssize_t uv__fs_pathmax_size(const char* path) { static ssize_t uv__fs_pathmax_size(const char* path) {
ssize_t pathmax; ssize_t pathmax;
pathmax = pathconf(path, _PC_PATH_MAX); pathmax = pathconf(path, _PC_PATH_MAX);
if (pathmax == -1) { if (pathmax == -1)
#if defined(PATH_MAX) pathmax = UV__FS_PATH_MAX;
return PATH_MAX;
#else
#error "PATH_MAX undefined in the current platform"
#endif
}
return pathmax; return pathmax;
} }
@ -446,7 +449,28 @@ static ssize_t uv__fs_readlink(uv_fs_t* req) {
ssize_t len; ssize_t len;
char* buf; char* buf;
#if defined(UV__FS_PATH_MAX_FALLBACK)
/* We may not have a real PATH_MAX. Read size of link. */
struct stat st;
int ret;
ret = lstat(req->path, &st);
if (ret != 0)
return -1;
if (!S_ISLNK(st.st_mode)) {
errno = EINVAL;
return -1;
}
len = st.st_size;
/* According to readlink(2) lstat can report st_size == 0
for some symlinks, such as those in /proc or /sys. */
if (len == 0)
len = uv__fs_pathmax_size(req->path);
#else
len = uv__fs_pathmax_size(req->path); len = uv__fs_pathmax_size(req->path);
#endif
buf = uv__malloc(len + 1); buf = uv__malloc(len + 1);
if (buf == NULL) { if (buf == NULL) {
@ -473,9 +497,15 @@ static ssize_t uv__fs_readlink(uv_fs_t* req) {
} }
static ssize_t uv__fs_realpath(uv_fs_t* req) { static ssize_t uv__fs_realpath(uv_fs_t* req) {
ssize_t len;
char* buf; char* buf;
#if defined(_POSIX_VERSION) && _POSIX_VERSION >= 200809L
buf = realpath(req->path, NULL);
if (buf == NULL)
return -1;
#else
ssize_t len;
len = uv__fs_pathmax_size(req->path); len = uv__fs_pathmax_size(req->path);
buf = uv__malloc(len + 1); buf = uv__malloc(len + 1);
@ -488,6 +518,7 @@ static ssize_t uv__fs_realpath(uv_fs_t* req) {
uv__free(buf); uv__free(buf);
return -1; return -1;
} }
#endif
req->ptr = buf; req->ptr = buf;