diff --git a/Modules/CMakeCCompiler.cmake.in b/Modules/CMakeCCompiler.cmake.in index a1bfc70a0..c72e3381f 100644 --- a/Modules/CMakeCCompiler.cmake.in +++ b/Modules/CMakeCCompiler.cmake.in @@ -2,7 +2,6 @@ set(CMAKE_C_COMPILER "@CMAKE_C_COMPILER@") set(CMAKE_C_COMPILER_ARG1 "@CMAKE_C_COMPILER_ARG1@") set(CMAKE_C_COMPILER_ID "@CMAKE_C_COMPILER_ID@") set(CMAKE_C_COMPILER_VERSION "@CMAKE_C_COMPILER_VERSION@") -set(CMAKE_C_COMPILER_LINKS_STATICALLY "@CMAKE_C_COMPILER_LINKS_STATICALLY@") set(CMAKE_C_STANDARD_COMPUTED_DEFAULT "@CMAKE_C_STANDARD_COMPUTED_DEFAULT@") set(CMAKE_C_COMPILE_FEATURES "@CMAKE_C_COMPILE_FEATURES@") set(CMAKE_C90_COMPILE_FEATURES "@CMAKE_C90_COMPILE_FEATURES@") diff --git a/Modules/CMakeCCompilerId.c.in b/Modules/CMakeCCompilerId.c.in index b22400780..63f8787c0 100644 --- a/Modules/CMakeCCompilerId.c.in +++ b/Modules/CMakeCCompilerId.c.in @@ -55,6 +55,7 @@ int main(int argc, char* argv[]) #ifdef SIMULATE_VERSION_MAJOR require += info_simulate_version[argc]; #endif + require += info_language_dialect_default[argc]; (void)argv; return require; } diff --git a/Modules/CMakeCInformation.cmake b/Modules/CMakeCInformation.cmake index 0d102a11b..d2417aaa4 100644 --- a/Modules/CMakeCInformation.cmake +++ b/Modules/CMakeCInformation.cmake @@ -75,10 +75,6 @@ if(CMAKE_C_SIZEOF_DATA_PTR) unset(CMAKE_C_ABI_FILES) endif() -if(CMAKE_C_COMPILER_LINKS_STATICALLY) - set_property(GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS FALSE) -endif() - # This should be included before the _INIT variables are # used to initialize the cache. Since the rule variables # have if blocks on them, users can still define them here. diff --git a/Modules/CMakeCXXCompiler.cmake.in b/Modules/CMakeCXXCompiler.cmake.in index 4218a6d12..52e44f6d5 100644 --- a/Modules/CMakeCXXCompiler.cmake.in +++ b/Modules/CMakeCXXCompiler.cmake.in @@ -2,7 +2,6 @@ set(CMAKE_CXX_COMPILER "@CMAKE_CXX_COMPILER@") set(CMAKE_CXX_COMPILER_ARG1 "@CMAKE_CXX_COMPILER_ARG1@") set(CMAKE_CXX_COMPILER_ID "@CMAKE_CXX_COMPILER_ID@") set(CMAKE_CXX_COMPILER_VERSION "@CMAKE_CXX_COMPILER_VERSION@") -set(CMAKE_CXX_COMPILER_LINKS_STATICALLY "@CMAKE_CXX_COMPILER_LINKS_STATICALLY@") set(CMAKE_CXX_STANDARD_COMPUTED_DEFAULT "@CMAKE_CXX_STANDARD_COMPUTED_DEFAULT@") set(CMAKE_CXX_COMPILE_FEATURES "@CMAKE_CXX_COMPILE_FEATURES@") set(CMAKE_CXX98_COMPILE_FEATURES "@CMAKE_CXX98_COMPILE_FEATURES@") diff --git a/Modules/CMakeCXXCompilerId.cpp.in b/Modules/CMakeCXXCompilerId.cpp.in index d46750766..61cd79093 100644 --- a/Modules/CMakeCXXCompilerId.cpp.in +++ b/Modules/CMakeCXXCompilerId.cpp.in @@ -49,6 +49,7 @@ int main(int argc, char* argv[]) #ifdef SIMULATE_VERSION_MAJOR require += info_simulate_version[argc]; #endif + require += info_language_dialect_default[argc]; (void)argv; return require; } diff --git a/Modules/CMakeCXXInformation.cmake b/Modules/CMakeCXXInformation.cmake index dad7969df..091627bc3 100644 --- a/Modules/CMakeCXXInformation.cmake +++ b/Modules/CMakeCXXInformation.cmake @@ -74,10 +74,6 @@ if(CMAKE_CXX_SIZEOF_DATA_PTR) unset(CMAKE_CXX_ABI_FILES) endif() -if(CMAKE_CXX_COMPILER_LINKS_STATICALLY) - set_property(GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS FALSE) -endif() - # This should be included before the _INIT variables are # used to initialize the cache. Since the rule variables # have if blocks on them, users can still define them here. diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake index 2e741004b..81c25090c 100644 --- a/Modules/CMakeDetermineCompilerId.cmake +++ b/Modules/CMakeDetermineCompilerId.cmake @@ -106,7 +106,6 @@ function(CMAKE_DETERMINE_COMPILER_ID lang flagvar src) set(MSVC_${lang}_ARCHITECTURE_ID "${MSVC_${lang}_ARCHITECTURE_ID}" PARENT_SCOPE) set(CMAKE_${lang}_CL_SHOWINCLUDES_PREFIX "${CMAKE_${lang}_CL_SHOWINCLUDES_PREFIX}" PARENT_SCOPE) - set(CMAKE_${lang}_COMPILER_LINKS_STATICALLY "${CMAKE_${lang}_COMPILER_LINKS_STATICALLY}" PARENT_SCOPE) set(CMAKE_${lang}_COMPILER_VERSION "${CMAKE_${lang}_COMPILER_VERSION}" PARENT_SCOPE) set(CMAKE_${lang}_SIMULATE_ID "${CMAKE_${lang}_SIMULATE_ID}" PARENT_SCOPE) set(CMAKE_${lang}_SIMULATE_VERSION "${CMAKE_${lang}_SIMULATE_VERSION}" PARENT_SCOPE) @@ -533,13 +532,6 @@ function(CMAKE_DETERMINE_COMPILER_ID_CHECK lang file) endif() endif() - if(UNIX) - execute_process(COMMAND file "${file}" OUTPUT_VARIABLE out ERROR_VARIABLE out) - if(out MATCHES "statically linked") - set(CMAKE_${lang}_COMPILER_LINKS_STATICALLY 1 PARENT_SCOPE) - endif() - endif() - # Check if a valid compiler and platform were found. if(COMPILER_ID AND NOT COMPILER_ID_TWICE) set(CMAKE_${lang}_COMPILER_ID "${COMPILER_ID}") diff --git a/Modules/CMakeFortranCompiler.cmake.in b/Modules/CMakeFortranCompiler.cmake.in index 6b984e517..14fdd60d9 100644 --- a/Modules/CMakeFortranCompiler.cmake.in +++ b/Modules/CMakeFortranCompiler.cmake.in @@ -2,7 +2,6 @@ set(CMAKE_Fortran_COMPILER "@CMAKE_Fortran_COMPILER@") set(CMAKE_Fortran_COMPILER_ARG1 "@CMAKE_Fortran_COMPILER_ARG1@") set(CMAKE_Fortran_COMPILER_ID "@CMAKE_Fortran_COMPILER_ID@") set(CMAKE_Fortran_COMPILER_VERSION "@CMAKE_Fortran_COMPILER_VERSION@") -set(CMAKE_Fortran_COMPILER_LINKS_STATICALLY "@CMAKE_Fortran_COMPILER_LINKS_STATICALLY@") set(CMAKE_Fortran_PLATFORM_ID "@CMAKE_Fortran_PLATFORM_ID@") set(CMAKE_Fortran_SIMULATE_ID "@CMAKE_Fortran_SIMULATE_ID@") set(CMAKE_Fortran_SIMULATE_VERSION "@CMAKE_Fortran_SIMULATE_VERSION@") diff --git a/Modules/CMakeFortranCompilerId.F.in b/Modules/CMakeFortranCompilerId.F.in index 017af91c0..2f7f40ec6 100644 --- a/Modules/CMakeFortranCompilerId.F.in +++ b/Modules/CMakeFortranCompilerId.F.in @@ -47,6 +47,8 @@ # define COMPILER_VERSION_PATCH HEX(__SUNPRO_F90 & 0xF) #elif defined(_CRAYFTN) PRINT *, 'INFO:compiler[Cray]' +# define COMPILER_VERSION_MAJOR DEC(_RELEASE_MAJOR) +# define COMPILER_VERSION_MINOR DEC(_RELEASE_MINOR) #elif defined(__G95__) PRINT *, 'INFO:compiler[G95]' # define COMPILER_VERSION_MAJOR DEC(__G95__) diff --git a/Modules/CMakeFortranInformation.cmake b/Modules/CMakeFortranInformation.cmake index aa48df760..79393d330 100644 --- a/Modules/CMakeFortranInformation.cmake +++ b/Modules/CMakeFortranInformation.cmake @@ -51,10 +51,6 @@ if(CMAKE_Fortran_SIZEOF_DATA_PTR) unset(CMAKE_Fortran_ABI_FILES) endif() -if(CMAKE_Fortran_COMPILER_LINKS_STATICALLY) - set_property(GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS FALSE) -endif() - # This should be included before the _INIT variables are # used to initialize the cache. Since the rule variables # have if blocks on them, users can still define them here. diff --git a/Modules/Compiler/AppleClang-C.cmake b/Modules/Compiler/AppleClang-C.cmake index 5908c26b3..1cc72c0e5 100644 --- a/Modules/Compiler/AppleClang-C.cmake +++ b/Modules/Compiler/AppleClang-C.cmake @@ -18,6 +18,9 @@ if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.0) message(FATAL_ERROR "CMAKE_C_STANDARD_COMPUTED_DEFAULT should be set for ${CMAKE_C_COMPILER_ID} (${CMAKE_C_COMPILER}) version ${CMAKE_C_COMPILER_VERSION}") endif() set(CMAKE_C_STANDARD_DEFAULT ${CMAKE_C_STANDARD_COMPUTED_DEFAULT}) + elseif(NOT DEFINED CMAKE_C_STANDARD_DEFAULT) + # Compiler id was forced so just guess the default standard level. + set(CMAKE_C_STANDARD_DEFAULT 99) endif() endif() diff --git a/Modules/Compiler/AppleClang-CXX.cmake b/Modules/Compiler/AppleClang-CXX.cmake index c4e342bf3..95bc79adc 100644 --- a/Modules/Compiler/AppleClang-CXX.cmake +++ b/Modules/Compiler/AppleClang-CXX.cmake @@ -28,6 +28,9 @@ if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.0) message(FATAL_ERROR "CMAKE_CXX_STANDARD_COMPUTED_DEFAULT should be set for ${CMAKE_CXX_COMPILER_ID} (${CMAKE_CXX_COMPILER}) version ${CMAKE_CXX_COMPILER_VERSION}") endif() set(CMAKE_CXX_STANDARD_DEFAULT ${CMAKE_CXX_STANDARD_COMPUTED_DEFAULT}) + elseif(NOT DEFINED CMAKE_CXX_STANDARD_DEFAULT) + # Compiler id was forced so just guess the default standard level. + set(CMAKE_CXX_STANDARD_DEFAULT 98) endif() endif() diff --git a/Modules/Compiler/Clang-C.cmake b/Modules/Compiler/Clang-C.cmake index a2e81c142..d8b77430a 100644 --- a/Modules/Compiler/Clang-C.cmake +++ b/Modules/Compiler/Clang-C.cmake @@ -23,6 +23,13 @@ if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 3.4) message(FATAL_ERROR "CMAKE_C_STANDARD_COMPUTED_DEFAULT should be set for ${CMAKE_C_COMPILER_ID} (${CMAKE_C_COMPILER}) version ${CMAKE_C_COMPILER_VERSION}") endif() set(CMAKE_C_STANDARD_DEFAULT ${CMAKE_C_STANDARD_COMPUTED_DEFAULT}) + elseif(NOT DEFINED CMAKE_C_STANDARD_DEFAULT) + # Compiler id was forced so just guess the default standard level. + if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 3.6) + set(CMAKE_C_STANDARD_DEFAULT 11) + else() + set(CMAKE_C_STANDARD_DEFAULT 99) + endif() endif() endif() diff --git a/Modules/Compiler/Clang-CXX.cmake b/Modules/Compiler/Clang-CXX.cmake index 055a8eeeb..6a0a5e2ff 100644 --- a/Modules/Compiler/Clang-CXX.cmake +++ b/Modules/Compiler/Clang-CXX.cmake @@ -37,6 +37,9 @@ if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.4) message(FATAL_ERROR "CMAKE_CXX_STANDARD_COMPUTED_DEFAULT should be set for ${CMAKE_CXX_COMPILER_ID} (${CMAKE_CXX_COMPILER}) version ${CMAKE_CXX_COMPILER_VERSION}") endif() set(CMAKE_CXX_STANDARD_DEFAULT ${CMAKE_CXX_STANDARD_COMPUTED_DEFAULT}) + elseif(NOT DEFINED CMAKE_CXX_STANDARD_DEFAULT) + # Compiler id was forced so just guess the default standard level. + set(CMAKE_CXX_STANDARD_DEFAULT 98) endif() endif() diff --git a/Modules/Compiler/GNU-C.cmake b/Modules/Compiler/GNU-C.cmake index d979fb7a4..2c478da21 100644 --- a/Modules/Compiler/GNU-C.cmake +++ b/Modules/Compiler/GNU-C.cmake @@ -28,6 +28,13 @@ if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.4) message(FATAL_ERROR "CMAKE_C_STANDARD_COMPUTED_DEFAULT should be set for ${CMAKE_C_COMPILER_ID} (${CMAKE_C_COMPILER}) version ${CMAKE_C_COMPILER_VERSION}") endif() set(CMAKE_C_STANDARD_DEFAULT ${CMAKE_C_STANDARD_COMPUTED_DEFAULT}) + elseif(NOT DEFINED CMAKE_C_STANDARD_DEFAULT) + # Compiler id was forced so just guess the default standard level. + if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 5.0) + set(CMAKE_C_STANDARD_DEFAULT 11) + else() + set(CMAKE_C_STANDARD_DEFAULT 90) + endif() endif() endif() diff --git a/Modules/Compiler/GNU-CXX.cmake b/Modules/Compiler/GNU-CXX.cmake index a7e71c36c..e1c555b4b 100644 --- a/Modules/Compiler/GNU-CXX.cmake +++ b/Modules/Compiler/GNU-CXX.cmake @@ -40,6 +40,9 @@ if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.4) message(FATAL_ERROR "CMAKE_CXX_STANDARD_COMPUTED_DEFAULT should be set for ${CMAKE_CXX_COMPILER_ID} (${CMAKE_CXX_COMPILER}) version ${CMAKE_CXX_COMPILER_VERSION}") endif() set(CMAKE_CXX_STANDARD_DEFAULT ${CMAKE_CXX_STANDARD_COMPUTED_DEFAULT}) + elseif(NOT DEFINED CMAKE_CXX_STANDARD_DEFAULT) + # Compiler id was forced so just guess the default standard level. + set(CMAKE_CXX_STANDARD_DEFAULT 98) endif() endif() diff --git a/Modules/Compiler/SunPro-CXX.cmake b/Modules/Compiler/SunPro-CXX.cmake index 50d68eebf..b4a5591b4 100644 --- a/Modules/Compiler/SunPro-CXX.cmake +++ b/Modules/Compiler/SunPro-CXX.cmake @@ -42,6 +42,9 @@ if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.13) message(FATAL_ERROR "CMAKE_CXX_STANDARD_COMPUTED_DEFAULT should be set for ${CMAKE_CXX_COMPILER_ID} (${CMAKE_CXX_COMPILER}) version ${CMAKE_CXX_COMPILER_VERSION}") endif() set(CMAKE_CXX_STANDARD_DEFAULT ${CMAKE_CXX_STANDARD_COMPUTED_DEFAULT}) + elseif(NOT DEFINED CMAKE_CXX_STANDARD_DEFAULT) + # Compiler id was forced so just guess the default standard level. + set(CMAKE_CXX_STANDARD_DEFAULT 98) endif() endif() diff --git a/Modules/FindGTest.cmake b/Modules/FindGTest.cmake index fccf877a8..eb7abfd73 100644 --- a/Modules/FindGTest.cmake +++ b/Modules/FindGTest.cmake @@ -124,11 +124,11 @@ function(GTEST_ADD_TESTS executable extra_args) string(REGEX MATCH "${gtest_test_type_regex}" test_type ${hit}) # Parameterized tests have a different signature for the filter - if(${test_type} STREQUAL "TEST_P") + if("x${test_type}" STREQUAL "xTEST_P") string(REGEX REPLACE ${gtest_case_name_regex} "*/\\1.\\2/*" test_name ${hit}) - elseif(${test_type} STREQUAL "TEST_F" OR ${test_type} STREQUAL "TEST") + elseif("x${test_type}" STREQUAL "xTEST_F" OR "x${test_type}" STREQUAL "xTEST") string(REGEX REPLACE ${gtest_case_name_regex} "\\1.\\2" test_name ${hit}) - elseif(${test_type} STREQUAL "TYPED_TEST") + elseif("x${test_type}" STREQUAL "xTYPED_TEST") string(REGEX REPLACE ${gtest_case_name_regex} "\\1/*.\\2" test_name ${hit}) else() message(WARNING "Could not parse GTest ${hit} for adding to CTest.") diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 0ce169637..5717d37ba 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 4) -set(CMake_VERSION_PATCH 0) +set(CMake_VERSION_PATCH 1) #set(CMake_VERSION_RC 0) diff --git a/Source/bindexplib.cxx b/Source/bindexplib.cxx index dc4db6358..b2508422f 100644 --- a/Source/bindexplib.cxx +++ b/Source/bindexplib.cxx @@ -425,7 +425,7 @@ DumpFile(const char* filename, FILE *fout) if(h->Sig1 == 0x0 && h->Sig2 == 0xffff) { DumpSymbols symbolDumper((cmANON_OBJECT_HEADER_BIGOBJ*) lpFileBase, fout, - (dosHeader->e_magic == IMAGE_FILE_MACHINE_AMD64)); + (h->Machine == IMAGE_FILE_MACHINE_AMD64)); symbolDumper.DumpObjFile(); } else { printf("unrecognized file format in '%s'\n", filename); diff --git a/Source/cmELF.cxx b/Source/cmELF.cxx index d062987b1..37dd328db 100644 --- a/Source/cmELF.cxx +++ b/Source/cmELF.cxx @@ -567,8 +567,14 @@ bool cmELFInternalImpl::LoadDynamicSection() return true; } - // Allocate the dynamic section entries. + // If there are no entries we are done. ELF_Shdr const& sec = this->SectionHeaders[this->DynamicSectionIndex]; + if(sec.sh_entsize == 0) + { + return false; + } + + // Allocate the dynamic section entries. int n = static_cast(sec.sh_size / sec.sh_entsize); this->DynamicSectionEntries.resize(n); diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index 62598f439..194cd880b 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -2747,6 +2747,7 @@ void cmGeneratorTarget::GetLibraryNames(std::string& name, const char* version = this->GetProperty("VERSION"); const char* soversion = this->GetProperty("SOVERSION"); if(!this->HasSOName(config) || + this->Makefile->IsOn("CMAKE_PLATFORM_NO_VERSIONED_SONAME") || this->Target->IsFrameworkOnApple()) { // Versioning is supported only for shared libraries and modules, diff --git a/Source/cmLinkedTree.h b/Source/cmLinkedTree.h index 721a24606..3b41459c2 100644 --- a/Source/cmLinkedTree.h +++ b/Source/cmLinkedTree.h @@ -24,7 +24,7 @@ needs of the cmState. For example, the Truncate() method is a specific requirement of the cmState. - An empty cmLinkedTree provides a Root() method, and an Extend() method, + An empty cmLinkedTree provides a Root() method, and an Push() method, each of which return iterators. A Tree can be built up by extending from the root, and then extending from any other iterator. @@ -142,16 +142,37 @@ public: return iterator(const_cast(this), 0); } - iterator Extend(iterator it) + iterator Push(iterator it) { - return Extend_impl(it, T()); + return Push_impl(it, T()); } - iterator Extend(iterator it, T t) + iterator Push(iterator it, T t) { - return Extend_impl(it, t); + return Push_impl(it, t); } + bool IsLast(iterator it) + { + return it.Position == this->Data.size(); + } + + iterator Pop(iterator it) + { + assert(!this->Data.empty()); + assert(this->UpPositions.size() == this->Data.size()); + bool const isLast = this->IsLast(it); + ++it; + // If this is the last entry then no other entry can refer + // to it so we can drop its storage. + if (isLast) + { + this->Data.pop_back(); + this->UpPositions.pop_back(); + } + return it; + } + iterator Truncate() { assert(this->UpPositions.size() > 0); @@ -179,7 +200,7 @@ private: return &this->Data[pos]; } - iterator Extend_impl(iterator it, T t) + iterator Push_impl(iterator it, T t) { assert(this->UpPositions.size() == this->Data.size()); assert(it.Position <= this->UpPositions.size()); diff --git a/Source/cmListFileCache.cxx b/Source/cmListFileCache.cxx index bff298615..1465f907b 100644 --- a/Source/cmListFileCache.cxx +++ b/Source/cmListFileCache.cxx @@ -398,6 +398,21 @@ bool cmListFileParser::AddArgument(cmListFileLexer_Token* token, } } +cmListFileBacktrace::cmListFileBacktrace(cmState::Snapshot snapshot, + cmCommandContext const& cc) + : Context(cc) + , Snapshot(snapshot) +{ + if (this->Snapshot.IsValid()) + { + this->Snapshot.Keep(); + } +} + +cmListFileBacktrace::~cmListFileBacktrace() +{ +} + void cmListFileBacktrace::PrintTitle(std::ostream& out) const { if (!this->Snapshot.IsValid()) diff --git a/Source/cmListFileCache.h b/Source/cmListFileCache.h index 0afd7f5d3..17ee10fed 100644 --- a/Source/cmListFileCache.h +++ b/Source/cmListFileCache.h @@ -90,10 +90,8 @@ class cmListFileBacktrace { public: cmListFileBacktrace(cmState::Snapshot snapshot = cmState::Snapshot(), - cmCommandContext const& cc = cmCommandContext()) - : Context(cc), Snapshot(snapshot) - { - } + cmCommandContext const& cc = cmCommandContext()); + ~cmListFileBacktrace(); void PrintTitle(std::ostream& out) const; void PrintCallStack(std::ostream& out) const; diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 32304032d..233e7fe5f 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -3003,7 +3003,7 @@ void cmLocalGenerator::GenerateAppleInfoPList(cmTarget* target, // override user make variables. If not the configuration will fall // back to the directory-level values set by the user. cmMakefile* mf = this->Makefile; - mf->PushScope(); + cmMakefile::ScopePushPop varScope(mf); mf->AddDefinition("MACOSX_BUNDLE_EXECUTABLE_NAME", targetName.c_str()); cmLGInfoProp(mf, target, "MACOSX_BUNDLE_INFO_STRING"); cmLGInfoProp(mf, target, "MACOSX_BUNDLE_ICON_FILE"); @@ -3014,7 +3014,6 @@ void cmLocalGenerator::GenerateAppleInfoPList(cmTarget* target, cmLGInfoProp(mf, target, "MACOSX_BUNDLE_BUNDLE_VERSION"); cmLGInfoProp(mf, target, "MACOSX_BUNDLE_COPYRIGHT"); mf->ConfigureFile(inFile.c_str(), fname, false, false, false); - mf->PopScope(); } //---------------------------------------------------------------------------- @@ -3047,12 +3046,11 @@ void cmLocalGenerator::GenerateFrameworkInfoPList(cmTarget* target, // override user make variables. If not the configuration will fall // back to the directory-level values set by the user. cmMakefile* mf = this->Makefile; - mf->PushScope(); + cmMakefile::ScopePushPop varScope(mf); mf->AddDefinition("MACOSX_FRAMEWORK_NAME", targetName.c_str()); cmLGInfoProp(mf, target, "MACOSX_FRAMEWORK_ICON_FILE"); cmLGInfoProp(mf, target, "MACOSX_FRAMEWORK_IDENTIFIER"); cmLGInfoProp(mf, target, "MACOSX_FRAMEWORK_SHORT_VERSION_STRING"); cmLGInfoProp(mf, target, "MACOSX_FRAMEWORK_BUNDLE_VERSION"); mf->ConfigureFile(inFile.c_str(), fname, false, false, false); - mf->PopScope(); } diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index cb66a75a2..3c19f550d 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -435,7 +435,7 @@ cmMakefile::IncludeScope::~IncludeScope() this->EnforceCMP0011(); } } - this->Makefile->PopPolicyBarrier(this->ReportError); + this->Makefile->PopSnapshot(this->ReportError); this->Makefile->PopFunctionBlockerBarrier(this->ReportError); } @@ -549,7 +549,7 @@ public: ~ListFileScope() { - this->Makefile->PopPolicyBarrier(this->ReportError); + this->Makefile->PopSnapshot(this->ReportError); this->Makefile->PopFunctionBlockerBarrier(this->ReportError); } @@ -1551,7 +1551,7 @@ void cmMakefile::PopFunctionScope(bool reportError) { this->PopPolicy(); - this->PopPolicyBarrier(reportError); + this->PopSnapshot(reportError); this->PopFunctionBlockerBarrier(reportError); @@ -1582,7 +1582,7 @@ void cmMakefile::PushMacroScope(std::string const& fileName, void cmMakefile::PopMacroScope(bool reportError) { this->PopPolicy(); - this->PopPolicyBarrier(reportError); + this->PopSnapshot(reportError); this->PopFunctionBlockerBarrier(reportError); } @@ -1619,7 +1619,7 @@ public: ~BuildsystemFileScope() { this->Makefile->PopFunctionBlockerBarrier(this->ReportError); - this->Makefile->PopPolicyBarrier(this->ReportError); + this->Makefile->PopSnapshot(this->ReportError); #if defined(CMAKE_BUILD_WITH_CMAKE) this->GG->GetFileLockPool().PopFileScope(); #endif @@ -4233,9 +4233,7 @@ void cmMakefile::PopScope() this->CheckForUnusedVariables(); - this->StateSnapshot = - this->GetState()->Pop(this->StateSnapshot); - assert(this->StateSnapshot.IsValid()); + this->PopSnapshot(); } void cmMakefile::RaiseScope(const std::string& var, const char *varDef) @@ -4601,20 +4599,15 @@ bool cmMakefile::SetPolicy(cmPolicies::PolicyID id, } //---------------------------------------------------------------------------- -cmMakefile::PolicyPushPop::PolicyPushPop(cmMakefile* m, bool weak, - cmPolicies::PolicyMap const& pm): - Makefile(m), ReportError(true) +cmMakefile::PolicyPushPop::PolicyPushPop(cmMakefile* m): Makefile(m) { - this->Makefile->StateSnapshot = this->Makefile->StateSnapshot.GetState() - ->CreatePolicyScopeSnapshot(this->Makefile->StateSnapshot); - this->Makefile->PushPolicy(weak, pm); + this->Makefile->PushPolicy(); } //---------------------------------------------------------------------------- cmMakefile::PolicyPushPop::~PolicyPushPop() { this->Makefile->PopPolicy(); - this->Makefile->PopPolicyBarrier(this->ReportError); } //---------------------------------------------------------------------------- @@ -4634,8 +4627,11 @@ void cmMakefile::PopPolicy() } //---------------------------------------------------------------------------- -void cmMakefile::PopPolicyBarrier(bool reportError) +void cmMakefile::PopSnapshot(bool reportError) { + // cmState::Snapshot manages nested policy scopes within it. + // Since the scope corresponding to the snapshot is closing, + // reject any still-open nested policy scopes with an error. while (!this->StateSnapshot.CanPopPolicyScope()) { if(reportError) diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index 111f07496..1edffdcd7 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -321,14 +321,10 @@ public: class PolicyPushPop { public: - PolicyPushPop(cmMakefile* m, - bool weak = false, - cmPolicies::PolicyMap const& pm = cmPolicies::PolicyMap()); + PolicyPushPop(cmMakefile* m); ~PolicyPushPop(); - void Quiet() { this->ReportError = false; } private: cmMakefile* Makefile; - bool ReportError; }; friend class PolicyPushPop; @@ -904,7 +900,7 @@ private: void PushPolicy(bool weak = false, cmPolicies::PolicyMap const& pm = cmPolicies::PolicyMap()); void PopPolicy(); - void PopPolicyBarrier(bool reportError = true); + void PopSnapshot(bool reportError = true); friend class cmCMakePolicyCommand; class IncludeScope; friend class IncludeScope; diff --git a/Source/cmOrderDirectories.cxx b/Source/cmOrderDirectories.cxx index 35ee12709..e3406a83e 100644 --- a/Source/cmOrderDirectories.cxx +++ b/Source/cmOrderDirectories.cxx @@ -73,10 +73,8 @@ public: { // Check if this directory conflicts with the entry. std::string const& dir = this->OD->OriginalDirectories[i]; - if(dir != this->Directory && - cmSystemTools::GetRealPath(dir) != - cmSystemTools::GetRealPath(this->Directory) && - this->FindConflict(dir)) + if (!this->OD->IsSameDirectory(dir, this->Directory) && + this->FindConflict(dir)) { // The library will be found in this directory but this is not // the directory named for it. Add an entry to make sure the @@ -639,3 +637,23 @@ void cmOrderDirectories::DiagnoseCycle() ->IssueMessage(cmake::WARNING, e.str(), this->Target->Target->GetBacktrace()); } + +bool cmOrderDirectories::IsSameDirectory(std::string const& l, + std::string const& r) +{ + return this->GetRealPath(l) == this->GetRealPath(r); +} + +std::string const& cmOrderDirectories::GetRealPath(std::string const& dir) +{ + std::map::iterator i = + this->RealPaths.lower_bound(dir); + if (i == this->RealPaths.end() || + this->RealPaths.key_comp()(dir, i->first)) + { + typedef std::map::value_type value_type; + i = this->RealPaths.insert( + i, value_type(dir, cmSystemTools::GetRealPath(dir))); + } + return i->second; +} diff --git a/Source/cmOrderDirectories.h b/Source/cmOrderDirectories.h index 211c786d5..477216bbd 100644 --- a/Source/cmOrderDirectories.h +++ b/Source/cmOrderDirectories.h @@ -80,6 +80,12 @@ private: struct ConflictList: public std::vector {}; std::vector ConflictGraph; + // Compare directories after resolving symlinks. + bool IsSameDirectory(std::string const& l, std::string const& r); + + std::string const& GetRealPath(std::string const& dir); + std::map RealPaths; + friend class cmOrderDirectoriesConstraint; friend class cmOrderDirectoriesConstraintLibrary; }; diff --git a/Source/cmStandardIncludes.h b/Source/cmStandardIncludes.h index 468a58908..e21261652 100644 --- a/Source/cmStandardIncludes.h +++ b/Source/cmStandardIncludes.h @@ -54,6 +54,8 @@ #if defined( _MSC_VER ) typedef unsigned short mode_t; +#else +# include #endif // use this class to shrink the size of symbols in .o files diff --git a/Source/cmState.cxx b/Source/cmState.cxx index ce9ff323b..c1ead6c32 100644 --- a/Source/cmState.cxx +++ b/Source/cmState.cxx @@ -27,6 +27,7 @@ struct cmState::SnapshotDataType cmLinkedTree::iterator PolicyRoot; cmLinkedTree::iterator PolicyScope; cmState::SnapshotType SnapshotType; + bool Keep; cmLinkedTree::iterator ExecutionListFile; cmLinkedTree::iterator BuildSystemDirectory; @@ -288,7 +289,7 @@ cmState::Snapshot cmState::Reset() assert(pos->Policies.IsValid()); assert(pos->PolicyRoot.IsValid()); this->VarTree.Clear(); - pos->Vars = this->VarTree.Extend(this->VarTree.Root()); + pos->Vars = this->VarTree.Push(this->VarTree.Root()); pos->Parent = this->VarTree.Root(); pos->Root = this->VarTree.Root(); @@ -751,14 +752,15 @@ void cmState::Directory::ComputeRelativePathTopBinary() cmState::Snapshot cmState::CreateBaseSnapshot() { - PositionType pos = this->SnapshotData.Extend(this->SnapshotData.Root()); + PositionType pos = this->SnapshotData.Push(this->SnapshotData.Root()); pos->DirectoryParent = this->SnapshotData.Root(); pos->ScopeParent = this->SnapshotData.Root(); pos->SnapshotType = BaseType; + pos->Keep = true; pos->BuildSystemDirectory = - this->BuildsystemDirectory.Extend(this->BuildsystemDirectory.Root()); + this->BuildsystemDirectory.Push(this->BuildsystemDirectory.Root()); pos->ExecutionListFile = - this->ExecutionListFiles.Extend(this->ExecutionListFiles.Root()); + this->ExecutionListFiles.Push(this->ExecutionListFiles.Root()); pos->IncludeDirectoryPosition = 0; pos->CompileDefinitionsPosition = 0; pos->CompileOptionsPosition = 0; @@ -768,7 +770,7 @@ cmState::Snapshot cmState::CreateBaseSnapshot() pos->PolicyScope = this->PolicyStack.Root(); assert(pos->Policies.IsValid()); assert(pos->PolicyRoot.IsValid()); - pos->Vars = this->VarTree.Extend(this->VarTree.Root()); + pos->Vars = this->VarTree.Push(this->VarTree.Root()); assert(pos->Vars.IsValid()); pos->Parent = this->VarTree.Root(); pos->Root = this->VarTree.Root(); @@ -781,17 +783,18 @@ cmState::CreateBuildsystemDirectorySnapshot(Snapshot originSnapshot, long entryPointLine) { assert(originSnapshot.IsValid()); - PositionType pos = this->SnapshotData.Extend(originSnapshot.Position); + PositionType pos = this->SnapshotData.Push(originSnapshot.Position); pos->EntryPointLine = entryPointLine; pos->EntryPointCommand = entryPointCommand; pos->DirectoryParent = originSnapshot.Position; pos->ScopeParent = originSnapshot.Position; pos->SnapshotType = BuildsystemDirectoryType; + pos->Keep = true; pos->BuildSystemDirectory = - this->BuildsystemDirectory.Extend( + this->BuildsystemDirectory.Push( originSnapshot.Position->BuildSystemDirectory); pos->ExecutionListFile = - this->ExecutionListFiles.Extend( + this->ExecutionListFiles.Push( originSnapshot.Position->ExecutionListFile); pos->BuildSystemDirectory->DirectoryEnd = pos; pos->Policies = originSnapshot.Position->Policies; @@ -804,7 +807,7 @@ cmState::CreateBuildsystemDirectorySnapshot(Snapshot originSnapshot, originSnapshot.Position->Vars; pos->Parent = origin; pos->Root = origin; - pos->Vars = this->VarTree.Extend(origin); + pos->Vars = this->VarTree.Push(origin); cmState::Snapshot snapshot = cmState::Snapshot(this, pos); originSnapshot.Position->BuildSystemDirectory->Children.push_back(snapshot); return snapshot; @@ -816,13 +819,14 @@ cmState::CreateFunctionCallSnapshot(cmState::Snapshot originSnapshot, long entryPointLine, std::string const& fileName) { - PositionType pos = this->SnapshotData.Extend(originSnapshot.Position, - *originSnapshot.Position); + PositionType pos = this->SnapshotData.Push(originSnapshot.Position, + *originSnapshot.Position); pos->ScopeParent = originSnapshot.Position; pos->EntryPointLine = entryPointLine; pos->EntryPointCommand = entryPointCommand; pos->SnapshotType = FunctionCallType; - pos->ExecutionListFile = this->ExecutionListFiles.Extend( + pos->Keep = false; + pos->ExecutionListFile = this->ExecutionListFiles.Push( originSnapshot.Position->ExecutionListFile, fileName); pos->BuildSystemDirectory->DirectoryEnd = pos; pos->PolicyScope = originSnapshot.Position->Policies; @@ -830,7 +834,7 @@ cmState::CreateFunctionCallSnapshot(cmState::Snapshot originSnapshot, cmLinkedTree::iterator origin = originSnapshot.Position->Vars; pos->Parent = origin; - pos->Vars = this->VarTree.Extend(origin); + pos->Vars = this->VarTree.Push(origin); return cmState::Snapshot(this, pos); } @@ -841,12 +845,13 @@ cmState::CreateMacroCallSnapshot(cmState::Snapshot originSnapshot, long entryPointLine, std::string const& fileName) { - PositionType pos = this->SnapshotData.Extend(originSnapshot.Position, - *originSnapshot.Position); + PositionType pos = this->SnapshotData.Push(originSnapshot.Position, + *originSnapshot.Position); pos->EntryPointLine = entryPointLine; pos->EntryPointCommand = entryPointCommand; pos->SnapshotType = MacroCallType; - pos->ExecutionListFile = this->ExecutionListFiles.Extend( + pos->Keep = false; + pos->ExecutionListFile = this->ExecutionListFiles.Push( originSnapshot.Position->ExecutionListFile, fileName); assert(originSnapshot.Position->Vars.IsValid()); pos->BuildSystemDirectory->DirectoryEnd = pos; @@ -860,12 +865,13 @@ cmState::CreateCallStackSnapshot(cmState::Snapshot originSnapshot, long entryPointLine, const std::string& fileName) { - PositionType pos = this->SnapshotData.Extend(originSnapshot.Position, - *originSnapshot.Position); + PositionType pos = this->SnapshotData.Push(originSnapshot.Position, + *originSnapshot.Position); pos->EntryPointLine = entryPointLine; pos->EntryPointCommand = entryPointCommand; pos->SnapshotType = CallStackType; - pos->ExecutionListFile = this->ExecutionListFiles.Extend( + pos->Keep = true; + pos->ExecutionListFile = this->ExecutionListFiles.Push( originSnapshot.Position->ExecutionListFile, fileName); assert(originSnapshot.Position->Vars.IsValid()); pos->BuildSystemDirectory->DirectoryEnd = pos; @@ -878,18 +884,20 @@ cmState::CreateVariableScopeSnapshot(cmState::Snapshot originSnapshot, std::string const& entryPointCommand, long entryPointLine) { - PositionType pos = this->SnapshotData.Extend(originSnapshot.Position, - *originSnapshot.Position); + PositionType pos = this->SnapshotData.Push(originSnapshot.Position, + *originSnapshot.Position); pos->ScopeParent = originSnapshot.Position; pos->EntryPointLine = entryPointLine; pos->EntryPointCommand = entryPointCommand; pos->SnapshotType = VariableScopeType; + pos->Keep = false; + pos->PolicyScope = originSnapshot.Position->Policies; assert(originSnapshot.Position->Vars.IsValid()); cmLinkedTree::iterator origin = originSnapshot.Position->Vars; pos->Parent = origin; - pos->Vars = this->VarTree.Extend(origin); + pos->Vars = this->VarTree.Push(origin); assert(pos->Vars.IsValid()); return cmState::Snapshot(this, pos); } @@ -900,12 +908,13 @@ cmState::CreateInlineListFileSnapshot(cmState::Snapshot originSnapshot, long entryPointLine, const std::string& fileName) { - PositionType pos = this->SnapshotData.Extend(originSnapshot.Position, - *originSnapshot.Position); + PositionType pos = this->SnapshotData.Push(originSnapshot.Position, + *originSnapshot.Position); pos->EntryPointLine = entryPointLine; pos->EntryPointCommand = entryPointCommand; pos->SnapshotType = InlineListFileType; - pos->ExecutionListFile = this->ExecutionListFiles.Extend( + pos->Keep = true; + pos->ExecutionListFile = this->ExecutionListFiles.Push( originSnapshot.Position->ExecutionListFile, fileName); pos->BuildSystemDirectory->DirectoryEnd = pos; pos->PolicyScope = originSnapshot.Position->Policies; @@ -915,9 +924,10 @@ cmState::CreateInlineListFileSnapshot(cmState::Snapshot originSnapshot, cmState::Snapshot cmState::CreatePolicyScopeSnapshot(cmState::Snapshot originSnapshot) { - PositionType pos = this->SnapshotData.Extend(originSnapshot.Position, - *originSnapshot.Position); + PositionType pos = this->SnapshotData.Push(originSnapshot.Position, + *originSnapshot.Position); pos->SnapshotType = PolicyScopeType; + pos->Keep = false; pos->BuildSystemDirectory->DirectoryEnd = pos; pos->PolicyScope = originSnapshot.Position->Policies; return cmState::Snapshot(this, pos); @@ -936,6 +946,21 @@ cmState::Snapshot cmState::Pop(cmState::Snapshot originSnapshot) prevPos->BuildSystemDirectory->CompileOptions.size(); prevPos->BuildSystemDirectory->DirectoryEnd = prevPos; + if (!pos->Keep && this->SnapshotData.IsLast(pos)) + { + if (pos->Vars != prevPos->Vars) + { + assert(this->VarTree.IsLast(pos->Vars)); + this->VarTree.Pop(pos->Vars); + } + if (pos->ExecutionListFile != prevPos->ExecutionListFile) + { + assert(this->ExecutionListFiles.IsLast(pos->ExecutionListFile)); + this->ExecutionListFiles.Pop(pos->ExecutionListFile); + } + this->SnapshotData.Pop(pos); + } + return Snapshot(this, prevPos); } @@ -998,6 +1023,11 @@ void cmState::Directory::SetCurrentBinary(std::string const& dir) this->ComputeRelativePathTopBinary(); } +void cmState::Snapshot::Keep() +{ + this->Position->Keep = true; +} + void cmState::Snapshot::SetListFile(const std::string& listfile) { *this->Position->ExecutionListFile = listfile; @@ -1081,7 +1111,8 @@ cmState::Snapshot cmState::Snapshot::GetCallStackParent() const Snapshot snapshot; PositionType parentPos = this->Position; - while(parentPos->SnapshotType == cmState::PolicyScopeType) + while (parentPos->SnapshotType == cmState::PolicyScopeType || + parentPos->SnapshotType == cmState::VariableScopeType) { ++parentPos; } @@ -1092,7 +1123,8 @@ cmState::Snapshot cmState::Snapshot::GetCallStackParent() const } ++parentPos; - while(parentPos->SnapshotType == cmState::PolicyScopeType) + while (parentPos->SnapshotType == cmState::PolicyScopeType || + parentPos->SnapshotType == cmState::VariableScopeType) { ++parentPos; } @@ -1110,8 +1142,8 @@ void cmState::Snapshot::PushPolicy(cmPolicies::PolicyMap entry, bool weak) { PositionType pos = this->Position; pos->Policies = - this->State->PolicyStack.Extend(pos->Policies, - PolicyStackEntry(entry, weak)); + this->State->PolicyStack.Push(pos->Policies, + PolicyStackEntry(entry, weak)); } bool cmState::Snapshot::PopPolicy() @@ -1121,7 +1153,7 @@ bool cmState::Snapshot::PopPolicy() { return false; } - ++pos->Policies; + pos->Policies = this->State->PolicyStack.Pop(pos->Policies); return true; } diff --git a/Source/cmState.h b/Source/cmState.h index 99e537c07..a66603f62 100644 --- a/Source/cmState.h +++ b/Source/cmState.h @@ -62,6 +62,7 @@ public: std::vector ClosureKeys() const; bool RaiseScope(std::string const& var, const char* varDef); + void Keep(); void SetListFile(std::string const& listfile); std::string GetExecutionListFile() const; diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx index f44c77d6e..a07444458 100644 --- a/Source/cmcmd.cxx +++ b/Source/cmcmd.cxx @@ -1550,7 +1550,6 @@ bool cmVSLink::Parse(std::vector::const_iterator argBeg, // pass it to the link command. this->ManifestFileRC = intDir + "/manifest.rc"; this->ManifestFileRes = intDir + "/manifest.res"; - this->LinkCommand.push_back(this->ManifestFileRes); } else if (this->UserManifests.empty()) { @@ -1658,6 +1657,9 @@ int cmVSLink::LinkIncremental() return -1; } + // Tell the linker to use our manifest compiled into a resource. + this->LinkCommand.push_back(this->ManifestFileRes); + // Run the link command (possibly generates intermediate manifest). if (!RunCommand("LINK Pass 1", this->LinkCommand, this->Verbose)) { diff --git a/Source/kwsys/CPU.h.in b/Source/kwsys/CPU.h.in index 884d71aa6..66ffbb1fd 100644 --- a/Source/kwsys/CPU.h.in +++ b/Source/kwsys/CPU.h.in @@ -88,6 +88,10 @@ #elif defined(__mips) || defined(__mips__) || defined(__MIPS__) # define @KWSYS_NAMESPACE@_CPU_ENDIAN_ID @KWSYS_NAMESPACE@_CPU_ENDIAN_ID_BIG +/* NIOS2 */ +#elif defined(__NIOS2__) || defined(__NIOS2) || defined(__nios2__) +# define @KWSYS_NAMESPACE@_CPU_ENDIAN_ID @KWSYS_NAMESPACE@_CPU_ENDIAN_ID_LITTLE + /* OpenRISC 1000 */ #elif defined(__or1k__) # define @KWSYS_NAMESPACE@_CPU_ENDIAN_ID @KWSYS_NAMESPACE@_CPU_ENDIAN_ID_BIG diff --git a/Tests/MSManifest/Subdir/CMakeLists.txt b/Tests/MSManifest/Subdir/CMakeLists.txt index a47cf0030..11272bb9f 100644 --- a/Tests/MSManifest/Subdir/CMakeLists.txt +++ b/Tests/MSManifest/Subdir/CMakeLists.txt @@ -6,4 +6,6 @@ if(MSVC AND NOT MSVC_VERSION LESS 1400) COMMAND ${CMAKE_COMMAND} -Dexe=$ -P ${CMAKE_CURRENT_SOURCE_DIR}/check.cmake ) + add_executable(MSManifestNone main.c) + set_property(TARGET MSManifestNone PROPERTY LINK_FLAGS "/MANIFEST:NO") endif() diff --git a/Tests/RunCMake/AutoExportDll/sub/sub.cxx b/Tests/RunCMake/AutoExportDll/sub/sub.cxx index 9766b41ec..9a3145ec4 100644 --- a/Tests/RunCMake/AutoExportDll/sub/sub.cxx +++ b/Tests/RunCMake/AutoExportDll/sub/sub.cxx @@ -1,4 +1,6 @@ +#include int sub() { + printf(""); return 10; } diff --git a/Tests/RunCMake/PolicyScope/NotClosed-result.txt b/Tests/RunCMake/PolicyScope/NotClosed-result.txt new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/Tests/RunCMake/PolicyScope/NotClosed-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/PolicyScope/NotClosed-stderr.txt b/Tests/RunCMake/PolicyScope/NotClosed-stderr.txt new file mode 100644 index 000000000..293d16117 --- /dev/null +++ b/Tests/RunCMake/PolicyScope/NotClosed-stderr.txt @@ -0,0 +1,4 @@ +^CMake Error at NotClosed.cmake:[0-9]+ \(include\): + cmake_policy PUSH without matching POP +Call Stack \(most recent call first\): + CMakeLists.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/PolicyScope/NotClosed.cmake b/Tests/RunCMake/PolicyScope/NotClosed.cmake new file mode 100644 index 000000000..19b880efa --- /dev/null +++ b/Tests/RunCMake/PolicyScope/NotClosed.cmake @@ -0,0 +1 @@ +cmake_policy(PUSH) diff --git a/Tests/RunCMake/PolicyScope/NotOpened-result.txt b/Tests/RunCMake/PolicyScope/NotOpened-result.txt new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/Tests/RunCMake/PolicyScope/NotOpened-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/PolicyScope/NotOpened-stderr.txt b/Tests/RunCMake/PolicyScope/NotOpened-stderr.txt new file mode 100644 index 000000000..f27aac8db --- /dev/null +++ b/Tests/RunCMake/PolicyScope/NotOpened-stderr.txt @@ -0,0 +1,4 @@ +^CMake Error at NotOpened.cmake:[0-9]+ \(cmake_policy\): + cmake_policy POP without matching PUSH +Call Stack \(most recent call first\): + CMakeLists.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/PolicyScope/NotOpened.cmake b/Tests/RunCMake/PolicyScope/NotOpened.cmake new file mode 100644 index 000000000..bb9f3a364 --- /dev/null +++ b/Tests/RunCMake/PolicyScope/NotOpened.cmake @@ -0,0 +1 @@ +cmake_policy(POP) diff --git a/Tests/RunCMake/PolicyScope/RunCMakeTest.cmake b/Tests/RunCMake/PolicyScope/RunCMakeTest.cmake index d6c021fc3..abd27f4cd 100644 --- a/Tests/RunCMake/PolicyScope/RunCMakeTest.cmake +++ b/Tests/RunCMake/PolicyScope/RunCMakeTest.cmake @@ -1,4 +1,6 @@ include(RunCMake) +run_cmake(NotClosed) +run_cmake(NotOpened) run_cmake(parent-dir-generate-time) run_cmake(dir-in-macro-generate-time) diff --git a/Tests/RunCMake/add_subdirectory/Function-stdout.txt b/Tests/RunCMake/add_subdirectory/Function-stdout.txt new file mode 100644 index 000000000..16fa857f1 --- /dev/null +++ b/Tests/RunCMake/add_subdirectory/Function-stdout.txt @@ -0,0 +1,10 @@ +-- var='1' before my_add_subdirectory +-- var='2' in my_add_subdirectory before add_subdirectory +-- var='2' in subdirectory before set +-- var='3' in subdirectory after set +-- var_sub='' in subdirectory after set PARENT_SCOPE +-- var='2' in my_add_subdirectory after add_subdirectory +-- var_sub='sub' in my_add_subdirectory after add_subdirectory +-- var='1' after my_add_subdirectory +-- var_sub='' after my_add_subdirectory +-- var='3' taken from subdirectory diff --git a/Tests/RunCMake/add_subdirectory/Function.cmake b/Tests/RunCMake/add_subdirectory/Function.cmake new file mode 100644 index 000000000..e804da968 --- /dev/null +++ b/Tests/RunCMake/add_subdirectory/Function.cmake @@ -0,0 +1,17 @@ +function(my_add_subdirectory dir) + set(var 2) + message(STATUS "var='${var}' in my_add_subdirectory before add_subdirectory") + add_subdirectory(${dir}) + message(STATUS "var='${var}' in my_add_subdirectory after add_subdirectory") + message(STATUS "var_sub='${var_sub}' in my_add_subdirectory after add_subdirectory") +endfunction() + +set(var 1) + +message(STATUS "var='${var}' before my_add_subdirectory") +my_add_subdirectory(Function) +message(STATUS "var='${var}' after my_add_subdirectory") +message(STATUS "var_sub='${var_sub}' after my_add_subdirectory") + +get_directory_property(sub_var DIRECTORY Function DEFINITION var) +message(STATUS "var='${sub_var}' taken from subdirectory") diff --git a/Tests/RunCMake/add_subdirectory/Function/CMakeLists.txt b/Tests/RunCMake/add_subdirectory/Function/CMakeLists.txt new file mode 100644 index 000000000..7b9e801ce --- /dev/null +++ b/Tests/RunCMake/add_subdirectory/Function/CMakeLists.txt @@ -0,0 +1,5 @@ +message(STATUS "var='${var}' in subdirectory before set") +set(var 3) +message(STATUS "var='${var}' in subdirectory after set") +set(var_sub sub PARENT_SCOPE) +message(STATUS "var_sub='${var_sub}' in subdirectory after set PARENT_SCOPE") diff --git a/Tests/RunCMake/add_subdirectory/RunCMakeTest.cmake b/Tests/RunCMake/add_subdirectory/RunCMakeTest.cmake index a3ddec8ec..9d514e162 100644 --- a/Tests/RunCMake/add_subdirectory/RunCMakeTest.cmake +++ b/Tests/RunCMake/add_subdirectory/RunCMakeTest.cmake @@ -2,3 +2,4 @@ include(RunCMake) run_cmake(DoesNotExist) run_cmake(Missing) +run_cmake(Function) diff --git a/Tests/RunCMake/find_package/PolicyPop-result.txt b/Tests/RunCMake/find_package/PolicyPop-result.txt new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/Tests/RunCMake/find_package/PolicyPop-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/find_package/PolicyPop-stderr.txt b/Tests/RunCMake/find_package/PolicyPop-stderr.txt new file mode 100644 index 000000000..745d39a1a --- /dev/null +++ b/Tests/RunCMake/find_package/PolicyPop-stderr.txt @@ -0,0 +1,5 @@ +^CMake Error at PolicyPop/PolicyPopConfigVersion.cmake:3 \(cmake_policy\): + cmake_policy POP without matching PUSH +Call Stack \(most recent call first\): + PolicyPop.cmake:1 \(find_package\) + CMakeLists.txt:3 \(include\)$ diff --git a/Tests/RunCMake/find_package/PolicyPop.cmake b/Tests/RunCMake/find_package/PolicyPop.cmake new file mode 100644 index 000000000..4866f24f5 --- /dev/null +++ b/Tests/RunCMake/find_package/PolicyPop.cmake @@ -0,0 +1 @@ +find_package(PolicyPop 1 CONFIG PATHS ${CMAKE_CURRENT_SOURCE_DIR}/PolicyPop NO_DEFAULT_PATH) diff --git a/Tests/RunCMake/find_package/PolicyPop/PolicyPopConfig.cmake b/Tests/RunCMake/find_package/PolicyPop/PolicyPopConfig.cmake new file mode 100644 index 000000000..e69de29bb diff --git a/Tests/RunCMake/find_package/PolicyPop/PolicyPopConfigVersion.cmake b/Tests/RunCMake/find_package/PolicyPop/PolicyPopConfigVersion.cmake new file mode 100644 index 000000000..483fb10f2 --- /dev/null +++ b/Tests/RunCMake/find_package/PolicyPop/PolicyPopConfigVersion.cmake @@ -0,0 +1,3 @@ +set(PACKAGE_VERSION 1) +set(PACKAGE_VERSION_COMPATIBLE 1) +cmake_policy(POP) diff --git a/Tests/RunCMake/find_package/PolicyPush-result.txt b/Tests/RunCMake/find_package/PolicyPush-result.txt new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/Tests/RunCMake/find_package/PolicyPush-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/find_package/PolicyPush-stderr.txt b/Tests/RunCMake/find_package/PolicyPush-stderr.txt new file mode 100644 index 000000000..1afcb1627 --- /dev/null +++ b/Tests/RunCMake/find_package/PolicyPush-stderr.txt @@ -0,0 +1,5 @@ +^CMake Error at PolicyPush/PolicyPushConfigVersion.cmake:1 \(find_package\): + cmake_policy PUSH without matching POP +Call Stack \(most recent call first\): + PolicyPush.cmake:1 \(find_package\) + CMakeLists.txt:3 \(include\)$ diff --git a/Tests/RunCMake/find_package/PolicyPush.cmake b/Tests/RunCMake/find_package/PolicyPush.cmake new file mode 100644 index 000000000..30c3ce2a3 --- /dev/null +++ b/Tests/RunCMake/find_package/PolicyPush.cmake @@ -0,0 +1 @@ +find_package(PolicyPush 1 CONFIG PATHS ${CMAKE_CURRENT_SOURCE_DIR}/PolicyPush NO_DEFAULT_PATH) diff --git a/Tests/RunCMake/find_package/PolicyPush/PolicyPushConfig.cmake b/Tests/RunCMake/find_package/PolicyPush/PolicyPushConfig.cmake new file mode 100644 index 000000000..e69de29bb diff --git a/Tests/RunCMake/find_package/PolicyPush/PolicyPushConfigVersion.cmake b/Tests/RunCMake/find_package/PolicyPush/PolicyPushConfigVersion.cmake new file mode 100644 index 000000000..45a8dbd40 --- /dev/null +++ b/Tests/RunCMake/find_package/PolicyPush/PolicyPushConfigVersion.cmake @@ -0,0 +1,3 @@ +set(PACKAGE_VERSION 1) +set(PACKAGE_VERSION_COMPATIBLE 1) +cmake_policy(PUSH) diff --git a/Tests/RunCMake/find_package/RunCMakeTest.cmake b/Tests/RunCMake/find_package/RunCMakeTest.cmake index 42705b77a..81b29068c 100644 --- a/Tests/RunCMake/find_package/RunCMakeTest.cmake +++ b/Tests/RunCMake/find_package/RunCMakeTest.cmake @@ -13,4 +13,6 @@ run_cmake(MissingConfigOneName) run_cmake(MissingConfigRequired) run_cmake(MissingConfigVersion) run_cmake(MixedModeOptions) +run_cmake(PolicyPush) +run_cmake(PolicyPop) run_cmake(SetFoundFALSE) diff --git a/Utilities/KWIML/ABI.h.in b/Utilities/KWIML/ABI.h.in index 6300ada4e..87b6e96da 100644 --- a/Utilities/KWIML/ABI.h.in +++ b/Utilities/KWIML/ABI.h.in @@ -398,6 +398,10 @@ suppression macro @KWIML@_ABI_NO_VERIFY was defined. #elif defined(__mips) || defined(__mips__) || defined(__MIPS__) # define @KWIML@_ABI_ENDIAN_ID @KWIML@_ABI_ENDIAN_ID_BIG +/* NIOS2 */ +#elif defined(__NIOS2__) || defined(__NIOS2) || defined(__nios2__) +# define @KWIML@_ABI_ENDIAN_ID @KWIML@_ABI_ENDIAN_ID_LITTLE + /* OpenRISC 1000 */ #elif defined(__or1k__) # define @KWIML@_ABI_ENDIAN_ID @KWIML@_ABI_ENDIAN_ID_BIG