summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Modules/CMakeCCompiler.cmake.in1
-rw-r--r--Modules/CMakeCCompilerId.c.in1
-rw-r--r--Modules/CMakeCInformation.cmake4
-rw-r--r--Modules/CMakeCXXCompiler.cmake.in1
-rw-r--r--Modules/CMakeCXXCompilerId.cpp.in1
-rw-r--r--Modules/CMakeCXXInformation.cmake4
-rw-r--r--Modules/CMakeDetermineCompilerId.cmake8
-rw-r--r--Modules/CMakeFortranCompiler.cmake.in1
-rw-r--r--Modules/CMakeFortranCompilerId.F.in2
-rw-r--r--Modules/CMakeFortranInformation.cmake4
-rw-r--r--Modules/Compiler/AppleClang-C.cmake3
-rw-r--r--Modules/Compiler/AppleClang-CXX.cmake3
-rw-r--r--Modules/Compiler/Clang-C.cmake7
-rw-r--r--Modules/Compiler/Clang-CXX.cmake3
-rw-r--r--Modules/Compiler/GNU-C.cmake7
-rw-r--r--Modules/Compiler/GNU-CXX.cmake3
-rw-r--r--Modules/Compiler/SunPro-CXX.cmake3
-rw-r--r--Modules/FindGTest.cmake6
-rw-r--r--Source/bindexplib.cxx2
-rw-r--r--Source/cmELF.cxx8
-rw-r--r--Source/cmGeneratorTarget.cxx1
-rw-r--r--Source/cmLinkedTree.h33
-rw-r--r--Source/cmListFileCache.cxx15
-rw-r--r--Source/cmListFileCache.h6
-rw-r--r--Source/cmLocalGenerator.cxx6
-rw-r--r--Source/cmMakefile.cxx28
-rw-r--r--Source/cmMakefile.h8
-rw-r--r--Source/cmState.cxx96
-rw-r--r--Source/cmState.h1
-rw-r--r--Source/cmcmd.cxx4
-rw-r--r--Tests/MSManifest/Subdir/CMakeLists.txt2
-rw-r--r--Tests/RunCMake/AutoExportDll/sub/sub.cxx2
-rw-r--r--Tests/RunCMake/PolicyScope/NotClosed-result.txt1
-rw-r--r--Tests/RunCMake/PolicyScope/NotClosed-stderr.txt4
-rw-r--r--Tests/RunCMake/PolicyScope/NotClosed.cmake1
-rw-r--r--Tests/RunCMake/PolicyScope/NotOpened-result.txt1
-rw-r--r--Tests/RunCMake/PolicyScope/NotOpened-stderr.txt4
-rw-r--r--Tests/RunCMake/PolicyScope/NotOpened.cmake1
-rw-r--r--Tests/RunCMake/PolicyScope/RunCMakeTest.cmake2
-rw-r--r--Tests/RunCMake/add_subdirectory/Function-stdout.txt10
-rw-r--r--Tests/RunCMake/add_subdirectory/Function.cmake17
-rw-r--r--Tests/RunCMake/add_subdirectory/Function/CMakeLists.txt5
-rw-r--r--Tests/RunCMake/add_subdirectory/RunCMakeTest.cmake1
-rw-r--r--Tests/RunCMake/find_package/PolicyPop-result.txt1
-rw-r--r--Tests/RunCMake/find_package/PolicyPop-stderr.txt5
-rw-r--r--Tests/RunCMake/find_package/PolicyPop.cmake1
-rw-r--r--Tests/RunCMake/find_package/PolicyPop/PolicyPopConfig.cmake0
-rw-r--r--Tests/RunCMake/find_package/PolicyPop/PolicyPopConfigVersion.cmake3
-rw-r--r--Tests/RunCMake/find_package/PolicyPush-result.txt1
-rw-r--r--Tests/RunCMake/find_package/PolicyPush-stderr.txt5
-rw-r--r--Tests/RunCMake/find_package/PolicyPush.cmake1
-rw-r--r--Tests/RunCMake/find_package/PolicyPush/PolicyPushConfig.cmake0
-rw-r--r--Tests/RunCMake/find_package/PolicyPush/PolicyPushConfigVersion.cmake3
-rw-r--r--Tests/RunCMake/find_package/RunCMakeTest.cmake2
54 files changed, 246 insertions, 97 deletions
diff --git a/Modules/CMakeCCompiler.cmake.in b/Modules/CMakeCCompiler.cmake.in
index a1bfc70..c72e338 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 b224007..63f8787 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 0d102a1..d2417aa 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 4218a6d..52e44f6 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 d467507..61cd790 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 dad7969..091627b 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 2e74100..81c2509 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 6b984e5..14fdd60 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 017af91..2f7f40e 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 aa48df7..79393d3 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 5908c26..1cc72c0 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 c4e342b..95bc79a 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 a2e81c1..d8b7743 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 055a8ee..6a0a5e2 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 d979fb7..2c478da 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 a7e71c3..e1c555b 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 50d68ee..b4a5591 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 fccf877..eb7abfd 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/bindexplib.cxx b/Source/bindexplib.cxx
index dc4db63..b250842 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<cmANON_OBJECT_HEADER_BIGOBJ, cmIMAGE_SYMBOL_EX>
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 d062987..37dd328 100644
--- a/Source/cmELF.cxx
+++ b/Source/cmELF.cxx
@@ -567,8 +567,14 @@ bool cmELFInternalImpl<Types>::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<int>(sec.sh_size / sec.sh_entsize);
this->DynamicSectionEntries.resize(n);
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 62598f4..194cd88 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 721a246..3b41459 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<cmLinkedTree*>(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 bff2986..1465f90 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 0afd7f5..17ee10f 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 3230403..233e7fe 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 cb66a75..3c19f55 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 111f074..1edffdc 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/cmState.cxx b/Source/cmState.cxx
index ce9ff32..c1ead6c 100644
--- a/Source/cmState.cxx
+++ b/Source/cmState.cxx
@@ -27,6 +27,7 @@ struct cmState::SnapshotDataType
cmLinkedTree<cmState::PolicyStackEntry>::iterator PolicyRoot;
cmLinkedTree<cmState::PolicyStackEntry>::iterator PolicyScope;
cmState::SnapshotType SnapshotType;
+ bool Keep;
cmLinkedTree<std::string>::iterator ExecutionListFile;
cmLinkedTree<cmState::BuildsystemDirectoryStateType>::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<cmDefinitions>::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<cmDefinitions>::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 99e537c..a66603f 100644
--- a/Source/cmState.h
+++ b/Source/cmState.h
@@ -62,6 +62,7 @@ public:
std::vector<std::string> 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 f44c77d..a074444 100644
--- a/Source/cmcmd.cxx
+++ b/Source/cmcmd.cxx
@@ -1550,7 +1550,6 @@ bool cmVSLink::Parse(std::vector<std::string>::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/Tests/MSManifest/Subdir/CMakeLists.txt b/Tests/MSManifest/Subdir/CMakeLists.txt
index a47cf00..11272bb 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=$<TARGET_FILE:MSManifest>
-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 9766b41..9a3145e 100644
--- a/Tests/RunCMake/AutoExportDll/sub/sub.cxx
+++ b/Tests/RunCMake/AutoExportDll/sub/sub.cxx
@@ -1,4 +1,6 @@
+#include <stdio.h>
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 0000000..d00491f
--- /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 0000000..293d161
--- /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 0000000..19b880e
--- /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 0000000..d00491f
--- /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 0000000..f27aac8
--- /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 0000000..bb9f3a3
--- /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 d6c021f..abd27f4 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 0000000..16fa857
--- /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 0000000..e804da9
--- /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 0000000..7b9e801
--- /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 a3ddec8..9d514e1 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 0000000..d00491f
--- /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 0000000..745d39a
--- /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 0000000..4866f24
--- /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 0000000..e69de29
--- /dev/null
+++ b/Tests/RunCMake/find_package/PolicyPop/PolicyPopConfig.cmake
diff --git a/Tests/RunCMake/find_package/PolicyPop/PolicyPopConfigVersion.cmake b/Tests/RunCMake/find_package/PolicyPop/PolicyPopConfigVersion.cmake
new file mode 100644
index 0000000..483fb10
--- /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 0000000..d00491f
--- /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 0000000..1afcb16
--- /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 0000000..30c3ce2
--- /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 0000000..e69de29
--- /dev/null
+++ b/Tests/RunCMake/find_package/PolicyPush/PolicyPushConfig.cmake
diff --git a/Tests/RunCMake/find_package/PolicyPush/PolicyPushConfigVersion.cmake b/Tests/RunCMake/find_package/PolicyPush/PolicyPushConfigVersion.cmake
new file mode 100644
index 0000000..45a8dbd
--- /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 42705b7..81b2906 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)