diff options
47 files changed, 335 insertions, 139 deletions
diff --git a/CompileFlags.cmake b/CompileFlags.cmake index 24ac58d..873af8f 100644 --- a/CompileFlags.cmake +++ b/CompileFlags.cmake @@ -19,7 +19,6 @@ endif() if(CMAKE_GENERATOR MATCHES "Visual Studio 6") set(CMAKE_SKIP_COMPATIBILITY_TESTS 1) endif() -include (${CMAKE_ROOT}/Modules/CMakeBackwardCompatibilityCXX.cmake) if(WIN32 AND "${CMAKE_C_COMPILER_ID}" MATCHES "^(Intel)$") set(_INTEL_WINDOWS 1) @@ -54,6 +53,14 @@ if(CMAKE_SYSTEM MATCHES "OSF1-V.*") endif() endif() +if(CMAKE_SYSTEM_NAME MATCHES "HP-UX" AND CMAKE_CXX_COMPILER_ID MATCHES "HP") + # it is known that version 3.85 fails and 6.25 works without these flags + if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4) + # use new C++ library and improved template support + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -AA +hpxstd98") + endif() +endif() + # use the ansi CXX compile flag for building cmake if (CMAKE_ANSI_CXXFLAGS) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_ANSI_CXXFLAGS}") @@ -68,3 +75,5 @@ endif () if (CMAKE_SYSTEM_NAME STREQUAL Linux AND CMAKE_SYSTEM_PROCESSOR STREQUAL parisc) set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--unique=.text._*") endif () + +include (${CMAKE_ROOT}/Modules/CMakeBackwardCompatibilityCXX.cmake) diff --git a/Help/release/dev/ExternalProject_exclude-from-all.rst b/Help/release/dev/ExternalProject_exclude-from-all.rst new file mode 100644 index 0000000..1d62b3a --- /dev/null +++ b/Help/release/dev/ExternalProject_exclude-from-all.rst @@ -0,0 +1,11 @@ +ExternalProject_exclude-from-all +-------------------------------- + +* The :module:`ExternalProject` module ``ExternalProject_Add`` command + learned a new ``EXCLUDE_FROM_ALL`` option to cause the external + project target to have the :prop_tgt:`EXCLUDE_FROM_ALL` target + property set. + +* The :module:`ExternalProject` module ``ExternalProject_Add_Step`` command + learned a new ``EXCLUDE_FROM_MAIN`` option to cause the step to not be + a direct dependency of the main external project target. diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake index 0f651e9..3ba91de 100644 --- a/Modules/ExternalProject.cmake +++ b/Modules/ExternalProject.cmake @@ -1352,7 +1352,7 @@ function(_ep_add_download_command name) if(cmd_set) set(work_dir ${download_dir}) elseif(cvs_repository) - find_package(CVS) + find_package(CVS QUIET) if(NOT CVS_EXECUTABLE) message(FATAL_ERROR "error: could not find cvs for checkout of ${name}") endif() @@ -1379,7 +1379,7 @@ function(_ep_add_download_command name) set(cmd ${CVS_EXECUTABLE} -d ${cvs_repository} -q co ${cvs_tag} -d ${src_name} ${cvs_module}) list(APPEND depends ${stamp_dir}/${name}-cvsinfo.txt) elseif(svn_repository) - find_package(Subversion) + find_package(Subversion QUIET) if(NOT Subversion_SVN_EXECUTABLE) message(FATAL_ERROR "error: could not find svn for checkout of ${name}") endif() @@ -1415,7 +1415,7 @@ function(_ep_add_download_command name) --non-interactive ${svn_trust_cert_args} ${svn_user_pw_args} ${src_name}) list(APPEND depends ${stamp_dir}/${name}-svninfo.txt) elseif(git_repository) - find_package(Git) + find_package(Git QUIET) if(NOT GIT_EXECUTABLE) message(FATAL_ERROR "error: could not find git for clone of ${name}") endif() @@ -1463,7 +1463,7 @@ function(_ep_add_download_command name) set(cmd ${CMAKE_COMMAND} -P ${tmp_dir}/${name}-gitclone.cmake) list(APPEND depends ${stamp_dir}/${name}-gitinfo.txt) elseif(hg_repository) - find_package(Hg) + find_package(Hg QUIET) if(NOT HG_EXECUTABLE) message(FATAL_ERROR "error: could not find hg for clone of ${name}") endif() diff --git a/Modules/Qt4Macros.cmake b/Modules/Qt4Macros.cmake index aca8996..23c4fc0 100644 --- a/Modules/Qt4Macros.cmake +++ b/Modules/Qt4Macros.cmake @@ -103,7 +103,7 @@ endmacro() # helper macro to set up a moc rule -macro (QT4_CREATE_MOC_COMMAND infile outfile moc_flags moc_options moc_target) +function (QT4_CREATE_MOC_COMMAND infile outfile moc_flags moc_options moc_target) # For Windows, create a parameters file to work around command line length limit # Pass the parameters in a file. Set the working directory to # be that containing the parameters file and reference it by @@ -144,7 +144,7 @@ macro (QT4_CREATE_MOC_COMMAND infile outfile moc_flags moc_options moc_target) DEPENDS ${infile} ${_moc_parameters_file} ${_moc_working_dir} VERBATIM) -endmacro () +endfunction () macro (QT4_GENERATE_MOC infile outfile ) diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 7b9db16..65f9b38 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 0) -set(CMake_VERSION_PATCH 20140403) +set(CMake_VERSION_PATCH 20140410) #set(CMake_VERSION_RC 1) diff --git a/Source/CPack/cmCPackGenerator.h b/Source/CPack/cmCPackGenerator.h index efd3bef..e780f0e 100644 --- a/Source/CPack/cmCPackGenerator.h +++ b/Source/CPack/cmCPackGenerator.h @@ -22,9 +22,10 @@ // Forward declarations are insufficient since we use them in // std::map data members below... -#define cmCPackTypeMacro(class, superclass) \ - cmTypeMacro(class, superclass); \ - static cmCPackGenerator* CreateGenerator() { return new class; } +#define cmCPackTypeMacro(klass, superclass) \ + cmTypeMacro(klass, superclass); \ + static cmCPackGenerator* CreateGenerator() { return new klass; } \ + class cmCPackTypeMacro_UseTrailingSemicolon #define cmCPackLogger(logType, msg) \ do { \ diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index 9f711b7..d797d3b 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -217,8 +217,6 @@ int cmCTest::HTTPRequest(std::string url, HTTPMethod method, url += "?" + fields; } break; - default: - break; } ::curl_easy_setopt(curl, CURLOPT_URL, url.c_str()); diff --git a/Source/cmCTest.h b/Source/cmCTest.h index 836e41d..246294f 100644 --- a/Source/cmCTest.h +++ b/Source/cmCTest.h @@ -134,7 +134,7 @@ public: /* * Is the tomorrow tag set? */ - bool GetTomorrowTag() { return this->TomorrowTag; }; + bool GetTomorrowTag() { return this->TomorrowTag; } /** * Try to run tests of the project @@ -167,7 +167,7 @@ public: * Set the cmake test mode (experimental, nightly, continuous). */ void SetTestModel(int mode); - int GetTestModel() { return this->TestModel; }; + int GetTestModel() { return this->TestModel; } std::string GetTestModelString(); static int GetTestModelFromString(const char* str); @@ -392,7 +392,7 @@ public: int ReadCustomConfigurationFileTree(const char* dir, cmMakefile* mf); std::vector<std::string> &GetInitialCommandLineArguments() - { return this->InitialCommandLineArguments; }; + { return this->InitialCommandLineArguments; } //! Set the track to submit to void SetSpecificTrack(const char* track); diff --git a/Source/cmCommand.h b/Source/cmCommand.h index b15869a..a34ea71 100644 --- a/Source/cmCommand.h +++ b/Source/cmCommand.h @@ -81,7 +81,7 @@ public: * not implement this method. At this point, reading and * writing to the cache can be done. */ - virtual void FinalPass() {}; + virtual void FinalPass() {} /** * Does this command have a final pass? Query after InitialPass. diff --git a/Source/cmCommandArgumentLexer.cxx b/Source/cmCommandArgumentLexer.cxx index e62e53e..e23ef8a 100644 --- a/Source/cmCommandArgumentLexer.cxx +++ b/Source/cmCommandArgumentLexer.cxx @@ -1069,7 +1069,7 @@ case YY_STATE_EOF(NOESCAPES): "fatal flex scanner internal error--no action found" ); } /* end of action switch */ } /* end of scanning one token */ -return 0; /* this should not happend but it should silence a warning */ +return 0; /* this should not happen but it quiets some compilers */ } /* end of cmCommandArgument_yylex */ /* yy_get_next_buffer - try to read in a new buffer diff --git a/Source/cmCryptoHash.cxx b/Source/cmCryptoHash.cxx index 0d3c6bb..74e17b6 100644 --- a/Source/cmCryptoHash.cxx +++ b/Source/cmCryptoHash.cxx @@ -38,7 +38,7 @@ cmsys::auto_ptr<cmCryptoHash> cmCryptoHash::New(const char* algo) std::string cmCryptoHash::HashString(const std::string& input) { this->Initialize(); - this->Append(reinterpret_cast<unsigned char const*>(&input[0]), + this->Append(reinterpret_cast<unsigned char const*>(input.c_str()), static_cast<int>(input.size())); return this->Finalize(); } diff --git a/Source/cmDepends.h b/Source/cmDepends.h index b293c5b..4f6517e 100644 --- a/Source/cmDepends.h +++ b/Source/cmDepends.h @@ -32,7 +32,7 @@ public: cmDepends(cmLocalGenerator* lg=0, const char* targetDir=""); /** at what level will the compile be done from */ - void SetCompileDirectory(const char *dir) {this->CompileDirectory = dir;}; + void SetCompileDirectory(const char *dir) {this->CompileDirectory = dir;} /** Set the local generator for the directory in which we are scanning dependencies. This is not a full local generator; it diff --git a/Source/cmDependsJavaLexer.cxx b/Source/cmDependsJavaLexer.cxx index 1e505a5..f7676d9 100644 --- a/Source/cmDependsJavaLexer.cxx +++ b/Source/cmDependsJavaLexer.cxx @@ -1591,7 +1591,7 @@ case YY_STATE_EOF(string): "fatal flex scanner internal error--no action found" ); } /* end of action switch */ } /* end of scanning one token */ -return 0; /* this should not happen but it silences a warning*/ +return 0; /* this should not happen but it quiets some compilers */ } /* end of cmDependsJava_yylex */ /* yy_get_next_buffer - try to read in a new buffer diff --git a/Source/cmDynamicLoader.h b/Source/cmDynamicLoader.h index acf8011..d038b5c 100644 --- a/Source/cmDynamicLoader.h +++ b/Source/cmDynamicLoader.h @@ -36,8 +36,8 @@ public: static void FlushCache(); protected: - cmDynamicLoader() {}; - ~cmDynamicLoader() {}; + cmDynamicLoader() {} + ~cmDynamicLoader() {} private: cmDynamicLoader(const cmDynamicLoader&); // Not implemented. diff --git a/Source/cmExecutionStatus.h b/Source/cmExecutionStatus.h index 1488924..5c94a97 100644 --- a/Source/cmExecutionStatus.h +++ b/Source/cmExecutionStatus.h @@ -24,7 +24,7 @@ class cmExecutionStatus : public cmObject public: cmTypeMacro(cmExecutionStatus, cmObject); - cmExecutionStatus() { this->Clear();}; + cmExecutionStatus() { this->Clear();} virtual void SetReturnInvoked(bool val) { this->ReturnInvoked = val; } diff --git a/Source/cmExprLexer.cxx b/Source/cmExprLexer.cxx index aa384cd..4704f03 100644 --- a/Source/cmExprLexer.cxx +++ b/Source/cmExprLexer.cxx @@ -976,7 +976,7 @@ case YY_STATE_EOF(INITIAL): "fatal flex scanner internal error--no action found" ); } /* end of action switch */ } /* end of scanning one token */ -return 0; /* this should not happen but it silences a warning*/ +return 0; /* this should not happen but it quiets some compilers */ } /* end of cmExpr_yylex */ /* yy_get_next_buffer - try to read in a new buffer diff --git a/Source/cmFunctionCommand.cxx b/Source/cmFunctionCommand.cxx index 3ff527d..3580374 100644 --- a/Source/cmFunctionCommand.cxx +++ b/Source/cmFunctionCommand.cxx @@ -20,7 +20,7 @@ public: cmFunctionHelperCommand() {} ///! clean up any memory allocated by the function - ~cmFunctionHelperCommand() {}; + ~cmFunctionHelperCommand() {} /** * This is used to avoid including this command @@ -59,7 +59,7 @@ public: cmExecutionStatus &); virtual bool InitialPass(std::vector<std::string> const&, - cmExecutionStatus &) { return false; }; + cmExecutionStatus &) { return false; } /** * The name of the command as specified in CMakeList.txt. diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index 01fad26..ec5ce9e 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -606,12 +606,13 @@ private: cmGlobalGenerator const* GlobalGenerator; typedef cmGeneratorTarget::SourceEntry SourceEntry; SourceEntry* CurrentEntry; - std::queue<std::string> SourceQueue; - std::set<std::string> SourcesQueued; + std::queue<cmSourceFile*> SourceQueue; + std::set<cmSourceFile*> SourcesQueued; typedef std::map<std::string, cmSourceFile*> NameMapType; NameMapType NameMap; + std::vector<std::string> NewSources; - void QueueSource(std::string const& name); + void QueueSource(cmSourceFile* sf); void FollowName(std::string const& name); void FollowNames(std::vector<std::string> const& names); bool IsUtility(std::string const& dep); @@ -636,26 +637,26 @@ cmTargetTraceDependencies // Queue all the source files already specified for the target. if (this->Target->GetType() != cmTarget::INTERFACE_LIBRARY) { - std::vector<std::string> sources; std::vector<std::string> configs; this->Makefile->GetConfigurations(configs); if (configs.empty()) { configs.push_back(""); } + std::set<cmSourceFile*> emitted; for(std::vector<std::string>::const_iterator ci = configs.begin(); ci != configs.end(); ++ci) { + std::vector<cmSourceFile*> sources; this->Target->GetSourceFiles(sources, *ci); - } - std::set<std::string> emitted; - for(std::vector<std::string>::const_iterator si = sources.begin(); - si != sources.end(); ++si) - { - if(emitted.insert(*si).second && this->SourcesQueued.insert(*si).second) + for(std::vector<cmSourceFile*>::const_iterator si = sources.begin(); + si != sources.end(); ++si) { - this->SourceQueue.push(*si); - this->Makefile->GetOrCreateSource(*si); + cmSourceFile* sf = *si; + if(emitted.insert(sf).second && this->SourcesQueued.insert(sf).second) + { + this->SourceQueue.push(sf); + } } } } @@ -673,8 +674,7 @@ void cmTargetTraceDependencies::Trace() while(!this->SourceQueue.empty()) { // Get the next source from the queue. - std::string src = this->SourceQueue.front(); - cmSourceFile* sf = this->Makefile->GetSource(src); + cmSourceFile* sf = this->SourceQueue.front(); this->SourceQueue.pop(); this->CurrentEntry = &this->GeneratorTarget->SourceEntries[sf]; @@ -699,17 +699,19 @@ void cmTargetTraceDependencies::Trace() } } this->CurrentEntry = 0; + + this->Target->AddTracedSources(this->NewSources); } //---------------------------------------------------------------------------- -void cmTargetTraceDependencies::QueueSource(std::string const& name) +void cmTargetTraceDependencies::QueueSource(cmSourceFile* sf) { - if(this->SourcesQueued.insert(name).second) + if(this->SourcesQueued.insert(sf).second) { - this->SourceQueue.push(name); + this->SourceQueue.push(sf); - // Make sure this file is in the target. - this->Target->AddSource(name); + // Make sure this file is in the target at the end. + this->NewSources.push_back(sf->GetFullPath()); } } @@ -731,7 +733,7 @@ void cmTargetTraceDependencies::FollowName(std::string const& name) { this->CurrentEntry->Depends.push_back(sf); } - this->QueueSource(sf->GetFullPath()); + this->QueueSource(sf); } } diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h index 54f5f3b..82fb1e5 100644 --- a/Source/cmGlobalGenerator.h +++ b/Source/cmGlobalGenerator.h @@ -51,7 +51,7 @@ public: virtual cmLocalGenerator *CreateLocalGenerator(); ///! Get the name for this generator - virtual std::string GetName() const { return "Generic"; }; + virtual std::string GetName() const { return "Generic"; } /** Check whether the given name matches the current generator. */ virtual bool MatchesGeneratorName(const std::string& name) const diff --git a/Source/cmIfCommand.h b/Source/cmIfCommand.h index b9de845..814c052 100644 --- a/Source/cmIfCommand.h +++ b/Source/cmIfCommand.h @@ -58,7 +58,7 @@ public: * the CMakeLists.txt file. */ virtual bool InitialPass(std::vector<std::string> const&, - cmExecutionStatus &) { return false;}; + cmExecutionStatus &) { return false;} /** * The name of the command as specified in CMakeList.txt. diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index dcf9f97..1e65a02 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -2283,7 +2283,6 @@ bool cmLocalGenerator::GetShouldUseOldFlags(bool shared, case cmPolicies::REQUIRED_IF_USED: case cmPolicies::REQUIRED_ALWAYS: case cmPolicies::NEW: - default: return false; } } diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h index 61488fe..8f30149 100644 --- a/Source/cmLocalGenerator.h +++ b/Source/cmLocalGenerator.h @@ -76,17 +76,17 @@ public: ///! Get the makefile for this generator cmMakefile *GetMakefile() { - return this->Makefile; }; + return this->Makefile; } ///! Get the makefile for this generator, const version const cmMakefile *GetMakefile() const { - return this->Makefile; }; + return this->Makefile; } ///! Get the GlobalGenerator this is associated with cmGlobalGenerator *GetGlobalGenerator() { - return this->GlobalGenerator; }; + return this->GlobalGenerator; } const cmGlobalGenerator *GetGlobalGenerator() const { - return this->GlobalGenerator; }; + return this->GlobalGenerator; } ///! Set the Global Generator, done on creation by the GlobalGenerator void SetGlobalGenerator(cmGlobalGenerator *gg); @@ -135,7 +135,7 @@ public: ///! set/get the children void AddChild(cmLocalGenerator* g) { this->Children.push_back(g); } - std::vector<cmLocalGenerator*>& GetChildren() { return this->Children; }; + std::vector<cmLocalGenerator*>& GetChildren() { return this->Children; } void AddArchitectureFlags(std::string& flags, cmGeneratorTarget* target, diff --git a/Source/cmMacroCommand.cxx b/Source/cmMacroCommand.cxx index 9f569e1..ae81c58 100644 --- a/Source/cmMacroCommand.cxx +++ b/Source/cmMacroCommand.cxx @@ -20,7 +20,7 @@ public: cmMacroHelperCommand() {} ///! clean up any memory allocated by the macro - ~cmMacroHelperCommand() {}; + ~cmMacroHelperCommand() {} /** * This is used to avoid including this command @@ -60,7 +60,7 @@ public: cmExecutionStatus &); virtual bool InitialPass(std::vector<std::string> const&, - cmExecutionStatus &) { return false; }; + cmExecutionStatus &) { return false; } /** * The name of the command as specified in CMakeList.txt. diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index b1d6fe2..1328974 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -3365,7 +3365,6 @@ std::string cmMakefile::GetModulesFile(const char* filename) const case cmPolicies::REQUIRED_IF_USED: case cmPolicies::REQUIRED_ALWAYS: case cmPolicies::NEW: - default: result = moduleInCMakeRoot; break; } diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index 8ff6daa..7695d6e 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -601,8 +601,11 @@ public: */ std::vector<std::string> GetDefinitions(int cacheonly=0) const; - /** Test a boolean cache entry to see if it is true or false, - * returns false if no entry defined. + /** + * Test a boolean variable to see if it is true or false. + * If the variable is not found in this makefile instance, the + * cache is then queried. + * Returns false if no entry defined. */ bool IsOn(const std::string& name) const; bool IsSet(const std::string& name) const; @@ -815,7 +818,7 @@ public: const std::string& config); // Get the properties - cmPropertyMap &GetProperties() { return this->Properties; }; + cmPropertyMap &GetProperties() { return this->Properties; } ///! Initialize a makefile from its parent void InitializeFromParent(); diff --git a/Source/cmNewLineStyle.cxx b/Source/cmNewLineStyle.cxx index a7d7429..08f0b5b 100644 --- a/Source/cmNewLineStyle.cxx +++ b/Source/cmNewLineStyle.cxx @@ -76,8 +76,6 @@ const std::string cmNewLineStyle::GetCharacters() const return "\n"; case CRLF: return "\r\n"; - default: - ; } return ""; } diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx index 56155ef..cb6eb90 100644 --- a/Source/cmNinjaTargetGenerator.cxx +++ b/Source/cmNinjaTargetGenerator.cxx @@ -494,6 +494,9 @@ cmNinjaTargetGenerator { cmCustomCommand const* cc = (*si)->GetCustomCommand(); this->GetLocalGenerator()->AddCustomCommandTarget(cc, this->GetTarget()); + // Record the custom commands for this target. The container is used + // in WriteObjectBuildStatement when called in a loop below. + this->CustomCommands.push_back((*si)->GetCustomCommand()); } std::vector<cmSourceFile const*> headerSources; this->GeneratorTarget->GetHeaderSources(headerSources, config); @@ -565,14 +568,11 @@ cmNinjaTargetGenerator } // Add order-only dependencies on custom command outputs. - std::vector<cmSourceFile const*> customCommands; - std::string config = this->Makefile->GetSafeDefinition("CMAKE_BUILD_TYPE"); - this->GeneratorTarget->GetCustomCommands(customCommands, config); - for(std::vector<cmSourceFile const*>::const_iterator - si = customCommands.begin(); - si != customCommands.end(); ++si) + for(std::vector<cmCustomCommand const*>::const_iterator + cci = this->CustomCommands.begin(); + cci != this->CustomCommands.end(); ++cci) { - cmCustomCommand const* cc = (*si)->GetCustomCommand(); + cmCustomCommand const* cc = *cci; cmCustomCommandGenerator ccg(*cc, this->GetConfigName(), this->GetMakefile()); const std::vector<std::string>& ccoutputs = ccg.GetOutputs(); diff --git a/Source/cmNinjaTargetGenerator.h b/Source/cmNinjaTargetGenerator.h index 8669e6e..8073af2 100644 --- a/Source/cmNinjaTargetGenerator.h +++ b/Source/cmNinjaTargetGenerator.h @@ -153,6 +153,7 @@ private: cmLocalNinjaGenerator* LocalGenerator; /// List of object files for this target. cmNinjaDeps Objects; + std::vector<cmCustomCommand const*> CustomCommands; typedef std::map<std::string, std::string> LanguageFlagMap; LanguageFlagMap LanguageFlags; diff --git a/Source/cmProperty.h b/Source/cmProperty.h index 789be1d..34897e8 100644 --- a/Source/cmProperty.h +++ b/Source/cmProperty.h @@ -31,7 +31,7 @@ public: const char *GetValue() const; // construct with the value not set - cmProperty() { this->ValueHasBeenSet = false; }; + cmProperty() { this->ValueHasBeenSet = false; } protected: std::string Name; diff --git a/Source/cmPropertyDefinition.h b/Source/cmPropertyDefinition.h index 9ca8222..098fadb 100644 --- a/Source/cmPropertyDefinition.h +++ b/Source/cmPropertyDefinition.h @@ -33,22 +33,22 @@ public: bool chained); /// Default constructor - cmPropertyDefinition() { this->Chained = false; }; + cmPropertyDefinition() { this->Chained = false; } /// Is the property chained? - bool IsChained() const { return this->Chained; }; + bool IsChained() const { return this->Chained; } /// Get the scope cmProperty::ScopeType GetScope() const { - return this->Scope; }; + return this->Scope; } /// Get the documentation (short version) const std::string &GetShortDescription() const { - return this->ShortDescription; }; + return this->ShortDescription; } /// Get the documentation (full version) const std::string &GetFullDescription() const { - return this->FullDescription; }; + return this->FullDescription; } protected: std::string Name; diff --git a/Source/cmPropertyMap.h b/Source/cmPropertyMap.h index fa33848..02d4235 100644 --- a/Source/cmPropertyMap.h +++ b/Source/cmPropertyMap.h @@ -31,9 +31,9 @@ public: cmProperty::ScopeType scope, bool &chain) const; - void SetCMakeInstance(cmake *cm) { this->CMakeInstance = cm; }; + void SetCMakeInstance(cmake *cm) { this->CMakeInstance = cm; } - cmPropertyMap() { this->CMakeInstance = 0;}; + cmPropertyMap() { this->CMakeInstance = 0;} private: cmake *CMakeInstance; diff --git a/Source/cmSourceFile.h b/Source/cmSourceFile.h index 755a2cf..a1d9de1 100644 --- a/Source/cmSourceFile.h +++ b/Source/cmSourceFile.h @@ -89,7 +89,7 @@ public: void AddDepend(const char* d) { this->Depends.push_back(d); } // Get the properties - cmPropertyMap &GetProperties() { return this->Properties; }; + cmPropertyMap &GetProperties() { return this->Properties; } /** * Check whether the given source file location could refer to this diff --git a/Source/cmStandardIncludes.h b/Source/cmStandardIncludes.h index ed8efcc..3731502 100644 --- a/Source/cmStandardIncludes.h +++ b/Source/cmStandardIncludes.h @@ -324,12 +324,12 @@ struct cmDocumentationEntry { std::string Name; std::string Brief; - cmDocumentationEntry(){}; + cmDocumentationEntry(){} cmDocumentationEntry(const char *doc[2]) { if (doc[0]) this->Name = doc[0]; - if (doc[1]) this->Brief = doc[1];}; + if (doc[1]) this->Brief = doc[1];} cmDocumentationEntry(const char *n, const char *b) - { if (n) this->Name = n; if (b) this->Brief = b; }; + { if (n) this->Name = n; if (b) this->Brief = b; } }; /** Data structure to represent a single command line. */ @@ -378,7 +378,8 @@ static thisClass* SafeDownCast(cmObject *c) \ return static_cast<thisClass *>(c); \ } \ return 0;\ -} +} \ +class cmTypeMacro_UseTrailingSemicolon inline bool cmHasLiteralPrefixImpl(const std::string &str1, const char *str2, diff --git a/Source/cmStringCommand.h b/Source/cmStringCommand.h index 5b7412d..51069e7 100644 --- a/Source/cmStringCommand.h +++ b/Source/cmStringCommand.h @@ -83,7 +83,7 @@ protected: RegexReplacement(const char* s): number(-1), value(s) {} RegexReplacement(const std::string& s): number(-1), value(s) {} RegexReplacement(int n): number(n), value() {} - RegexReplacement() {}; + RegexReplacement() {} int number; std::string value; }; diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index c1c33f2..c27b561 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -1616,8 +1616,8 @@ long copy_data(struct archive *ar, struct archive *aw) return (r); } } -#if !defined(__clang__) - return r; /* this should not happen but it silences a warning */ +#if !defined(__clang__) && !defined(__HP_aCC) + return r; /* this should not happen but it quiets some compilers */ #endif } diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index a87ec31..1f8cddb 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -138,6 +138,10 @@ public: LinkClosureMapType; LinkClosureMapType LinkClosureMap; + typedef std::map<TargetConfigPair, std::vector<cmSourceFile*> > + SourceFilesMapType; + SourceFilesMapType SourceFilesMap; + struct TargetPropertyEntry { TargetPropertyEntry(cmsys::auto_ptr<cmCompiledGeneratorExpression> cge, const std::string &targetName = std::string()) @@ -225,6 +229,7 @@ cmTarget::cmTarget() this->DebugCompileOptionsDone = false; this->DebugCompileDefinitionsDone = false; this->DebugSourcesDone = false; + this->LinkImplementationLanguageIsContextDependent = true; } //---------------------------------------------------------------------------- @@ -457,6 +462,7 @@ void cmTarget::FinishConfigure() //---------------------------------------------------------------------------- void cmTarget::ClearLinkMaps() { + this->LinkImplementationLanguageIsContextDependent = true; this->Internal->LinkImplMap.clear(); this->Internal->LinkInterfaceMap.clear(); this->Internal->LinkClosureMap.clear(); @@ -548,7 +554,7 @@ bool cmTarget::IsBundleOnApple() const } //---------------------------------------------------------------------------- -static void processSources(cmTarget const* tgt, +static bool processSources(cmTarget const* tgt, const std::vector<cmTargetInternals::TargetPropertyEntry*> &entries, std::vector<std::string> &srcs, std::set<std::string> &uniqueSrcs, @@ -558,6 +564,8 @@ static void processSources(cmTarget const* tgt, { cmMakefile *mf = tgt->GetMakefile(); + bool contextDependent = false; + for (std::vector<cmTargetInternals::TargetPropertyEntry*>::const_iterator it = entries.begin(), end = entries.end(); it != end; ++it) { @@ -572,8 +580,12 @@ static void processSources(cmTarget const* tgt, tgt, dagChecker), entrySources); - if (mf->IsGeneratingBuildSystem() - && !(*it)->ge->GetHadContextSensitiveCondition()) + + if ((*it)->ge->GetHadContextSensitiveCondition()) + { + contextDependent = true; + } + else if (mf->IsGeneratingBuildSystem()) { cacheSources = true; } @@ -594,7 +606,7 @@ static void processSources(cmTarget const* tgt, cm->IssueMessage(cmake::FATAL_ERROR, e, tgt->GetBacktrace()); } - return; + return contextDependent; } } if (cacheSources) @@ -625,6 +637,7 @@ static void processSources(cmTarget const* tgt, + usedSources, (*it)->ge->GetBacktrace()); } } + return contextDependent; } //---------------------------------------------------------------------------- @@ -660,7 +673,7 @@ void cmTarget::GetSourceFiles(std::vector<std::string> &files, "SOURCES", 0, 0); std::set<std::string> uniqueSrcs; - processSources(this, + bool contextDependentDirectSources = processSources(this, this->Internal->SourceEntries, files, uniqueSrcs, @@ -712,7 +725,8 @@ void cmTarget::GetSourceFiles(std::vector<std::string> &files, } } - processSources(this, + std::vector<std::string>::size_type numFilesBefore = files.size(); + bool contextDependentInterfaceSources = processSources(this, this->Internal->CachedLinkInterfaceSourcesEntries[config], files, uniqueSrcs, @@ -721,6 +735,12 @@ void cmTarget::GetSourceFiles(std::vector<std::string> &files, config, debugSources); + if (!contextDependentDirectSources + && !(contextDependentInterfaceSources && numFilesBefore < files.size())) + { + this->LinkImplementationLanguageIsContextDependent = false; + } + if (!this->Makefile->IsGeneratingBuildSystem()) { deleteAndClear(this->Internal->CachedLinkInterfaceSourcesEntries); @@ -793,42 +813,109 @@ void cmTarget::GetSourceFiles(std::vector<cmSourceFile*> &files, const std::string& config, cmTarget const* head) const { - std::vector<std::string> srcs; - this->GetSourceFiles(srcs, config, head); - std::set<cmSourceFile*> emitted; + // Lookup any existing link implementation for this configuration. + TargetConfigPair key(head, cmSystemTools::UpperCase(config)); - for(std::vector<std::string>::const_iterator i = srcs.begin(); - i != srcs.end(); ++i) + if(!this->LinkImplementationLanguageIsContextDependent) + { + files = this->Internal->SourceFilesMap.begin()->second; + return; + } + + cmTargetInternals::SourceFilesMapType::iterator + it = this->Internal->SourceFilesMap.find(key); + if(it != this->Internal->SourceFilesMap.end()) { - cmSourceFile* sf = this->Makefile->GetOrCreateSource(*i); - if (emitted.insert(sf).second) + files = it->second; + } + else + { + std::vector<std::string> srcs; + this->GetSourceFiles(srcs, config, head); + + std::set<cmSourceFile*> emitted; + + for(std::vector<std::string>::const_iterator i = srcs.begin(); + i != srcs.end(); ++i) { - files.push_back(sf); + cmSourceFile* sf = this->Makefile->GetOrCreateSource(*i); + if (emitted.insert(sf).second) + { + files.push_back(sf); + } } + this->Internal->SourceFilesMap[key] = files; + } +} + +//---------------------------------------------------------------------------- +void cmTarget::AddTracedSources(std::vector<std::string> const& srcs) +{ + std::string srcFiles; + const char* sep = ""; + for(std::vector<std::string>::const_iterator i = srcs.begin(); + i != srcs.end(); ++i) + { + std::string filename = *i; + srcFiles += sep; + srcFiles += filename; + sep = ";"; + } + if (!srcFiles.empty()) + { + this->Internal->SourceFilesMap.clear(); + this->LinkImplementationLanguageIsContextDependent = true; + cmListFileBacktrace lfbt; + this->Makefile->GetBacktrace(lfbt); + cmGeneratorExpression ge(lfbt); + cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(srcFiles); + cge->SetEvaluateForBuildsystem(true); + this->Internal->SourceEntries.push_back( + new cmTargetInternals::TargetPropertyEntry(cge)); } } //---------------------------------------------------------------------------- void cmTarget::AddSources(std::vector<std::string> const& srcs) { + std::string srcFiles; + const char* sep = ""; for(std::vector<std::string>::const_iterator i = srcs.begin(); i != srcs.end(); ++i) { - const char* src = i->c_str(); - if(src[0] == '$' && src[1] == '<') - { - this->AddSource(src); - } - else + std::string filename = *i; + const char* src = filename.c_str(); + + if(!(src[0] == '$' && src[1] == '<')) { - this->AddSourceCMP0049(src); + filename = this->ProcessSourceItemCMP0049(filename); + if (cmSystemTools::GetErrorOccuredFlag()) + { + return; + } + this->Makefile->GetOrCreateSource(filename); } + srcFiles += sep; + srcFiles += filename; + sep = ";"; + } + if (!srcFiles.empty()) + { + this->Internal->SourceFilesMap.clear(); + this->LinkImplementationLanguageIsContextDependent = true; + cmListFileBacktrace lfbt; + this->Makefile->GetBacktrace(lfbt); + cmGeneratorExpression ge(lfbt); + cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(srcFiles); + cge->SetEvaluateForBuildsystem(true); + this->Internal->SourceEntries.push_back( + new cmTargetInternals::TargetPropertyEntry(cge)); } } //---------------------------------------------------------------------------- -cmSourceFile* cmTarget::AddSourceCMP0049(const std::string& s) +std::string cmTarget::ProcessSourceItemCMP0049(const std::string& s) { std::string src = s; @@ -863,10 +950,22 @@ cmSourceFile* cmTarget::AddSourceCMP0049(const std::string& s) this->Makefile->IssueMessage(messageType, e.str()); if (messageType == cmake::FATAL_ERROR) { - return 0; + return ""; } } } + return src; +} + +//---------------------------------------------------------------------------- +cmSourceFile* cmTarget::AddSourceCMP0049(const std::string& s) +{ + std::string src = this->ProcessSourceItemCMP0049(s); + + if (cmSystemTools::GetErrorOccuredFlag()) + { + return 0; + } return this->AddSource(src); } @@ -939,6 +1038,8 @@ cmSourceFile* cmTarget::AddSource(const std::string& src) TargetPropertyEntryFinder(sfl)) == this->Internal->SourceEntries.end()) { + this->Internal->SourceFilesMap.clear(); + this->LinkImplementationLanguageIsContextDependent = true; cmListFileBacktrace lfbt; this->Makefile->GetBacktrace(lfbt); cmGeneratorExpression ge(lfbt); @@ -1708,6 +1809,7 @@ void cmTarget::SetProperty(const std::string& prop, const char* value) this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); return; } + this->Internal->SourceFilesMap.clear(); cmListFileBacktrace lfbt; this->Makefile->GetBacktrace(lfbt); cmGeneratorExpression ge(lfbt); @@ -1794,7 +1896,7 @@ void cmTarget::AppendProperty(const std::string& prop, const char* value, this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); return; } - + this->Internal->SourceFilesMap.clear(); cmListFileBacktrace lfbt; this->Makefile->GetBacktrace(lfbt); cmGeneratorExpression ge(lfbt); @@ -2684,7 +2786,6 @@ cmTarget::OutputInfo const* cmTarget::GetOutputInfo( msg += " which has type "; msg += cmTarget::GetTargetTypeName(this->GetType()); this->GetMakefile()->IssueMessage(cmake::INTERNAL_ERROR, msg); - abort(); return 0; } @@ -2729,7 +2830,6 @@ cmTarget::CompileInfo const* cmTarget::GetCompileInfo( msg += " which has type "; msg += cmTarget::GetTargetTypeName(this->GetType()); this->GetMakefile()->IssueMessage(cmake::INTERNAL_ERROR, msg); - abort(); return 0; } diff --git a/Source/cmTarget.h b/Source/cmTarget.h index 33db768..92b5201 100644 --- a/Source/cmTarget.h +++ b/Source/cmTarget.h @@ -107,7 +107,7 @@ public: ///! Set the cmMakefile that owns this target void SetMakefile(cmMakefile *mf); - cmMakefile *GetMakefile() const { return this->Makefile;}; + cmMakefile *GetMakefile() const { return this->Makefile;} #define DECLARE_TARGET_POLICY(POLICY) \ cmPolicies::PolicyStatus GetPolicyStatus ## POLICY () const \ @@ -136,9 +136,6 @@ public: /** * Get the list of the source files used by this target */ - void GetSourceFiles(std::vector<std::string> &files, - const std::string& config, - cmTarget const* head = 0) const; void GetSourceFiles(std::vector<cmSourceFile*> &files, const std::string& config, cmTarget const* head = 0) const; @@ -148,6 +145,7 @@ public: * Add sources to the target. */ void AddSources(std::vector<std::string> const& srcs); + void AddTracedSources(std::vector<std::string> const& srcs); cmSourceFile* AddSourceCMP0049(const std::string& src); cmSourceFile* AddSource(const std::string& src); @@ -449,7 +447,7 @@ public: cmTarget const* head = 0) const; // Get the properties - cmPropertyMap &GetProperties() const { return this->Properties; }; + cmPropertyMap &GetProperties() const { return this->Properties; } bool GetMappedConfig(std::string const& desired_config, const char** loc, @@ -684,6 +682,9 @@ private: const std::string& config, bool contentOnly) const; + void GetSourceFiles(std::vector<std::string> &files, + const std::string& config, + cmTarget const* head = 0) const; private: std::string Name; std::vector<cmCustomCommand> PreBuildCommands; @@ -753,6 +754,8 @@ private: void ComputeLinkClosure(const std::string& config, LinkClosure& lc, cmTarget const* head) const; + std::string ProcessSourceItemCMP0049(const std::string& s); + void ClearLinkMaps(); void MaybeInvalidatePropertyCache(const std::string& prop); @@ -783,6 +786,8 @@ private: std::string const& suffix, std::string const& name, const char* version) const; + + mutable bool LinkImplementationLanguageIsContextDependent; }; typedef std::map<std::string,cmTarget> cmTargets; diff --git a/Source/cmTargetLinkLibrariesCommand.cxx b/Source/cmTargetLinkLibrariesCommand.cxx index 1c2e625..56e1338 100644 --- a/Source/cmTargetLinkLibrariesCommand.cxx +++ b/Source/cmTargetLinkLibrariesCommand.cxx @@ -70,7 +70,6 @@ bool cmTargetLinkLibrariesCommand GetRequiredPolicyError(cmPolicies::CMP0016); break; case cmPolicies::NEW: // NEW behavior prints the error. - default: break; } } diff --git a/Source/cmTest.h b/Source/cmTest.h index b3785f6..a93eff5 100644 --- a/Source/cmTest.h +++ b/Source/cmTest.h @@ -51,10 +51,10 @@ public: const char* value,bool asString=false); const char *GetProperty(const std::string& prop) const; bool GetPropertyAsBool(const std::string& prop) const; - cmPropertyMap &GetProperties() { return this->Properties; }; + cmPropertyMap &GetProperties() { return this->Properties; } /** Get the cmMakefile instance that owns this test. */ - cmMakefile *GetMakefile() { return this->Makefile;}; + cmMakefile *GetMakefile() { return this->Makefile;} /** Get the backtrace of the command that created this test. */ cmListFileBacktrace const& GetBacktrace() const; diff --git a/Source/cmake.h b/Source/cmake.h index 6772740..76a3179 100644 --- a/Source/cmake.h +++ b/Source/cmake.h @@ -98,9 +98,9 @@ class cmake /// Destructor ~cmake(); - static const char *GetCMakeFilesDirectory() {return "/CMakeFiles";}; + static const char *GetCMakeFilesDirectory() {return "/CMakeFiles";} static const char *GetCMakeFilesDirectoryPostSlash() { - return "CMakeFiles/";}; + return "CMakeFiles/";} //@{ /** @@ -261,7 +261,7 @@ class cmake void UpdateProgress(const char *msg, float prog); ///! get the cmake policies instance - cmPolicies *GetPolicies() {return this->Policies;} ; + cmPolicies *GetPolicies() {return this->Policies;} ///! Get the variable watch object cmVariableWatch* GetVariableWatch() { return this->VariableWatch; } @@ -278,7 +278,7 @@ class cmake bool GetPropertyAsBool(const std::string& prop); // Get the properties - cmPropertyMap &GetProperties() { return this->Properties; }; + cmPropertyMap &GetProperties() { return this->Properties; } ///! Do all the checks before running configure int DoPreConfigureChecks(); diff --git a/Source/kwsys/CMakeLists.txt b/Source/kwsys/CMakeLists.txt index 977d57b..5e6a226 100644 --- a/Source/kwsys/CMakeLists.txt +++ b/Source/kwsys/CMakeLists.txt @@ -299,6 +299,13 @@ IF(NOT CMAKE_COMPILER_IS_GNUCXX) ENDIF(CMAKE_SYSTEM MATCHES "OSF1-V.*") IF(CMAKE_SYSTEM MATCHES "HP-UX") SET(KWSYS_PLATFORM_CXX_TEST_EXTRA_FLAGS "+p") + IF(CMAKE_CXX_COMPILER_ID MATCHES "HP") + # it is known that version 3.85 fails and 6.25 works without these flags + IF(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4) + # use new C++ library and improved template support + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -AA +hpxstd98") + ENDIF() + ENDIF() ENDIF(CMAKE_SYSTEM MATCHES "HP-UX") ENDIF(NOT CMAKE_COMPILER_IS_GNUCXX) diff --git a/Source/kwsys/EncodingCXX.cxx b/Source/kwsys/EncodingCXX.cxx index f76deb5..251a56d 100644 --- a/Source/kwsys/EncodingCXX.cxx +++ b/Source/kwsys/EncodingCXX.cxx @@ -110,16 +110,19 @@ Encoding::CommandLineArguments:: Encoding::CommandLineArguments& Encoding::CommandLineArguments::operator=(const CommandLineArguments& other) { - size_t i; - for(i=0; i<this->argv_.size(); i++) + if(this != &other) { - free(this->argv_[i]); - } + size_t i; + for(i=0; i<this->argv_.size(); i++) + { + free(this->argv_[i]); + } - this->argv_.resize(other.argv_.size()); - for(i=0; i<this->argv_.size(); i++) - { - this->argv_[i] = other.argv_[i] ? strdup(other.argv_[i]) : 0; + this->argv_.resize(other.argv_.size()); + for(i=0; i<this->argv_.size(); i++) + { + this->argv_[i] = other.argv_[i] ? strdup(other.argv_[i]) : 0; + } } return *this; diff --git a/Source/kwsys/MD5.c b/Source/kwsys/MD5.c index 56776a3..a147057 100644 --- a/Source/kwsys/MD5.c +++ b/Source/kwsys/MD5.c @@ -478,11 +478,16 @@ void kwsysMD5_Initialize(kwsysMD5* md5) /*--------------------------------------------------------------------------*/ void kwsysMD5_Append(kwsysMD5* md5, unsigned char const* data, int length) { + size_t dlen; if(length < 0) { - length = (int)strlen((char const*)data); + dlen = strlen((char const*)data); } - md5_append(&md5->md5_state, (md5_byte_t const*)data, (size_t)length); + else + { + dlen = (size_t)length; + } + md5_append(&md5->md5_state, (md5_byte_t const*)data, dlen); } /*--------------------------------------------------------------------------*/ diff --git a/Source/kwsys/System.c b/Source/kwsys/System.c index 5d178bf..1ee26fa 100644 --- a/Source/kwsys/System.c +++ b/Source/kwsys/System.c @@ -353,6 +353,10 @@ static int kwsysSystem_Shell__GetArgumentSize(const char* in, if(kwsysSystem_Shell__ArgumentNeedsQuotes(in, isUnix, flags)) { /* Surrounding quotes are needed. Allocate space for them. */ + if((flags & kwsysSystem_Shell_Flag_WatcomQuote) && (isUnix)) + { + size += 2; + } size += 2; /* We must escape all ending backslashes when quoting on windows. */ @@ -377,7 +381,18 @@ static char* kwsysSystem_Shell__GetArgument(const char* in, char* out, if(needQuotes) { /* Add the opening quote for this argument. */ - *out++ = '"'; + if(flags & kwsysSystem_Shell_Flag_WatcomQuote) + { + if(isUnix) + { + *out++ = '"'; + } + *out++ = '\''; + } + else + { + *out++ = '"'; + } } /* Scan the string for characters that require escaping or quoting. */ @@ -549,7 +564,18 @@ static char* kwsysSystem_Shell__GetArgument(const char* in, char* out, } /* Add the closing quote for this argument. */ - *out++ = '"'; + if(flags & kwsysSystem_Shell_Flag_WatcomQuote) + { + *out++ = '\''; + if(isUnix) + { + *out++ = '"'; + } + } + else + { + *out++ = '"'; + } } /* Store a terminating null without incrementing. */ diff --git a/Source/kwsys/System.h.in b/Source/kwsys/System.h.in index 549db90..f21bf0d 100644 --- a/Source/kwsys/System.h.in +++ b/Source/kwsys/System.h.in @@ -36,6 +36,7 @@ # define kwsysSystem_Shell_Flag_MinGWMake kwsys_ns(System_Shell_Flag_MinGWMake) # define kwsysSystem_Shell_Flag_NMake kwsys_ns(System_Shell_Flag_NMake) # define kwsysSystem_Shell_Flag_AllowMakeVariables kwsys_ns(System_Shell_Flag_AllowMakeVariables) +# define kwsysSystem_Shell_Flag_WatcomQuote kwsys_ns(System_Shell_Flag_WatcomQuote) #endif #ifdef __VMS @@ -102,14 +103,17 @@ enum kwsysSystem_Shell_Flag_e kwsysSystem_Shell_Flag_MinGWMake = (1<<4), /** The target shell is in a NMake makefile. */ - kwsysSystem_Shell_Flag_NMake = (1<<6), + kwsysSystem_Shell_Flag_NMake = (1<<5), /** Make variable reference syntax $(MAKEVAR) should not be escaped to allow a build tool to replace it. Replacement values containing spaces, quotes, backslashes, or other non-alphanumeric characters that have significance to some makes or shells produce undefined behavior. */ - kwsysSystem_Shell_Flag_AllowMakeVariables = (1<<5) + kwsysSystem_Shell_Flag_AllowMakeVariables = (1<<6), + + /** The target shell quoting uses extra single Quotes for Watcom tools. */ + kwsysSystem_Shell_Flag_WatcomQuote = (1<<7) }; /** @@ -156,6 +160,7 @@ kwsysEXPORT char** kwsysSystem_Parse_CommandForUnix(const char* command, # undef kwsysSystem_Shell_Flag_MinGWMake # undef kwsysSystem_Shell_Flag_NMake # undef kwsysSystem_Shell_Flag_AllowMakeVariables +# undef kwsysSystem_Shell_Flag_WatcomQuote # endif #endif diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 1c474ab..0e60ed1 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -2440,6 +2440,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release set(regex "${regex}|Error message was: ") set(regex "${regex}([Cc]ould *n.t resolve host") set(regex "${regex}|[Cc]ould *n.t connect to host") + set(regex "${regex}|Failed connect to") set(regex "${regex}|Empty reply from server") set(regex "${regex}|The requested URL returned error") set(regex "${regex}|libcurl was built with SSL disabled. https: not supported)") @@ -1086,8 +1086,8 @@ if [ "x${cmake_cxx_compiler_is_gnu}" != "x1" ]; then cmake_test_flags= # If we are on HP-UX, check for -Ae for the C compiler. - cmake_test_flags="-Ae" if [ "x${cmake_system}" = "xHP-UX" ]; then + cmake_test_flags="-Ae" TMPFILE=`cmake_tmp_file` echo ' int main(int argc, char** argv) { (void)argc; (void)argv; return 0; } @@ -1108,6 +1108,29 @@ if [ "x${cmake_cxx_compiler_is_gnu}" != "x1" ]; then echo "${cmake_c_compiler} does not need ${cmake_test_flags}" fi rm -f "${TMPFILE}.c" + echo ' + #include <iostream> + int main(int argc, char** argv) { + for(int i=0; i < 1; ++i); + for(int i=0; i < 1; ++i); + (void)argc; (void)argv; return 0; } +' > ${TMPFILE}.cxx + cmake_need_AAstd98=0 + cmake_test_flags="-AA +hpxstd98" + if cmake_try_run "${cmake_cxx_compiler}" "${cmake_cxx_flags}" "${TMPFILE}.cxx" >> cmake_bootstrap.log 2>&1; then + : + else + if cmake_try_run "${cmake_cxx_compiler}" \ + "${cmake_cxx_flags} ${cmake_test_flags}" "${TMPFILE}.cxx" >> cmake_bootstrap.log 2>&1; then + cmake_need_AAstd98=1 + fi + fi + if [ "x${cmake_need_AAstd98}" = "x1" ]; then + cmake_cxx_flags="${cmake_cxx_flags} ${cmake_test_flags}" + echo "${cmake_cxx_compiler} needs ${cmake_test_flags}" + else + echo "${cmake_cxx_compiler} does not need ${cmake_test_flags}" + fi fi cmake_test_flags= fi |