diff options
Diffstat (limited to 'Source')
-rw-r--r-- | Source/CMakeVersion.cmake | 2 | ||||
-rw-r--r-- | Source/CPack/cmCPackDebGenerator.cxx | 2 | ||||
-rw-r--r-- | Source/cmCoreTryCompile.cxx | 23 | ||||
-rw-r--r-- | Source/cmMakefileExecutableTargetGenerator.cxx | 4 | ||||
-rw-r--r-- | Source/cmNinjaNormalTargetGenerator.cxx | 4 | ||||
-rw-r--r-- | Source/cmQtAutoGenInitializer.cxx | 6 | ||||
-rw-r--r-- | Source/cmQtAutoGeneratorMocUic.cxx | 10 | ||||
-rw-r--r-- | Source/cmTryRunCommand.cxx | 3 | ||||
-rw-r--r-- | Source/cmVSSetupHelper.cxx | 33 | ||||
-rw-r--r-- | Source/cmVSSetupHelper.h | 1 | ||||
-rw-r--r-- | Source/cmVisualStudio10TargetGenerator.cxx | 3 | ||||
-rw-r--r-- | Source/cmcmd.cxx | 4 | ||||
-rw-r--r-- | Source/kwsys/SystemTools.cxx | 32 |
13 files changed, 85 insertions, 42 deletions
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 9d6704e..e4f11ed 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 13) -set(CMake_VERSION_PATCH 20181130) +set(CMake_VERSION_PATCH 20181206) #set(CMake_VERSION_RC 1) diff --git a/Source/CPack/cmCPackDebGenerator.cxx b/Source/CPack/cmCPackDebGenerator.cxx index ea0ee58..29968af 100644 --- a/Source/CPack/cmCPackDebGenerator.cxx +++ b/Source/CPack/cmCPackDebGenerator.cxx @@ -80,7 +80,7 @@ DebGenerator::DebGenerator( , WorkDir(workDir) , TopLevelDir(topLevelDir) , TemporaryDir(temporaryDir) - , DebianArchiveType(debianArchiveType ? debianArchiveType : "paxr") + , DebianArchiveType(debianArchiveType ? debianArchiveType : "gnutar") , ControlValues(controlValues) , GenShLibs(genShLibs) , ShLibsFilename(shLibsFilename) diff --git a/Source/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx index f6ec606..541ae76 100644 --- a/Source/cmCoreTryCompile.cxx +++ b/Source/cmCoreTryCompile.cxx @@ -121,6 +121,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv, std::string cxxExtensions; std::string cudaExtensions; std::vector<std::string> targets; + std::vector<std::string> linkOptions; std::string libsToLink = " "; bool useOldLinkLibs = true; char targetNameBuf[64]; @@ -144,6 +145,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv, DoingNone, DoingCMakeFlags, DoingCompileDefinitions, + DoingLinkOptions, DoingLinkLibraries, DoingOutputVariable, DoingCopyFile, @@ -165,6 +167,8 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv, doing = DoingCMakeFlags; } else if (argv[i] == "COMPILE_DEFINITIONS") { doing = DoingCompileDefinitions; + } else if (argv[i] == "LINK_OPTIONS") { + doing = DoingLinkOptions; } else if (argv[i] == "LINK_LIBRARIES") { doing = DoingLinkLibraries; useOldLinkLibs = false; @@ -208,6 +212,8 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv, cmakeFlags.push_back(argv[i]); } else if (doing == DoingCompileDefinitions) { compileDefs.push_back(argv[i]); + } else if (doing == DoingLinkOptions) { + linkOptions.push_back(argv[i]); } else if (doing == DoingLinkLibraries) { libsToLink += "\"" + cmSystemTools::TrimWhitespace(argv[i]) + "\" "; if (cmTarget* tgt = this->Makefile->FindTargetToUse(argv[i])) { @@ -814,6 +820,23 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv, } } + if (!linkOptions.empty()) { + std::vector<std::string> options; + options.reserve(linkOptions.size()); + for (const auto& option : linkOptions) { + options.emplace_back(cmOutputConverter::EscapeForCMake(option)); + } + + if (targetType == cmStateEnums::STATIC_LIBRARY) { + fprintf(fout, + "set_property(TARGET %s PROPERTY STATIC_LIBRARY_OPTIONS %s)\n", + targetName.c_str(), cmJoin(options, " ").c_str()); + } else { + fprintf(fout, "target_link_options(%s PRIVATE %s)\n", + targetName.c_str(), cmJoin(options, " ").c_str()); + } + } + if (useOldLinkLibs) { fprintf(fout, "target_link_libraries(%s ${LINK_LIBRARIES})\n", targetName.c_str()); diff --git a/Source/cmMakefileExecutableTargetGenerator.cxx b/Source/cmMakefileExecutableTargetGenerator.cxx index 08bb2ce..846b12c 100644 --- a/Source/cmMakefileExecutableTargetGenerator.cxx +++ b/Source/cmMakefileExecutableTargetGenerator.cxx @@ -84,6 +84,10 @@ void cmMakefileExecutableTargetGenerator::WriteDeviceExecutableRule( bool relink) { #ifdef CMAKE_BUILD_WITH_CMAKE + if (!this->GlobalGenerator->GetLanguageEnabled("CUDA")) { + return; + } + const std::string cuda_lang("CUDA"); cmGeneratorTarget::LinkClosure const* closure = this->GeneratorTarget->GetLinkClosure(this->ConfigName); diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx index 1386706..c953d20 100644 --- a/Source/cmNinjaNormalTargetGenerator.cxx +++ b/Source/cmNinjaNormalTargetGenerator.cxx @@ -557,6 +557,10 @@ std::vector<std::string> cmNinjaNormalTargetGenerator::ComputeLinkCmd() void cmNinjaNormalTargetGenerator::WriteDeviceLinkStatement() { + if (!this->GetGlobalGenerator()->GetLanguageEnabled("CUDA")) { + return; + } + cmGeneratorTarget& genTarget = *this->GetGeneratorTarget(); // determine if we need to do any device linking for this target diff --git a/Source/cmQtAutoGenInitializer.cxx b/Source/cmQtAutoGenInitializer.cxx index 730bdb7..d4819a3 100644 --- a/Source/cmQtAutoGenInitializer.cxx +++ b/Source/cmQtAutoGenInitializer.cxx @@ -521,6 +521,12 @@ bool cmQtAutoGenInitializer::InitMoc() [this, localGen](std::string const& cfg) -> std::set<std::string> { std::set<std::string> defines; localGen->GetTargetDefines(this->Target, cfg, "CXX", defines); +#ifdef _WIN32 + if (this->Moc.PredefsCmd.empty()) { + // Add WIN32 definition if we don't have a moc_predefs.h + defines.insert("WIN32"); + } +#endif return defines; }; diff --git a/Source/cmQtAutoGeneratorMocUic.cxx b/Source/cmQtAutoGeneratorMocUic.cxx index 2e6f90f..446ef9a 100644 --- a/Source/cmQtAutoGeneratorMocUic.cxx +++ b/Source/cmQtAutoGeneratorMocUic.cxx @@ -1279,16 +1279,6 @@ bool cmQtAutoGeneratorMocUic::Init(cmMakefile* makefile) Moc_.SkipList.insert(lst.begin(), lst.end()); } Moc_.Definitions = InfoGetConfigList("AM_MOC_DEFINITIONS"); -#ifdef _WIN32 - { - std::string win32("WIN32"); - auto itB = Moc().Definitions.cbegin(); - auto itE = Moc().Definitions.cend(); - if (std::find(itB, itE, win32) == itE) { - Moc_.Definitions.emplace_back(std::move(win32)); - } - } -#endif Moc_.IncludePaths = InfoGetConfigList("AM_MOC_INCLUDES"); Moc_.Options = InfoGetList("AM_MOC_OPTIONS"); Moc_.RelaxedMode = InfoGetBool("AM_MOC_RELAXED_MODE"); diff --git a/Source/cmTryRunCommand.cxx b/Source/cmTryRunCommand.cxx index 9396138..fafbd24 100644 --- a/Source/cmTryRunCommand.cxx +++ b/Source/cmTryRunCommand.cxx @@ -45,7 +45,8 @@ bool cmTryRunCommand::InitialPass(std::vector<std::string> const& argv, if (argv[i] == "ARGS") { ++i; while (i < argv.size() && argv[i] != "COMPILE_DEFINITIONS" && - argv[i] != "CMAKE_FLAGS" && argv[i] != "LINK_LIBRARIES") { + argv[i] != "CMAKE_FLAGS" && argv[i] != "LINK_OPTIONS" && + argv[i] != "LINK_LIBRARIES") { runArgs += " "; runArgs += argv[i]; ++i; diff --git a/Source/cmVSSetupHelper.cxx b/Source/cmVSSetupHelper.cxx index 22fe007..7a54e12 100644 --- a/Source/cmVSSetupHelper.cxx +++ b/Source/cmVSSetupHelper.cxx @@ -267,6 +267,19 @@ bool cmVSSetupAPIHelper::GetVCToolsetVersion(std::string& vsToolsetVersion) return isInstalled && !vsToolsetVersion.empty(); } +bool cmVSSetupAPIHelper::IsEWDKEnabled() +{ + std::string envEnterpriseWDK, envDisableRegistryUse; + cmSystemTools::GetEnv("EnterpriseWDK", envEnterpriseWDK); + cmSystemTools::GetEnv("DisableRegistryUse", envDisableRegistryUse); + if (!cmSystemTools::Strucmp(envEnterpriseWDK.c_str(), "True") && + !cmSystemTools::Strucmp(envDisableRegistryUse.c_str(), "True")) { + return true; + } + + return false; +} + bool cmVSSetupAPIHelper::EnumerateAndChooseVSInstance() { bool isVSInstanceExists = false; @@ -274,6 +287,26 @@ bool cmVSSetupAPIHelper::EnumerateAndChooseVSInstance() return true; } + if (this->IsEWDKEnabled()) { + std::string envWindowsSdkDir81, envVSVersion, envVsInstallDir; + + cmSystemTools::GetEnv("WindowsSdkDir_81", envWindowsSdkDir81); + cmSystemTools::GetEnv("VisualStudioVersion", envVSVersion); + cmSystemTools::GetEnv("VSINSTALLDIR", envVsInstallDir); + if (envVSVersion.empty() || envVsInstallDir.empty()) + return false; + + chosenInstanceInfo.VSInstallLocation = + std::wstring(envVsInstallDir.begin(), envVsInstallDir.end()); + chosenInstanceInfo.Version = + std::wstring(envVSVersion.begin(), envVSVersion.end()); + chosenInstanceInfo.VCToolsetVersion = envVSVersion; + chosenInstanceInfo.ullVersion = std::stoi(envVSVersion); + chosenInstanceInfo.IsWin10SDKInstalled = true; + chosenInstanceInfo.IsWin81SDKInstalled = !envWindowsSdkDir81.empty(); + return true; + } + if (initializationFailure || setupConfig == NULL || setupConfig2 == NULL || setupHelper == NULL) return false; diff --git a/Source/cmVSSetupHelper.h b/Source/cmVSSetupHelper.h index 4144c15..b9cca45 100644 --- a/Source/cmVSSetupHelper.h +++ b/Source/cmVSSetupHelper.h @@ -150,6 +150,7 @@ private: HRESULT comInitialized; // current best instance of VS selected VSInstanceInfo chosenInstanceInfo; + bool IsEWDKEnabled(); std::string SpecifiedVSInstallLocation; }; diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index e9a1a67..7d7defc 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -3319,7 +3319,8 @@ bool cmVisualStudio10TargetGenerator::ComputeLinkOptions( std::vector<std::string> vsTargetVec; this->AddLibraries(cli, libVec, vsTargetVec, config); if (std::find(linkClosure->Languages.begin(), linkClosure->Languages.end(), - "CUDA") != linkClosure->Languages.end()) { + "CUDA") != linkClosure->Languages.end() && + this->CudaOptions[config] != nullptr) { switch (this->CudaOptions[config]->GetCudaRuntime()) { case cmVisualStudioGeneratorOptions::CudaRuntimeStatic: libVec.push_back("cudadevrt.lib"); diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx index 45881aa..930ced9 100644 --- a/Source/cmcmd.cxx +++ b/Source/cmcmd.cxx @@ -691,6 +691,8 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args) if (args[1] == "touch" && args.size() > 2) { for (std::string::size_type cc = 2; cc < args.size(); cc++) { if (!cmSystemTools::Touch(args[cc], true)) { + std::cerr << "cmake -E touch: failed to update \""; + std::cerr << args[cc] << "\".\n"; return 1; } } @@ -701,6 +703,8 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args) if (args[1] == "touch_nocreate" && args.size() > 2) { for (std::string::size_type cc = 2; cc < args.size(); cc++) { if (!cmSystemTools::Touch(args[cc], false)) { + std::cerr << "cmake -E touch_nocreate: failed to update \""; + std::cerr << args[cc] << "\".\n"; return 1; } } diff --git a/Source/kwsys/SystemTools.cxx b/Source/kwsys/SystemTools.cxx index 0a4ad7a..331f16e 100644 --- a/Source/kwsys/SystemTools.cxx +++ b/Source/kwsys/SystemTools.cxx @@ -1355,39 +1355,15 @@ bool SystemTools::Touch(const std::string& filename, bool create) } CloseHandle(h); #elif KWSYS_CXX_HAS_UTIMENSAT - struct timespec times[2] = { { 0, UTIME_OMIT }, { 0, UTIME_NOW } }; - if (utimensat(AT_FDCWD, filename.c_str(), times, 0) < 0) { + // utimensat is only available on newer Unixes and macOS 10.13+ + if (utimensat(AT_FDCWD, filename.c_str(), NULL, 0) < 0) { return false; } #else - struct stat st; - if (stat(filename.c_str(), &st) < 0) { - return false; - } - struct timeval mtime; - gettimeofday(&mtime, 0); -# if KWSYS_CXX_HAS_UTIMES - struct timeval atime; -# if KWSYS_CXX_STAT_HAS_ST_MTIM - atime.tv_sec = st.st_atim.tv_sec; - atime.tv_usec = st.st_atim.tv_nsec / 1000; -# elif KWSYS_CXX_STAT_HAS_ST_MTIMESPEC - atime.tv_sec = st.st_atimespec.tv_sec; - atime.tv_usec = st.st_atimespec.tv_nsec / 1000; -# else - atime.tv_sec = st.st_atime; - atime.tv_usec = 0; -# endif - struct timeval times[2] = { atime, mtime }; - if (utimes(filename.c_str(), times) < 0) { + // fall back to utimes + if (utimes(filename.c_str(), NULL) < 0) { return false; } -# else - struct utimbuf times = { st.st_atime, mtime.tv_sec }; - if (utime(filename.c_str(), ×) < 0) { - return false; - } -# endif #endif return true; } |