summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Help/dev/README.rst9
-rw-r--r--Help/dev/maint.rst171
-rw-r--r--Modules/GoogleTest.cmake46
-rw-r--r--Source/CMakeVersion.cmake2
-rw-r--r--Source/CTest/cmCTestMultiProcessHandler.cxx8
-rw-r--r--Source/Checks/cm_cxx_attribute_fallthrough.cxx11
-rw-r--r--Source/Checks/cm_cxx_fallthrough.cxx11
-rw-r--r--Source/Checks/cm_cxx_features.cmake9
-rw-r--r--Source/Checks/cm_cxx_gnu_fallthrough.cxx11
-rw-r--r--Source/cmCacheManager.cxx3
-rw-r--r--Source/cmCacheManager.h2
-rw-r--r--Source/cmComputeLinkDepends.cxx2
-rw-r--r--Source/cmComputeLinkDepends.h2
-rw-r--r--Source/cmConditionEvaluator.cxx4
-rw-r--r--Source/cmConfigure.cmake.h.in13
-rw-r--r--Source/cmCoreTryCompile.cxx4
-rw-r--r--Source/cmDynamicLoader.cxx7
-rw-r--r--Source/cmELF.cxx8
-rw-r--r--Source/cmExportFileGenerator.cxx1
-rw-r--r--Source/cmExtraCodeLiteGenerator.cxx1
-rw-r--r--Source/cmFileCommand.cxx9
-rw-r--r--Source/cmFindPackageCommand.cxx24
-rw-r--r--Source/cmFindProgramCommand.cxx3
-rw-r--r--Source/cmFindProgramCommand.h2
-rw-r--r--Source/cmGeneratorExpressionNode.cxx2
-rw-r--r--Source/cmGeneratorTarget.cxx13
-rw-r--r--Source/cmGetDirectoryPropertyCommand.cxx1
-rw-r--r--Source/cmGetPropertyCommand.cxx1
-rw-r--r--Source/cmGlobalGenerator.cxx7
-rw-r--r--Source/cmGlobalGenerator.h6
-rw-r--r--Source/cmGlobalNinjaGenerator.cxx3
-rw-r--r--Source/cmGlobalNinjaGenerator.h2
-rw-r--r--Source/cmInstallCommand.cxx4
-rw-r--r--Source/cmInstallGenerator.cxx2
-rw-r--r--Source/cmInstallGenerator.h2
-rw-r--r--Source/cmLinkDirectoriesCommand.cxx1
-rw-r--r--Source/cmLinkLineComputer.cxx2
-rw-r--r--Source/cmLinkLineComputer.h2
-rw-r--r--Source/cmLinkLineDeviceComputer.cxx5
-rw-r--r--Source/cmLinkLineDeviceComputer.h4
-rw-r--r--Source/cmListFileCache.cxx8
-rw-r--r--Source/cmListFileCache.h6
-rw-r--r--Source/cmLocalGenerator.cxx5
-rw-r--r--Source/cmMSVC60LinkLineComputer.cxx4
-rw-r--r--Source/cmMSVC60LinkLineComputer.h2
-rw-r--r--Source/cmMakefile.cxx13
-rw-r--r--Source/cmMakefile.h2
-rw-r--r--Source/cmMakefileTargetGenerator.cxx4
-rw-r--r--Source/cmMakefileTargetGenerator.h2
-rw-r--r--Source/cmNinjaLinkLineComputer.cxx3
-rw-r--r--Source/cmNinjaLinkLineComputer.h2
-rw-r--r--Source/cmOrderDirectories.cxx2
-rw-r--r--Source/cmOutputConverter.cxx4
-rw-r--r--Source/cmOutputConverter.h4
-rw-r--r--Source/cmState.cxx16
-rw-r--r--Source/cmState.h26
-rw-r--r--Source/cmStateSnapshot.cxx2
-rw-r--r--Source/cmStateSnapshot.h2
-rw-r--r--Tests/GoogleTest/Test/CMakeLists.txt15
-rw-r--r--Tests/GoogleTest/Test/main2.h15
-rw-r--r--Tests/RunCMake/CMakeLists.txt2
-rw-r--r--Tests/RunCMake/GNUInstallDirs/Common.cmake3
-rw-r--r--Tests/RunCMake/GNUInstallDirs/Opt-BSD-stderr.txt30
-rw-r--r--Tests/RunCMake/GNUInstallDirs/Root-BSD-stderr.txt30
-rw-r--r--Tests/RunCMake/GNUInstallDirs/RunCMakeTest.cmake19
-rw-r--r--Tests/RunCMake/GNUInstallDirs/Usr-BSD-stderr.txt30
-rw-r--r--Tests/RunCMake/GNUInstallDirs/UsrLocal-BSD-stderr.txt30
-rwxr-xr-xUtilities/Release/consolidate-relnotes.bash27
-rwxr-xr-xbootstrap1
69 files changed, 611 insertions, 118 deletions
diff --git a/Help/dev/README.rst b/Help/dev/README.rst
index 163be97..ce62abc 100644
--- a/Help/dev/README.rst
+++ b/Help/dev/README.rst
@@ -38,3 +38,12 @@ CMake developer documentation is provided by the following documents:
* The `CMake Source Code Guide`_.
.. _`CMake Source Code Guide`: source.rst
+
+Maintainer Documentation
+========================
+
+CMake maintainer documentation is provided by the following documents:
+
+* The `CMake Maintainer Guide`_.
+
+.. _`CMake Maintainer Guide`: maint.rst
diff --git a/Help/dev/maint.rst b/Help/dev/maint.rst
new file mode 100644
index 0000000..78c06df
--- /dev/null
+++ b/Help/dev/maint.rst
@@ -0,0 +1,171 @@
+CMake Maintainer Guide
+**********************
+
+The following is a guide to CMake maintenance processes.
+See documentation on `CMake Development`_ for more information.
+
+.. _`CMake Development`: README.rst
+
+.. contents:: Maintainer Processes:
+
+Branch a New Release
+====================
+
+This section covers how to start a new ``release`` branch for a major or
+minor version bump (patch releases remain on their existing branch).
+
+In the following we use the placeholder ``$ver`` to represent the
+version number of the new release with the form ``$major.$minor``,
+and ``$prev`` to represent the version number of the prior release.
+
+Review Prior Release
+--------------------
+
+Review the history around the prior release branch:
+
+.. code-block:: shell
+
+ git log --graph --boundary \
+ ^$(git rev-list --grep="Merge topic 'doc-.*-relnotes'" -n 1 master)~1 \
+ $(git rev-list --grep="Begin post-.* development" -n 1 master) \
+ $(git tag --list *-rc1| tail -1)
+
+Consolidate Release Notes
+-------------------------
+
+Starting from a clean work tree on ``master``, create a topic branch to
+use for consolidating the release notes:
+
+.. code-block:: shell
+
+ git checkout -b doc-$ver-relnotes
+
+Run the `consolidate-relnotes.bash`_ script:
+
+.. code-block:: shell
+
+ Utilities/Release/consolidate-relnotes.bash $ver $prev
+
+.. _`consolidate-relnotes.bash`: ../../Utilities/Release/consolidate-relnotes.bash
+
+This moves notes from the ``Help/release/dev/*.rst`` files into a versioned
+``Help/release/$ver.rst`` file and updates ``Help/release/index.rst`` to
+link to the new document. Commit the changes with a message such as::
+
+ Help: Consolidate $ver release notes
+
+ Run the `Utilities/Release/consolidate-relnotes.bash` script to move
+ notes from `Help/release/dev/*` into `Help/release/$ver.rst`.
+
+Manually edit ``Help/release/$ver.rst`` to add section headers, organize
+the notes, and revise wording. Then commit with a message such as::
+
+ Help: Organize and revise $ver release notes
+
+ Add section headers similar to the $prev release notes and move each
+ individual bullet into an appropriate section. Revise a few bullets.
+
+Open a merge request with the ``doc-$ver-relnotes`` branch for review
+and integration. Further steps may proceed after this has been merged
+to ``master``.
+
+Update 'release' Branch
+-----------------------
+
+Starting from a clean work tree on ``master``, create a new ``release-$ver``
+branch locally:
+
+.. code-block:: shell
+
+ git checkout -b release-$ver origin/master
+
+Remove the development branch release note infrastructure:
+
+.. code-block:: shell
+
+ git rm Help/release/dev/0-sample-topic.rst
+ sed -i '/^\.\. include:: dev.txt/ {N;d}' Help/release/index.rst
+
+Commit with a message such as::
+
+ Help: Drop development topic notes to prepare release
+
+ Release versions do not have the development topic section of
+ the CMake Release Notes index page.
+
+Update ``Source/CMakeVersion.cmake`` to set the version to
+``$major.$minor.0-rc1``:
+
+.. code-block:: cmake
+
+ # CMake version number components.
+ set(CMake_VERSION_MAJOR $major)
+ set(CMake_VERSION_MINOR $minor)
+ set(CMake_VERSION_PATCH 0)
+ set(CMake_VERSION_RC 1)
+
+Update ``Utilities/Release/upload_release.cmake``:
+
+.. code-block:: cmake
+
+ set(VERSION $ver)
+
+Update uses of ``DEVEL_CMAKE_VERSION`` in the source tree to mention the
+actual version number:
+
+.. code-block:: shell
+
+ $EDITOR $(git grep -l DEVEL_CMAKE_VERSION)
+
+Commit with a message such as::
+
+ CMake $major.$minor.0-rc1 version update
+
+Merge the ``release-$ver`` branch to ``master``:
+
+.. code-block:: shell
+
+ git checkout master
+ git pull
+ git merge --no-ff release-$ver
+
+Begin post-release development by restoring the development branch release
+note infrastructure and the version date from ``origin/master``:
+
+.. code-block:: shell
+
+ git checkout origin/master -- \
+ Source/CMakeVersion.cmake Help/release/dev/0-sample-topic.rst
+ sed -i $'/^Releases/ i\\\n.. include:: dev.txt\\\n' Help/release/index.rst
+
+Update ``Source/CMakeVersion.cmake`` to set the version to
+``$major.$minor.$date``:
+
+.. code-block:: cmake
+
+ # CMake version number components.
+ set(CMake_VERSION_MAJOR $major)
+ set(CMake_VERSION_MINOR $minor)
+ set(CMake_VERSION_PATCH $date)
+ #set(CMake_VERSION_RC 1)
+
+Commit with a message such as::
+
+ Begin post-$ver development
+
+Push the update to the ``master`` and ``release`` branches:
+
+.. code-block:: shell
+
+ git push --atomic origin master release-$ver:release
+
+Announce 'release' Branch
+-------------------------
+
+Send email to the ``cmake-developers@cmake.org`` mailing list (perhaps
+in reply to a release preparation thread) announcing that post-release
+development is open::
+
+ I've branched 'release' for $ver. The repository is now open for
+ post-$ver development. Please rebase open merge requests on 'master'
+ before staging or merging.
diff --git a/Modules/GoogleTest.cmake b/Modules/GoogleTest.cmake
index c9e0544..7415e06 100644
--- a/Modules/GoogleTest.cmake
+++ b/Modules/GoogleTest.cmake
@@ -172,20 +172,50 @@ function(gtest_add_tests)
# Parameterized tests have a different signature for the filter
if("x${test_type}" STREQUAL "xTEST_P")
- string(REGEX REPLACE ${gtest_case_name_regex} "*/\\1.\\2/*" test_name ${hit})
+ string(REGEX REPLACE ${gtest_case_name_regex} "*/\\1.\\2/*" gtest_test_name ${hit})
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})
+ string(REGEX REPLACE ${gtest_case_name_regex} "\\1.\\2" gtest_test_name ${hit})
elseif("x${test_type}" STREQUAL "xTYPED_TEST")
- string(REGEX REPLACE ${gtest_case_name_regex} "\\1/*.\\2" test_name ${hit})
+ string(REGEX REPLACE ${gtest_case_name_regex} "\\1/*.\\2" gtest_test_name ${hit})
else()
message(WARNING "Could not parse GTest ${hit} for adding to CTest.")
continue()
endif()
- add_test(NAME ${ARGS_TEST_PREFIX}${test_name}${ARGS_TEST_SUFFIX}
- ${workDir}
- COMMAND ${ARGS_TARGET} --gtest_filter=${test_name} ${ARGS_EXTRA_ARGS}
- )
- list(APPEND testList ${ARGS_TEST_PREFIX}${test_name}${ARGS_TEST_SUFFIX})
+
+ # Make sure tests disabled in GTest get disabled in CTest
+ if(gtest_test_name MATCHES "(^|\\.)DISABLED_")
+ # Add the disabled test if CMake is new enough
+ # Note that this check is to allow backwards compatibility so this
+ # module can be copied locally in projects to use with older CMake
+ # versions
+ if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.8.20170401)
+ string(REGEX REPLACE
+ "(^|\\.)DISABLED_" "\\1"
+ orig_test_name "${gtest_test_name}"
+ )
+ set(ctest_test_name
+ ${ARGS_TEST_PREFIX}${orig_test_name}${ARGS_TEST_SUFFIX}
+ )
+ add_test(NAME ${ctest_test_name}
+ ${workDir}
+ COMMAND ${ARGS_TARGET}
+ --gtest_also_run_disabled_tests
+ --gtest_filter=${gtest_test_name}
+ ${ARGS_EXTRA_ARGS}
+ )
+ set_tests_properties(${ctest_test_name} PROPERTIES DISABLED TRUE)
+ list(APPEND testList ${ctest_test_name})
+ endif()
+ else()
+ set(ctest_test_name ${ARGS_TEST_PREFIX}${gtest_test_name}${ARGS_TEST_SUFFIX})
+ add_test(NAME ${ctest_test_name}
+ ${workDir}
+ COMMAND ${ARGS_TARGET}
+ --gtest_filter=${gtest_test_name}
+ ${ARGS_EXTRA_ARGS}
+ )
+ list(APPEND testList ${ctest_test_name})
+ endif()
endforeach()
endforeach()
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index 0555bd7..8983057 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 8)
-set(CMake_VERSION_PATCH 20170602)
+set(CMake_VERSION_PATCH 20170605)
#set(CMake_VERSION_RC 1)
diff --git a/Source/CTest/cmCTestMultiProcessHandler.cxx b/Source/CTest/cmCTestMultiProcessHandler.cxx
index fdc16b1..2c16a0d 100644
--- a/Source/CTest/cmCTestMultiProcessHandler.cxx
+++ b/Source/CTest/cmCTestMultiProcessHandler.cxx
@@ -720,9 +720,13 @@ void cmCTestMultiProcessHandler::PrintTestList()
std::setw(3 + getNumWidth(this->TestHandler->GetMaxIndex()))
<< indexStr.str(),
this->Quiet);
- cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, " ", this->Quiet);
- cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, p.Name << std::endl,
+ cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, " " << p.Name,
this->Quiet);
+ if (p.Disabled) {
+ cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, " (Disabled)",
+ this->Quiet);
+ }
+ cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, std::endl, this->Quiet);
}
cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, std::endl
diff --git a/Source/Checks/cm_cxx_attribute_fallthrough.cxx b/Source/Checks/cm_cxx_attribute_fallthrough.cxx
new file mode 100644
index 0000000..df43625
--- /dev/null
+++ b/Source/Checks/cm_cxx_attribute_fallthrough.cxx
@@ -0,0 +1,11 @@
+int main(int argc, char* argv[])
+{
+ int i = 3;
+ switch (argc) {
+ case 1:
+ i = 0;
+ __attribute__((fallthrough));
+ default:
+ return i;
+ }
+}
diff --git a/Source/Checks/cm_cxx_fallthrough.cxx b/Source/Checks/cm_cxx_fallthrough.cxx
new file mode 100644
index 0000000..7b35a5f
--- /dev/null
+++ b/Source/Checks/cm_cxx_fallthrough.cxx
@@ -0,0 +1,11 @@
+int main(int argc, char* argv[])
+{
+ int i = 3;
+ switch (argc) {
+ case 1:
+ i = 0;
+ [[fallthrough]];
+ default:
+ return i;
+ }
+}
diff --git a/Source/Checks/cm_cxx_features.cmake b/Source/Checks/cm_cxx_features.cmake
index 458901e..c3835c3 100644
--- a/Source/Checks/cm_cxx_features.cmake
+++ b/Source/Checks/cm_cxx_features.cmake
@@ -15,7 +15,7 @@ function(cm_check_cxx_feature name)
OUTPUT_VARIABLE OUTPUT
)
# If using the feature causes warnings, treat it as broken/unavailable.
- if(OUTPUT MATCHES "warning")
+ if(OUTPUT MATCHES "[Ww]arning")
set(CMake_HAVE_CXX_${FEATURE} OFF CACHE INTERNAL "TRY_COMPILE" FORCE)
endif()
if(CMake_HAVE_CXX_${FEATURE})
@@ -38,6 +38,13 @@ endfunction()
cm_check_cxx_feature(auto_ptr)
cm_check_cxx_feature(eq_delete)
+cm_check_cxx_feature(fallthrough)
+if(NOT CMake_HAVE_CXX_FALLTHROUGH)
+ cm_check_cxx_feature(gnu_fallthrough)
+ if(NOT CMake_HAVE_CXX_GNU_FALLTHROUGH)
+ cm_check_cxx_feature(attribute_fallthrough)
+ endif()
+endif()
cm_check_cxx_feature(make_unique)
if(CMake_HAVE_CXX_MAKE_UNIQUE)
set(CMake_HAVE_CXX_UNIQUE_PTR 1)
diff --git a/Source/Checks/cm_cxx_gnu_fallthrough.cxx b/Source/Checks/cm_cxx_gnu_fallthrough.cxx
new file mode 100644
index 0000000..6021094
--- /dev/null
+++ b/Source/Checks/cm_cxx_gnu_fallthrough.cxx
@@ -0,0 +1,11 @@
+int main(int argc, char* argv[])
+{
+ int i = 3;
+ switch (argc) {
+ case 1:
+ i = 0;
+ [[gnu::fallthrough]];
+ default:
+ return i;
+ }
+}
diff --git a/Source/cmCacheManager.cxx b/Source/cmCacheManager.cxx
index 224cf47..0b025ab 100644
--- a/Source/cmCacheManager.cxx
+++ b/Source/cmCacheManager.cxx
@@ -205,8 +205,7 @@ bool cmCacheManager::ReadPropertyEntry(std::string const& entryKey,
return false;
}
-void cmCacheManager::WritePropertyEntries(std::ostream& os,
- CacheIterator const& i)
+void cmCacheManager::WritePropertyEntries(std::ostream& os, CacheIterator i)
{
for (const char** p = this->PersistentProperties; *p; ++p) {
if (const char* value = i.GetProperty(*p)) {
diff --git a/Source/cmCacheManager.h b/Source/cmCacheManager.h
index a72d6cb..c464311 100644
--- a/Source/cmCacheManager.h
+++ b/Source/cmCacheManager.h
@@ -228,7 +228,7 @@ private:
static const char* PersistentProperties[];
bool ReadPropertyEntry(std::string const& key, CacheEntry& e);
- void WritePropertyEntries(std::ostream& os, CacheIterator const& i);
+ void WritePropertyEntries(std::ostream& os, CacheIterator i);
CacheEntryMap Cache;
// Only cmake and cmState should be able to add cache values
diff --git a/Source/cmComputeLinkDepends.cxx b/Source/cmComputeLinkDepends.cxx
index 3e2cf18..9c516ee 100644
--- a/Source/cmComputeLinkDepends.cxx
+++ b/Source/cmComputeLinkDepends.cxx
@@ -333,7 +333,7 @@ int cmComputeLinkDepends::AddLinkEntry(cmLinkItem const& item)
return index;
}
-void cmComputeLinkDepends::FollowLinkEntry(BFSEntry const& qe)
+void cmComputeLinkDepends::FollowLinkEntry(BFSEntry qe)
{
// Get this entry representation.
int depender_index = qe.Index;
diff --git a/Source/cmComputeLinkDepends.h b/Source/cmComputeLinkDepends.h
index 195b544..84ee916 100644
--- a/Source/cmComputeLinkDepends.h
+++ b/Source/cmComputeLinkDepends.h
@@ -93,7 +93,7 @@ private:
const char* LibDepends;
};
std::queue<BFSEntry> BFSQueue;
- void FollowLinkEntry(BFSEntry const&);
+ void FollowLinkEntry(BFSEntry qe);
// Shared libraries that are included only because they are
// dependencies of other shared libraries, not because they are part
diff --git a/Source/cmConditionEvaluator.cxx b/Source/cmConditionEvaluator.cxx
index bcfbfbe..2bacf73 100644
--- a/Source/cmConditionEvaluator.cxx
+++ b/Source/cmConditionEvaluator.cxx
@@ -285,12 +285,12 @@ bool cmConditionEvaluator::GetBooleanValueWithAutoDereference(
bool oldResult = this->GetBooleanValueOld(newArg, oneArg);
if (newResult != oldResult) {
switch (this->Policy12Status) {
- case cmPolicies::WARN: {
+ case cmPolicies::WARN:
errorString = "An argument named \"" + newArg.GetValue() +
"\" appears in a conditional statement. " +
cmPolicies::GetPolicyWarning(cmPolicies::CMP0012);
status = cmake::AUTHOR_WARNING;
- }
+ CM_FALLTHROUGH;
case cmPolicies::OLD:
return oldResult;
case cmPolicies::REQUIRED_IF_USED:
diff --git a/Source/cmConfigure.cmake.h.in b/Source/cmConfigure.cmake.h.in
index 970fde5..524fdf8 100644
--- a/Source/cmConfigure.cmake.h.in
+++ b/Source/cmConfigure.cmake.h.in
@@ -22,6 +22,9 @@
#cmakedefine CMAKE_USE_LIBUV
#cmakedefine CMake_HAVE_CXX_AUTO_PTR
#cmakedefine CMake_HAVE_CXX_EQ_DELETE
+#cmakedefine CMake_HAVE_CXX_FALLTHROUGH
+#cmakedefine CMake_HAVE_CXX_GNU_FALLTHROUGH
+#cmakedefine CMake_HAVE_CXX_ATTRIBUTE_FALLTHROUGH
#cmakedefine CMake_HAVE_CXX_MAKE_UNIQUE
#cmakedefine CMake_HAVE_CXX_NULLPTR
#cmakedefine CMake_HAVE_CXX_OVERRIDE
@@ -37,6 +40,16 @@
#define CM_EQ_DELETE
#endif
+#if defined(CMake_HAVE_CXX_FALLTHROUGH)
+#define CM_FALLTHROUGH [[fallthrough]]
+#elif defined(CMake_HAVE_CXX_GNU_FALLTHROUGH)
+#define CM_FALLTHROUGH [[gnu::fallthrough]]
+elif defined(CMake_HAVE_CXX_ATTRIBUTE_FALLTHROUGH)
+#define CM_FALLTHROUGH __attribute__((fallthrough))
+#else
+#define CM_FALLTHROUGH
+#endif
+
#ifdef CMake_HAVE_CXX_NULLPTR
#define CM_NULLPTR nullptr
#else
diff --git a/Source/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx
index c461739..9a4abf3 100644
--- a/Source/cmCoreTryCompile.cxx
+++ b/Source/cmCoreTryCompile.cxx
@@ -219,6 +219,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv,
if (tgt->IsExecutableWithExports()) {
break;
}
+ CM_FALLTHROUGH;
default:
this->Makefile->IssueMessage(
cmake::FATAL_ERROR,
@@ -516,6 +517,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv,
this->Makefile->IssueMessage(
cmake::FATAL_ERROR,
cmPolicies::GetRequiredPolicyError(cmPolicies::CMP0066));
+ CM_FALLTHROUGH;
case cmPolicies::NEW: {
// NEW behavior is to pass config-specific compiler flags.
static std::string const cfgDefault = "DEBUG";
@@ -553,6 +555,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv,
this->Makefile->IssueMessage(
cmake::FATAL_ERROR,
cmPolicies::GetRequiredPolicyError(cmPolicies::CMP0056));
+ CM_FALLTHROUGH;
case cmPolicies::NEW:
// NEW behavior is to pass linker flags.
{
@@ -693,6 +696,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv,
case cmPolicies::WARN:
warnCMP0067 = this->Makefile->PolicyOptionalWarningEnabled(
"CMAKE_POLICY_WARNING_CMP0067");
+ CM_FALLTHROUGH;
case cmPolicies::OLD:
// OLD behavior is to not honor the language standard variables.
honorStandard = false;
diff --git a/Source/cmDynamicLoader.cxx b/Source/cmDynamicLoader.cxx
index f530ba7..7fbe75c 100644
--- a/Source/cmDynamicLoader.cxx
+++ b/Source/cmDynamicLoader.cxx
@@ -10,8 +10,7 @@ class cmDynamicLoaderCache
{
public:
~cmDynamicLoaderCache();
- void CacheFile(const char* path,
- const cmsys::DynamicLoader::LibraryHandle& /*p*/);
+ void CacheFile(const char* path, cmsys::DynamicLoader::LibraryHandle /*p*/);
bool GetCacheFile(const char* path,
cmsys::DynamicLoader::LibraryHandle& /*p*/);
bool FlushCache(const char* path);
@@ -29,8 +28,8 @@ cmDynamicLoaderCache::~cmDynamicLoaderCache()
{
}
-void cmDynamicLoaderCache::CacheFile(
- const char* path, const cmsys::DynamicLoader::LibraryHandle& p)
+void cmDynamicLoaderCache::CacheFile(const char* path,
+ cmsys::DynamicLoader::LibraryHandle p)
{
cmsys::DynamicLoader::LibraryHandle h;
if (this->GetCacheFile(path, h)) {
diff --git a/Source/cmELF.cxx b/Source/cmELF.cxx
index d23abec..fc97bf3 100644
--- a/Source/cmELF.cxx
+++ b/Source/cmELF.cxx
@@ -53,17 +53,17 @@ template <size_t s>
struct cmELFByteSwapSize
{
};
-void cmELFByteSwap(char* /*unused*/, cmELFByteSwapSize<1> const& /*unused*/)
+void cmELFByteSwap(char* /*unused*/, cmELFByteSwapSize<1> /*unused*/)
{
}
-void cmELFByteSwap(char* data, cmELFByteSwapSize<2> const& /*unused*/)
+void cmELFByteSwap(char* data, cmELFByteSwapSize<2> /*unused*/)
{
char one_byte;
one_byte = data[0];
data[0] = data[1];
data[1] = one_byte;
}
-void cmELFByteSwap(char* data, cmELFByteSwapSize<4> const& /*unused*/)
+void cmELFByteSwap(char* data, cmELFByteSwapSize<4> /*unused*/)
{
char one_byte;
one_byte = data[0];
@@ -73,7 +73,7 @@ void cmELFByteSwap(char* data, cmELFByteSwapSize<4> const& /*unused*/)
data[1] = data[2];
data[2] = one_byte;
}
-void cmELFByteSwap(char* data, cmELFByteSwapSize<8> const& /*unused*/)
+void cmELFByteSwap(char* data, cmELFByteSwapSize<8> /*unused*/)
{
char one_byte;
one_byte = data[0];
diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx
index 565b84d..972f4b9 100644
--- a/Source/cmExportFileGenerator.cxx
+++ b/Source/cmExportFileGenerator.cxx
@@ -273,6 +273,7 @@ static bool checkInterfaceDirs(const std::string& prepro,
<< std::endl;
target->GetLocalGenerator()->IssueMessage(cmake::AUTHOR_WARNING,
s.str());
+ CM_FALLTHROUGH;
}
case cmPolicies::OLD:
shouldContinue = true;
diff --git a/Source/cmExtraCodeLiteGenerator.cxx b/Source/cmExtraCodeLiteGenerator.cxx
index adab061..b478f34 100644
--- a/Source/cmExtraCodeLiteGenerator.cxx
+++ b/Source/cmExtraCodeLiteGenerator.cxx
@@ -141,6 +141,7 @@ std::vector<std::string> cmExtraCodeLiteGenerator::CreateProjectsByTarget(
case cmStateEnums::STATIC_LIBRARY:
case cmStateEnums::MODULE_LIBRARY:
visualname = "lib" + visualname;
+ CM_FALLTHROUGH;
case cmStateEnums::EXECUTABLE:
xml->StartElement("Project");
xml->Attribute("Name", visualname);
diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx
index 32a539c..5777fb2 100644
--- a/Source/cmFileCommand.cxx
+++ b/Source/cmFileCommand.cxx
@@ -1121,9 +1121,9 @@ protected:
bool InstallSymlink(const char* fromFile, const char* toFile);
bool InstallFile(const char* fromFile, const char* toFile,
- MatchProperties const& match_properties);
+ MatchProperties match_properties);
bool InstallDirectory(const char* source, const char* destination,
- MatchProperties const& match_properties);
+ MatchProperties match_properties);
virtual bool Install(const char* fromFile, const char* toFile);
virtual std::string const& ToName(std::string const& fromName)
{
@@ -1542,7 +1542,7 @@ bool cmFileCopier::InstallSymlink(const char* fromFile, const char* toFile)
}
bool cmFileCopier::InstallFile(const char* fromFile, const char* toFile,
- MatchProperties const& match_properties)
+ MatchProperties match_properties)
{
// Determine whether we will copy the file.
bool copy = true;
@@ -1596,7 +1596,7 @@ bool cmFileCopier::InstallFile(const char* fromFile, const char* toFile,
bool cmFileCopier::InstallDirectory(const char* source,
const char* destination,
- MatchProperties const& match_properties)
+ MatchProperties match_properties)
{
// Inform the user about this directory installation.
this->ReportCopy(destination, TypeDir,
@@ -1770,6 +1770,7 @@ protected:
if (this->Makefile->IsOn("CMAKE_INSTALL_SO_NO_EXE")) {
break;
}
+ CM_FALLTHROUGH;
case cmInstallType_EXECUTABLE:
case cmInstallType_PROGRAMS:
this->FilePermissions |= mode_owner_execute;
diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx
index 21ca347..65670e5 100644
--- a/Source/cmFindPackageCommand.cxx
+++ b/Source/cmFindPackageCommand.cxx
@@ -423,13 +423,17 @@ bool cmFindPackageCommand::InitialPass(std::vector<std::string> const& args,
&parsed_minor, &parsed_patch, &parsed_tweak);
switch (this->VersionCount) {
case 4:
- this->VersionTweak = parsed_tweak; // no break!
+ this->VersionTweak = parsed_tweak;
+ CM_FALLTHROUGH;
case 3:
- this->VersionPatch = parsed_patch; // no break!
+ this->VersionPatch = parsed_patch;
+ CM_FALLTHROUGH;
case 2:
- this->VersionMinor = parsed_minor; // no break!
+ this->VersionMinor = parsed_minor;
+ CM_FALLTHROUGH;
case 1:
- this->VersionMajor = parsed_major; // no break!
+ this->VersionMajor = parsed_major;
+ CM_FALLTHROUGH;
default:
break;
}
@@ -1542,13 +1546,17 @@ bool cmFindPackageCommand::CheckVersionFile(std::string const& version_file,
&parsed_minor, &parsed_patch, &parsed_tweak);
switch (this->VersionFoundCount) {
case 4:
- this->VersionFoundTweak = parsed_tweak; // no break!
+ this->VersionFoundTweak = parsed_tweak;
+ CM_FALLTHROUGH;
case 3:
- this->VersionFoundPatch = parsed_patch; // no break!
+ this->VersionFoundPatch = parsed_patch;
+ CM_FALLTHROUGH;
case 2:
- this->VersionFoundMinor = parsed_minor; // no break!
+ this->VersionFoundMinor = parsed_minor;
+ CM_FALLTHROUGH;
case 1:
- this->VersionFoundMajor = parsed_major; // no break!
+ this->VersionFoundMajor = parsed_major;
+ CM_FALLTHROUGH;
default:
break;
}
diff --git a/Source/cmFindProgramCommand.cxx b/Source/cmFindProgramCommand.cxx
index ea031cf..9327c18 100644
--- a/Source/cmFindProgramCommand.cxx
+++ b/Source/cmFindProgramCommand.cxx
@@ -212,7 +212,8 @@ std::string cmFindProgramCommand::FindAppBundle()
return "";
}
-std::string cmFindProgramCommand::GetBundleExecutable(std::string bundlePath)
+std::string cmFindProgramCommand::GetBundleExecutable(
+ std::string const& bundlePath)
{
std::string executable;
(void)bundlePath;
diff --git a/Source/cmFindProgramCommand.h b/Source/cmFindProgramCommand.h
index a0d6af9..b0cd420 100644
--- a/Source/cmFindProgramCommand.h
+++ b/Source/cmFindProgramCommand.h
@@ -43,7 +43,7 @@ private:
std::string FindNormalProgramDirsPerName();
std::string FindNormalProgramNamesPerDir();
std::string FindAppBundle();
- std::string GetBundleExecutable(std::string bundlePath);
+ std::string GetBundleExecutable(std::string const& bundlePath);
};
#endif
diff --git a/Source/cmGeneratorExpressionNode.cxx b/Source/cmGeneratorExpressionNode.cxx
index e065a74..a57d2a0 100644
--- a/Source/cmGeneratorExpressionNode.cxx
+++ b/Source/cmGeneratorExpressionNode.cxx
@@ -410,6 +410,7 @@ struct CompilerIdNode : public cmGeneratorExpressionNode
e << cmPolicies::GetPolicyWarning(cmPolicies::CMP0044);
context->LG->GetCMakeInstance()->IssueMessage(
cmake::AUTHOR_WARNING, e.str(), context->Backtrace);
+ CM_FALLTHROUGH;
}
case cmPolicies::OLD:
return "1";
@@ -1459,6 +1460,7 @@ static const struct TargetPolicyNode : public cmGeneratorExpressionNode
lg->IssueMessage(
cmake::AUTHOR_WARNING,
cmPolicies::GetPolicyWarning(policyForString(policy)));
+ CM_FALLTHROUGH;
case cmPolicies::REQUIRED_IF_USED:
case cmPolicies::REQUIRED_ALWAYS:
case cmPolicies::OLD:
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 9a33bec..c79e113 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -76,7 +76,7 @@ public:
cmLinkImplItem cmGeneratorTarget::TargetPropertyEntry::NoLinkImplItem;
void CreatePropertyGeneratorExpressions(
- cmStringRange const& entries, cmBacktraceRange const& backtraces,
+ cmStringRange entries, cmBacktraceRange backtraces,
std::vector<cmGeneratorTarget::TargetPropertyEntry*>& items,
bool evaluateForBuildsystem = false)
{
@@ -2481,6 +2481,7 @@ static void processIncludeDirectories(
switch (tgt->GetPolicyStatusCMP0027()) {
case cmPolicies::WARN:
e << cmPolicies::GetPolicyWarning(cmPolicies::CMP0027) << "\n";
+ CM_FALLTHROUGH;
case cmPolicies::OLD:
messageType = cmake::AUTHOR_WARNING;
break;
@@ -2837,6 +2838,7 @@ void cmGeneratorTarget::GetCompileDefinitions(
std::ostringstream e;
e << cmPolicies::GetPolicyWarning(cmPolicies::CMP0043);
this->LocalGenerator->IssueMessage(cmake::AUTHOR_WARNING, e.str());
+ CM_FALLTHROUGH;
}
case cmPolicies::OLD: {
cmGeneratorExpression ge;
@@ -4132,11 +4134,14 @@ void cmGeneratorTarget::GetTargetVersion(bool soversion, int& major,
switch (sscanf(version, "%d.%d.%d", &parsed_major, &parsed_minor,
&parsed_patch)) {
case 3:
- patch = parsed_patch; // no break!
+ patch = parsed_patch;
+ CM_FALLTHROUGH;
case 2:
- minor = parsed_minor; // no break!
+ minor = parsed_minor;
+ CM_FALLTHROUGH;
case 1:
- major = parsed_major; // no break!
+ major = parsed_major;
+ CM_FALLTHROUGH;
default:
break;
}
diff --git a/Source/cmGetDirectoryPropertyCommand.cxx b/Source/cmGetDirectoryPropertyCommand.cxx
index 6cb8e19..1005b15 100644
--- a/Source/cmGetDirectoryPropertyCommand.cxx
+++ b/Source/cmGetDirectoryPropertyCommand.cxx
@@ -78,6 +78,7 @@ bool cmGetDirectoryPropertyCommand::InitialPass(
this->Makefile->IssueMessage(
cmake::AUTHOR_WARNING,
cmPolicies::GetPolicyWarning(cmPolicies::CMP0059));
+ CM_FALLTHROUGH;
case cmPolicies::OLD:
this->StoreResult(variable, this->Makefile->GetDefineFlagsCMP0059());
return true;
diff --git a/Source/cmGetPropertyCommand.cxx b/Source/cmGetPropertyCommand.cxx
index d2056d2..ddecdf6 100644
--- a/Source/cmGetPropertyCommand.cxx
+++ b/Source/cmGetPropertyCommand.cxx
@@ -232,6 +232,7 @@ bool cmGetPropertyCommand::HandleDirectoryMode()
case cmPolicies::WARN:
mf->IssueMessage(cmake::AUTHOR_WARNING,
cmPolicies::GetPolicyWarning(cmPolicies::CMP0059));
+ CM_FALLTHROUGH;
case cmPolicies::OLD:
return this->StoreResult(mf->GetDefineFlagsCMP0059());
case cmPolicies::NEW:
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 67e272d..099f705 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -838,6 +838,7 @@ void cmGlobalGenerator::CheckCompilerIdCompatibility(
/* clang-format on */
mf->IssueMessage(cmake::AUTHOR_WARNING, w.str());
}
+ CM_FALLTHROUGH;
case cmPolicies::OLD:
// OLD behavior is to convert AppleClang to Clang.
mf->AddDefinition(compilerIdVar, "Clang");
@@ -867,6 +868,7 @@ void cmGlobalGenerator::CheckCompilerIdCompatibility(
/* clang-format on */
mf->IssueMessage(cmake::AUTHOR_WARNING, w.str());
}
+ CM_FALLTHROUGH;
case cmPolicies::OLD:
// OLD behavior is to convert QCC to GNU.
mf->AddDefinition(compilerIdVar, "GNU");
@@ -881,6 +883,7 @@ void cmGlobalGenerator::CheckCompilerIdCompatibility(
mf->IssueMessage(
cmake::FATAL_ERROR,
cmPolicies::GetRequiredPolicyError(cmPolicies::CMP0047));
+ CM_FALLTHROUGH;
case cmPolicies::NEW:
// NEW behavior is to keep QCC.
break;
@@ -1482,13 +1485,13 @@ cmGlobalGenerator::CreateQtAutoGeneratorsTargets()
}
cmLinkLineComputer* cmGlobalGenerator::CreateLinkLineComputer(
- cmOutputConverter* outputConverter, cmStateDirectory stateDir) const
+ cmOutputConverter* outputConverter, cmStateDirectory const& stateDir) const
{
return new cmLinkLineComputer(outputConverter, stateDir);
}
cmLinkLineComputer* cmGlobalGenerator::CreateMSVC60LinkLineComputer(
- cmOutputConverter* outputConverter, cmStateDirectory stateDir) const
+ cmOutputConverter* outputConverter, cmStateDirectory const& stateDir) const
{
return new cmMSVC60LinkLineComputer(outputConverter, stateDir);
}
diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h
index cc7ffed..871178b 100644
--- a/Source/cmGlobalGenerator.h
+++ b/Source/cmGlobalGenerator.h
@@ -105,10 +105,12 @@ public:
virtual void Generate();
virtual cmLinkLineComputer* CreateLinkLineComputer(
- cmOutputConverter* outputConverter, cmStateDirectory stateDir) const;
+ cmOutputConverter* outputConverter,
+ cmStateDirectory const& stateDir) const;
cmLinkLineComputer* CreateMSVC60LinkLineComputer(
- cmOutputConverter* outputConverter, cmStateDirectory stateDir) const;
+ cmOutputConverter* outputConverter,
+ cmStateDirectory const& stateDir) const;
/**
* Set/Get and Clear the enabled languages.
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx
index bb0b83a..2eef9e4 100644
--- a/Source/cmGlobalNinjaGenerator.cxx
+++ b/Source/cmGlobalNinjaGenerator.cxx
@@ -77,7 +77,8 @@ void cmGlobalNinjaGenerator::WriteComment(std::ostream& os,
}
cmLinkLineComputer* cmGlobalNinjaGenerator::CreateLinkLineComputer(
- cmOutputConverter* outputConverter, cmStateDirectory /* stateDir */) const
+ cmOutputConverter* outputConverter,
+ cmStateDirectory const& /* stateDir */) const
{
return new cmNinjaLinkLineComputer(
outputConverter,
diff --git a/Source/cmGlobalNinjaGenerator.h b/Source/cmGlobalNinjaGenerator.h
index 41c5175..b0008f7 100644
--- a/Source/cmGlobalNinjaGenerator.h
+++ b/Source/cmGlobalNinjaGenerator.h
@@ -78,7 +78,7 @@ public:
cmLinkLineComputer* CreateLinkLineComputer(
cmOutputConverter* outputConverter,
- cmStateDirectory stateDir) const CM_OVERRIDE;
+ cmStateDirectory const& stateDir) const CM_OVERRIDE;
/**
* Write the given @a comment to the output stream @a os. It
diff --git a/Source/cmInstallCommand.cxx b/Source/cmInstallCommand.cxx
index f499924..294fb17 100644
--- a/Source/cmInstallCommand.cxx
+++ b/Source/cmInstallCommand.cxx
@@ -1406,11 +1406,11 @@ bool cmInstallCommand::MakeFilesFullPath(
bool cmInstallCommand::CheckCMP0006(bool& failure)
{
switch (this->Makefile->GetPolicyStatus(cmPolicies::CMP0006)) {
- case cmPolicies::WARN: {
+ case cmPolicies::WARN:
this->Makefile->IssueMessage(
cmake::AUTHOR_WARNING,
cmPolicies::GetPolicyWarning(cmPolicies::CMP0006));
- }
+ CM_FALLTHROUGH;
case cmPolicies::OLD:
// OLD behavior is to allow compatibility
return true;
diff --git a/Source/cmInstallGenerator.cxx b/Source/cmInstallGenerator.cxx
index 120d1b3..13b588e 100644
--- a/Source/cmInstallGenerator.cxx
+++ b/Source/cmInstallGenerator.cxx
@@ -27,7 +27,7 @@ void cmInstallGenerator::AddInstallRule(
std::vector<std::string> const& files, bool optional /* = false */,
const char* permissions_file /* = 0 */,
const char* permissions_dir /* = 0 */, const char* rename /* = 0 */,
- const char* literal_args /* = 0 */, Indent const& indent)
+ const char* literal_args /* = 0 */, Indent indent)
{
// Use the FILE command to install the file.
std::string stype;
diff --git a/Source/cmInstallGenerator.h b/Source/cmInstallGenerator.h
index de19f98..8f8701f 100644
--- a/Source/cmInstallGenerator.h
+++ b/Source/cmInstallGenerator.h
@@ -43,7 +43,7 @@ public:
std::vector<std::string> const& files, bool optional = false,
const char* permissions_file = CM_NULLPTR,
const char* permissions_dir = CM_NULLPTR, const char* rename = CM_NULLPTR,
- const char* literal_args = CM_NULLPTR, Indent const& indent = Indent());
+ const char* literal_args = CM_NULLPTR, Indent indent = Indent());
/** Get the install destination as it should appear in the
installation script. */
diff --git a/Source/cmLinkDirectoriesCommand.cxx b/Source/cmLinkDirectoriesCommand.cxx
index f863292..9b0c288 100644
--- a/Source/cmLinkDirectoriesCommand.cxx
+++ b/Source/cmLinkDirectoriesCommand.cxx
@@ -49,6 +49,7 @@ void cmLinkDirectoriesCommand::AddLinkDir(std::string const& dir)
case cmPolicies::REQUIRED_ALWAYS:
e << cmPolicies::GetRequiredPolicyError(cmPolicies::CMP0015);
this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
+ CM_FALLTHROUGH;
case cmPolicies::NEW:
// NEW behavior converts
convertToAbsolute = true;
diff --git a/Source/cmLinkLineComputer.cxx b/Source/cmLinkLineComputer.cxx
index e728632..c0f702e 100644
--- a/Source/cmLinkLineComputer.cxx
+++ b/Source/cmLinkLineComputer.cxx
@@ -13,7 +13,7 @@
#include "cmStateTypes.h"
cmLinkLineComputer::cmLinkLineComputer(cmOutputConverter* outputConverter,
- cmStateDirectory stateDir)
+ cmStateDirectory const& stateDir)
: StateDir(stateDir)
, OutputConverter(outputConverter)
, ForResponse(false)
diff --git a/Source/cmLinkLineComputer.h b/Source/cmLinkLineComputer.h
index 27b8adb..d33e8d1 100644
--- a/Source/cmLinkLineComputer.h
+++ b/Source/cmLinkLineComputer.h
@@ -20,7 +20,7 @@ class cmLinkLineComputer
public:
cmLinkLineComputer(cmOutputConverter* outputConverter,
- cmStateDirectory stateDir);
+ cmStateDirectory const& stateDir);
virtual ~cmLinkLineComputer();
void SetUseWatcomQuote(bool useWatcomQuote);
diff --git a/Source/cmLinkLineDeviceComputer.cxx b/Source/cmLinkLineDeviceComputer.cxx
index bf30b39..942e9b9 100644
--- a/Source/cmLinkLineDeviceComputer.cxx
+++ b/Source/cmLinkLineDeviceComputer.cxx
@@ -10,13 +10,12 @@
#include "cmComputeLinkInformation.h"
#include "cmGeneratorTarget.h"
#include "cmGlobalNinjaGenerator.h"
-#include "cmStateDirectory.h"
#include "cmStateTypes.h"
class cmOutputConverter;
cmLinkLineDeviceComputer::cmLinkLineDeviceComputer(
- cmOutputConverter* outputConverter, cmStateDirectory stateDir)
+ cmOutputConverter* outputConverter, cmStateDirectory const& stateDir)
: cmLinkLineComputer(outputConverter, stateDir)
{
}
@@ -89,7 +88,7 @@ std::string cmLinkLineDeviceComputer::GetLinkerLanguage(cmGeneratorTarget*,
}
cmNinjaLinkLineDeviceComputer::cmNinjaLinkLineDeviceComputer(
- cmOutputConverter* outputConverter, cmStateDirectory stateDir,
+ cmOutputConverter* outputConverter, cmStateDirectory const& stateDir,
cmGlobalNinjaGenerator const* gg)
: cmLinkLineDeviceComputer(outputConverter, stateDir)
, GG(gg)
diff --git a/Source/cmLinkLineDeviceComputer.h b/Source/cmLinkLineDeviceComputer.h
index e9e98ac..c3fac61 100644
--- a/Source/cmLinkLineDeviceComputer.h
+++ b/Source/cmLinkLineDeviceComputer.h
@@ -22,7 +22,7 @@ class cmLinkLineDeviceComputer : public cmLinkLineComputer
public:
cmLinkLineDeviceComputer(cmOutputConverter* outputConverter,
- cmStateDirectory stateDir);
+ cmStateDirectory const& stateDir);
~cmLinkLineDeviceComputer() CM_OVERRIDE;
std::string ComputeLinkLibraries(cmComputeLinkInformation& cli,
@@ -39,7 +39,7 @@ class cmNinjaLinkLineDeviceComputer : public cmLinkLineDeviceComputer
public:
cmNinjaLinkLineDeviceComputer(cmOutputConverter* outputConverter,
- cmStateDirectory stateDir,
+ cmStateDirectory const& stateDir,
cmGlobalNinjaGenerator const* gg);
std::string ConvertToLinkReference(std::string const& input) const
diff --git a/Source/cmListFileCache.cxx b/Source/cmListFileCache.cxx
index 929b1cd..0c73cd7 100644
--- a/Source/cmListFileCache.cxx
+++ b/Source/cmListFileCache.cxx
@@ -307,7 +307,8 @@ struct cmListFileBacktrace::Entry : public cmListFileContext
unsigned int RefCount;
};
-cmListFileBacktrace::cmListFileBacktrace(cmStateSnapshot bottom, Entry* up,
+cmListFileBacktrace::cmListFileBacktrace(cmStateSnapshot const& bottom,
+ Entry* up,
cmListFileContext const& lfc)
: Bottom(bottom)
, Cur(new Entry(lfc, up))
@@ -316,7 +317,8 @@ cmListFileBacktrace::cmListFileBacktrace(cmStateSnapshot bottom, Entry* up,
this->Cur->Ref();
}
-cmListFileBacktrace::cmListFileBacktrace(cmStateSnapshot bottom, Entry* cur)
+cmListFileBacktrace::cmListFileBacktrace(cmStateSnapshot const& bottom,
+ Entry* cur)
: Bottom(bottom)
, Cur(cur)
{
@@ -332,7 +334,7 @@ cmListFileBacktrace::cmListFileBacktrace()
{
}
-cmListFileBacktrace::cmListFileBacktrace(cmStateSnapshot snapshot)
+cmListFileBacktrace::cmListFileBacktrace(cmStateSnapshot const& snapshot)
: Bottom(snapshot.GetCallStackBottom())
, Cur(CM_NULLPTR)
{
diff --git a/Source/cmListFileCache.h b/Source/cmListFileCache.h
index aa11ba7..349ddef 100644
--- a/Source/cmListFileCache.h
+++ b/Source/cmListFileCache.h
@@ -107,7 +107,7 @@ public:
// Construct an empty backtrace whose bottom sits in the directory
// indicated by the given valid snapshot.
- cmListFileBacktrace(cmStateSnapshot snapshot);
+ cmListFileBacktrace(cmStateSnapshot const& snapshot);
// Backtraces may be copied and assigned as values.
cmListFileBacktrace(cmListFileBacktrace const& r);
@@ -143,9 +143,9 @@ private:
cmStateSnapshot Bottom;
Entry* Cur;
- cmListFileBacktrace(cmStateSnapshot bottom, Entry* up,
+ cmListFileBacktrace(cmStateSnapshot const& bottom, Entry* up,
cmListFileContext const& lfc);
- cmListFileBacktrace(cmStateSnapshot bottom, Entry* cur);
+ cmListFileBacktrace(cmStateSnapshot const& bottom, Entry* cur);
};
struct cmListFile
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 0418521..bc886b6 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -960,6 +960,7 @@ void cmLocalGenerator::GetTargetFlags(
break;
case cmStateEnums::MODULE_LIBRARY:
libraryLinkVariable = "CMAKE_MODULE_LINKER_FLAGS";
+ CM_FALLTHROUGH;
case cmStateEnums::SHARED_LIBRARY: {
linkFlags = this->Makefile->GetSafeDefinition(libraryLinkVariable);
linkFlags += " ";
@@ -1248,6 +1249,7 @@ std::string cmLocalGenerator::GetLinkLibsCMP0065(
/* clang-format on */
this->IssueMessage(cmake::AUTHOR_WARNING, w.str());
}
+ CM_FALLTHROUGH;
case cmPolicies::OLD:
// OLD behavior is to always add the flags
add_shlib_flags = true;
@@ -1257,6 +1259,7 @@ std::string cmLocalGenerator::GetLinkLibsCMP0065(
this->IssueMessage(
cmake::FATAL_ERROR,
cmPolicies::GetRequiredPolicyError(cmPolicies::CMP0065));
+ CM_FALLTHROUGH;
case cmPolicies::NEW:
// NEW behavior is to only add the flags if ENABLE_EXPORTS is on
add_shlib_flags = tgt.GetPropertyAsBool("ENABLE_EXPORTS");
@@ -1747,7 +1750,7 @@ bool cmLocalGenerator::GetShouldUseOldFlags(bool shared,
<< cmPolicies::GetPolicyWarning(cmPolicies::CMP0018);
this->IssueMessage(cmake::AUTHOR_WARNING, e.str());
- // fall through to OLD behaviour
+ CM_FALLTHROUGH;
}
case cmPolicies::OLD:
return true;
diff --git a/Source/cmMSVC60LinkLineComputer.cxx b/Source/cmMSVC60LinkLineComputer.cxx
index b5e8511..5298d1a 100644
--- a/Source/cmMSVC60LinkLineComputer.cxx
+++ b/Source/cmMSVC60LinkLineComputer.cxx
@@ -3,8 +3,6 @@
#include "cmMSVC60LinkLineComputer.h"
-#include "cmStateDirectory.h"
-
#if defined(_WIN32) && !defined(__CYGWIN__)
#include "cmSystemTools.h"
#endif
@@ -12,7 +10,7 @@
class cmOutputConverter;
cmMSVC60LinkLineComputer::cmMSVC60LinkLineComputer(
- cmOutputConverter* outputConverter, cmStateDirectory stateDir)
+ cmOutputConverter* outputConverter, cmStateDirectory const& stateDir)
: cmLinkLineComputer(outputConverter, stateDir)
{
}
diff --git a/Source/cmMSVC60LinkLineComputer.h b/Source/cmMSVC60LinkLineComputer.h
index e494060..f2892d5 100644
--- a/Source/cmMSVC60LinkLineComputer.h
+++ b/Source/cmMSVC60LinkLineComputer.h
@@ -19,7 +19,7 @@ class cmMSVC60LinkLineComputer : public cmLinkLineComputer
public:
cmMSVC60LinkLineComputer(cmOutputConverter* outputConverter,
- cmStateDirectory stateDir);
+ cmStateDirectory const& stateDir);
std::string ConvertToLinkReference(std::string const& input) const
CM_OVERRIDE;
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 51d8980..802a427 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -360,6 +360,7 @@ cmMakefile::IncludeScope::IncludeScope(cmMakefile* mf,
// We should never make this policy required, but we handle it
// here just in case.
this->CheckCMP0011 = true;
+ CM_FALLTHROUGH;
case cmPolicies::NEW:
// NEW behavior is to push a (strong) scope.
this->Makefile->PushPolicy();
@@ -1161,6 +1162,7 @@ bool cmMakefile::ParseDefineFlag(std::string const& def, bool remove)
case cmPolicies::WARN:
this->IssueMessage(cmake::AUTHOR_WARNING,
cmPolicies::GetPolicyWarning(cmPolicies::CMP0005));
+ CM_FALLTHROUGH;
case cmPolicies::OLD:
// OLD behavior is to not escape the value. We should not
// convert the definition to use the property.
@@ -1511,6 +1513,7 @@ void cmMakefile::ConfigureSubDirectory(cmMakefile* mf)
case cmPolicies::REQUIRED_IF_USED:
case cmPolicies::REQUIRED_ALWAYS:
e << "\n" << cmPolicies::GetRequiredPolicyError(cmPolicies::CMP0014);
+ CM_FALLTHROUGH;
case cmPolicies::NEW:
// NEW behavior prints the error.
this->IssueMessage(cmake::FATAL_ERROR, e.str());
@@ -2340,6 +2343,7 @@ const char* cmMakefile::ExpandVariablesInString(
newErrorstr, newResult, escapeQuotes, noEscapes, atOnly, filename,
line, removeEmpty, replaceAt);
this->SuppressWatches = false;
+ CM_FALLTHROUGH;
}
case cmPolicies::OLD:
mtype =
@@ -2496,6 +2500,7 @@ cmake::MessageType cmMakefile::ExpandVariablesInStringOld(
switch (this->GetPolicyStatus(cmPolicies::CMP0010)) {
case cmPolicies::WARN:
error << "\n" << cmPolicies::GetPolicyWarning(cmPolicies::CMP0010);
+ CM_FALLTHROUGH;
case cmPolicies::OLD:
// OLD behavior is to just warn and continue.
mtype = cmake::AUTHOR_WARNING;
@@ -2649,6 +2654,7 @@ cmake::MessageType cmMakefile::ExpandVariablesInStringNew(
}
break;
}
+ CM_FALLTHROUGH;
case '\\':
if (!noEscapes) {
const char* next = in + 1;
@@ -3386,7 +3392,7 @@ std::string cmMakefile::GetModulesFile(const char* filename) const
/* clang-format on */
this->IssueMessage(cmake::AUTHOR_WARNING, e.str());
- // break; // fall through to OLD behaviour
+ CM_FALLTHROUGH;
}
case cmPolicies::OLD:
result = moduleInCMakeModulePath;
@@ -3463,7 +3469,7 @@ void cmMakefile::ConfigureString(const std::string& input, std::string& output,
int cmMakefile::ConfigureFile(const char* infile, const char* outfile,
bool copyonly, bool atOnly, bool escapeQuotes,
- const cmNewLineStyle& newLine)
+ cmNewLineStyle newLine)
{
int res = 1;
if (!this->CanIWriteThisFile(outfile)) {
@@ -3779,6 +3785,7 @@ bool cmMakefile::EnforceUniqueName(std::string const& name, std::string& msg,
case cmPolicies::WARN:
this->IssueMessage(cmake::AUTHOR_WARNING,
cmPolicies::GetPolicyWarning(cmPolicies::CMP0002));
+ CM_FALLTHROUGH;
case cmPolicies::OLD:
return true;
case cmPolicies::REQUIRED_IF_USED:
@@ -3864,12 +3871,14 @@ bool cmMakefile::EnforceUniqueDir(const std::string& srcPath,
<< "compatibility.";
/* clang-format on */
this->IssueMessage(cmake::AUTHOR_WARNING, e.str());
+ CM_FALLTHROUGH;
case cmPolicies::OLD:
// OLD behavior does not warn.
return true;
case cmPolicies::REQUIRED_IF_USED:
case cmPolicies::REQUIRED_ALWAYS:
e << cmPolicies::GetRequiredPolicyError(cmPolicies::CMP0013) << "\n";
+ CM_FALLTHROUGH;
case cmPolicies::NEW:
// NEW behavior prints the error.
/* clang-format off */
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index 6dc30ce..e65ba46 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -548,7 +548,7 @@ public:
*/
int ConfigureFile(const char* infile, const char* outfile, bool copyonly,
bool atOnly, bool escapeQuotes,
- const cmNewLineStyle& = cmNewLineStyle());
+ cmNewLineStyle = cmNewLineStyle());
#if defined(CMAKE_BUILD_WITH_CMAKE)
/**
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index 1aeeb7d..a4511b6 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -1255,7 +1255,7 @@ class cmMakefileTargetGeneratorObjectStrings
public:
cmMakefileTargetGeneratorObjectStrings(std::vector<std::string>& strings,
cmOutputConverter* outputConverter,
- cmStateDirectory stateDir,
+ cmStateDirectory const& stateDir,
std::string::size_type limit)
: Strings(strings)
, OutputConverter(outputConverter)
@@ -1574,7 +1574,7 @@ std::string cmMakefileTargetGenerator::CreateResponseFile(
}
cmLinkLineComputer* cmMakefileTargetGenerator::CreateLinkLineComputer(
- cmOutputConverter* outputConverter, cmStateDirectory stateDir)
+ cmOutputConverter* outputConverter, cmStateDirectory const& stateDir)
{
if (this->Makefile->IsOn("MSVC60")) {
return this->GlobalGenerator->CreateMSVC60LinkLineComputer(outputConverter,
diff --git a/Source/cmMakefileTargetGenerator.h b/Source/cmMakefileTargetGenerator.h
index 32b1fee..92c9f60 100644
--- a/Source/cmMakefileTargetGenerator.h
+++ b/Source/cmMakefileTargetGenerator.h
@@ -143,7 +143,7 @@ protected:
std::vector<std::string>& makefile_depends);
cmLinkLineComputer* CreateLinkLineComputer(
- cmOutputConverter* outputConverter, cmStateDirectory stateDir);
+ cmOutputConverter* outputConverter, cmStateDirectory const& stateDir);
/** Create a response file with the given set of options. Returns
the relative path from the target build working directory to the
diff --git a/Source/cmNinjaLinkLineComputer.cxx b/Source/cmNinjaLinkLineComputer.cxx
index 2546b55..7fbeeea 100644
--- a/Source/cmNinjaLinkLineComputer.cxx
+++ b/Source/cmNinjaLinkLineComputer.cxx
@@ -4,12 +4,11 @@
#include "cmNinjaLinkLineComputer.h"
#include "cmGlobalNinjaGenerator.h"
-#include "cmStateDirectory.h"
class cmOutputConverter;
cmNinjaLinkLineComputer::cmNinjaLinkLineComputer(
- cmOutputConverter* outputConverter, cmStateDirectory stateDir,
+ cmOutputConverter* outputConverter, cmStateDirectory const& stateDir,
cmGlobalNinjaGenerator const* gg)
: cmLinkLineComputer(outputConverter, stateDir)
, GG(gg)
diff --git a/Source/cmNinjaLinkLineComputer.h b/Source/cmNinjaLinkLineComputer.h
index e612e88..13f05a8 100644
--- a/Source/cmNinjaLinkLineComputer.h
+++ b/Source/cmNinjaLinkLineComputer.h
@@ -20,7 +20,7 @@ class cmNinjaLinkLineComputer : public cmLinkLineComputer
public:
cmNinjaLinkLineComputer(cmOutputConverter* outputConverter,
- cmStateDirectory stateDir,
+ cmStateDirectory const& stateDir,
cmGlobalNinjaGenerator const* gg);
std::string ConvertToLinkReference(std::string const& input) const
diff --git a/Source/cmOrderDirectories.cxx b/Source/cmOrderDirectories.cxx
index d48eb53..333e313 100644
--- a/Source/cmOrderDirectories.cxx
+++ b/Source/cmOrderDirectories.cxx
@@ -424,7 +424,7 @@ struct cmOrderDirectoriesCompare
// The conflict pair is unique based on just the directory
// (first). The second element is only used for displaying
// information about why the entry is present.
- bool operator()(ConflictPair const& l, ConflictPair const& r)
+ bool operator()(ConflictPair l, ConflictPair r)
{
return l.first == r.first;
}
diff --git a/Source/cmOutputConverter.cxx b/Source/cmOutputConverter.cxx
index d6864a6..14c986d 100644
--- a/Source/cmOutputConverter.cxx
+++ b/Source/cmOutputConverter.cxx
@@ -14,7 +14,7 @@
#include "cmStateDirectory.h"
#include "cmSystemTools.h"
-cmOutputConverter::cmOutputConverter(cmStateSnapshot snapshot)
+cmOutputConverter::cmOutputConverter(cmStateSnapshot const& snapshot)
: StateSnapshot(snapshot)
, LinkScriptShell(false)
{
@@ -81,7 +81,7 @@ static bool cmOutputConverterNotAbove(const char* a, const char* b)
bool cmOutputConverter::ContainedInDirectory(std::string const& local_path,
std::string const& remote_path,
- cmStateDirectory directory)
+ cmStateDirectory const& directory)
{
const std::string relativePathTopBinary =
directory.GetRelativePathTopBinary();
diff --git a/Source/cmOutputConverter.h b/Source/cmOutputConverter.h
index 12a1773..ae15055 100644
--- a/Source/cmOutputConverter.h
+++ b/Source/cmOutputConverter.h
@@ -15,7 +15,7 @@ class cmStateDirectory;
class cmOutputConverter
{
public:
- cmOutputConverter(cmStateSnapshot snapshot);
+ cmOutputConverter(cmStateSnapshot const& snapshot);
enum OutputFormat
{
@@ -94,7 +94,7 @@ public:
static bool ContainedInDirectory(std::string const& local_path,
std::string const& remote_path,
- cmStateDirectory directory);
+ cmStateDirectory const& directory);
/**
* Convert the given remote path to a relative path with respect to
diff --git a/Source/cmState.cxx b/Source/cmState.cxx
index ce9f470..92e47f7 100644
--- a/Source/cmState.cxx
+++ b/Source/cmState.cxx
@@ -633,7 +633,7 @@ cmStateSnapshot cmState::CreateBaseSnapshot()
}
cmStateSnapshot cmState::CreateBuildsystemDirectorySnapshot(
- cmStateSnapshot originSnapshot)
+ cmStateSnapshot const& originSnapshot)
{
assert(originSnapshot.IsValid());
cmStateDetail::PositionType pos =
@@ -667,7 +667,7 @@ cmStateSnapshot cmState::CreateBuildsystemDirectorySnapshot(
}
cmStateSnapshot cmState::CreateFunctionCallSnapshot(
- cmStateSnapshot originSnapshot, std::string const& fileName)
+ cmStateSnapshot const& originSnapshot, std::string const& fileName)
{
cmStateDetail::PositionType pos =
this->SnapshotData.Push(originSnapshot.Position, *originSnapshot.Position);
@@ -686,7 +686,7 @@ cmStateSnapshot cmState::CreateFunctionCallSnapshot(
}
cmStateSnapshot cmState::CreateMacroCallSnapshot(
- cmStateSnapshot originSnapshot, std::string const& fileName)
+ cmStateSnapshot const& originSnapshot, std::string const& fileName)
{
cmStateDetail::PositionType pos =
this->SnapshotData.Push(originSnapshot.Position, *originSnapshot.Position);
@@ -701,7 +701,7 @@ cmStateSnapshot cmState::CreateMacroCallSnapshot(
}
cmStateSnapshot cmState::CreateIncludeFileSnapshot(
- cmStateSnapshot originSnapshot, const std::string& fileName)
+ cmStateSnapshot const& originSnapshot, std::string const& fileName)
{
cmStateDetail::PositionType pos =
this->SnapshotData.Push(originSnapshot.Position, *originSnapshot.Position);
@@ -716,7 +716,7 @@ cmStateSnapshot cmState::CreateIncludeFileSnapshot(
}
cmStateSnapshot cmState::CreateVariableScopeSnapshot(
- cmStateSnapshot originSnapshot)
+ cmStateSnapshot const& originSnapshot)
{
cmStateDetail::PositionType pos =
this->SnapshotData.Push(originSnapshot.Position, *originSnapshot.Position);
@@ -734,7 +734,7 @@ cmStateSnapshot cmState::CreateVariableScopeSnapshot(
}
cmStateSnapshot cmState::CreateInlineListFileSnapshot(
- cmStateSnapshot originSnapshot, const std::string& fileName)
+ cmStateSnapshot const& originSnapshot, std::string const& fileName)
{
cmStateDetail::PositionType pos =
this->SnapshotData.Push(originSnapshot.Position, *originSnapshot.Position);
@@ -748,7 +748,7 @@ cmStateSnapshot cmState::CreateInlineListFileSnapshot(
}
cmStateSnapshot cmState::CreatePolicyScopeSnapshot(
- cmStateSnapshot originSnapshot)
+ cmStateSnapshot const& originSnapshot)
{
cmStateDetail::PositionType pos =
this->SnapshotData.Push(originSnapshot.Position, *originSnapshot.Position);
@@ -759,7 +759,7 @@ cmStateSnapshot cmState::CreatePolicyScopeSnapshot(
return cmStateSnapshot(this, pos);
}
-cmStateSnapshot cmState::Pop(cmStateSnapshot originSnapshot)
+cmStateSnapshot cmState::Pop(cmStateSnapshot const& originSnapshot)
{
cmStateDetail::PositionType pos = originSnapshot.Position;
cmStateDetail::PositionType prevPos = pos;
diff --git a/Source/cmState.h b/Source/cmState.h
index 1a5738f..e03ad89 100644
--- a/Source/cmState.h
+++ b/Source/cmState.h
@@ -36,18 +36,20 @@ public:
cmStateSnapshot CreateBaseSnapshot();
cmStateSnapshot CreateBuildsystemDirectorySnapshot(
- cmStateSnapshot originSnapshot);
- cmStateSnapshot CreateFunctionCallSnapshot(cmStateSnapshot originSnapshot,
- std::string const& fileName);
- cmStateSnapshot CreateMacroCallSnapshot(cmStateSnapshot originSnapshot,
- std::string const& fileName);
- cmStateSnapshot CreateIncludeFileSnapshot(cmStateSnapshot originSnapshot,
- std::string const& fileName);
- cmStateSnapshot CreateVariableScopeSnapshot(cmStateSnapshot originSnapshot);
- cmStateSnapshot CreateInlineListFileSnapshot(cmStateSnapshot originSnapshot,
- std::string const& fileName);
- cmStateSnapshot CreatePolicyScopeSnapshot(cmStateSnapshot originSnapshot);
- cmStateSnapshot Pop(cmStateSnapshot originSnapshot);
+ cmStateSnapshot const& originSnapshot);
+ cmStateSnapshot CreateFunctionCallSnapshot(
+ cmStateSnapshot const& originSnapshot, std::string const& fileName);
+ cmStateSnapshot CreateMacroCallSnapshot(
+ cmStateSnapshot const& originSnapshot, std::string const& fileName);
+ cmStateSnapshot CreateIncludeFileSnapshot(
+ cmStateSnapshot const& originSnapshot, std::string const& fileName);
+ cmStateSnapshot CreateVariableScopeSnapshot(
+ cmStateSnapshot const& originSnapshot);
+ cmStateSnapshot CreateInlineListFileSnapshot(
+ cmStateSnapshot const& originSnapshot, std::string const& fileName);
+ cmStateSnapshot CreatePolicyScopeSnapshot(
+ cmStateSnapshot const& originSnapshot);
+ cmStateSnapshot Pop(cmStateSnapshot const& originSnapshot);
static cmStateEnums::CacheEntryType StringToCacheEntryType(const char*);
static const char* CacheEntryTypeToString(cmStateEnums::CacheEntryType);
diff --git a/Source/cmStateSnapshot.cxx b/Source/cmStateSnapshot.cxx
index d2c9d73..77413c7 100644
--- a/Source/cmStateSnapshot.cxx
+++ b/Source/cmStateSnapshot.cxx
@@ -125,7 +125,7 @@ cmStateSnapshot cmStateSnapshot::GetCallStackBottom() const
return cmStateSnapshot(this->State, pos);
}
-void cmStateSnapshot::PushPolicy(cmPolicies::PolicyMap entry, bool weak)
+void cmStateSnapshot::PushPolicy(cmPolicies::PolicyMap const& entry, bool weak)
{
cmStateDetail::PositionType pos = this->Position;
pos->Policies = this->State->PolicyStack.Push(
diff --git a/Source/cmStateSnapshot.h b/Source/cmStateSnapshot.h
index 2e82ef4..6293803 100644
--- a/Source/cmStateSnapshot.h
+++ b/Source/cmStateSnapshot.h
@@ -45,7 +45,7 @@ public:
void SetPolicy(cmPolicies::PolicyID id, cmPolicies::PolicyStatus status);
cmPolicies::PolicyStatus GetPolicy(cmPolicies::PolicyID id) const;
bool HasDefinedPolicyCMP0011();
- void PushPolicy(cmPolicies::PolicyMap entry, bool weak);
+ void PushPolicy(cmPolicies::PolicyMap const& entry, bool weak);
bool PopPolicy();
bool CanPopPolicyScope();
diff --git a/Tests/GoogleTest/Test/CMakeLists.txt b/Tests/GoogleTest/Test/CMakeLists.txt
index a1f08d4..f798d31 100644
--- a/Tests/GoogleTest/Test/CMakeLists.txt
+++ b/Tests/GoogleTest/Test/CMakeLists.txt
@@ -53,12 +53,25 @@ gtest_add_tests(TARGET test_gtest2
)
set(expectedTests
GoogleTest.SomethingElse
+ GoogleTest.OffTest1
+ GoogleTest.OffTest2
+ GoogleTest.OffTest3
)
if(NOT testList STREQUAL "${expectedTests}")
message(FATAL_ERROR "Expected test list: ${expectedTests}
Actual test list: ${testList}")
endif()
-
+set(disabledTests
+ GoogleTest.OffTest1
+ GoogleTest.OffTest2
+ GoogleTest.OffTest3
+)
+foreach(T ${disabledTests})
+ get_test_property(${T} DISABLED testDisabled)
+ if(NOT testDisabled)
+ message(FATAL_ERROR "Test ${T} should be disabled but is not")
+ endif()
+endforeach()
# Non-keyword form, auto-find sources
add_executable(test_gtest3 main3.cxx)
diff --git a/Tests/GoogleTest/Test/main2.h b/Tests/GoogleTest/Test/main2.h
index 7243f53..7881c4f 100644
--- a/Tests/GoogleTest/Test/main2.h
+++ b/Tests/GoogleTest/Test/main2.h
@@ -4,3 +4,18 @@ TEST(GoogleTest, SomethingElse)
{
ASSERT_TRUE(true);
}
+
+TEST(GoogleTest, DISABLED_OffTest1)
+{
+ ASSERT_TRUE(true);
+}
+
+TEST(DISABLED_GoogleTest, OffTest2)
+{
+ ASSERT_TRUE(true);
+}
+
+TEST(DISABLED_GoogleTest, DISABLED_OffTest3)
+{
+ ASSERT_TRUE(true);
+}
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt
index 75d4e29..79f487d 100644
--- a/Tests/RunCMake/CMakeLists.txt
+++ b/Tests/RunCMake/CMakeLists.txt
@@ -147,7 +147,7 @@ endif()
add_RunCMake_test(GeneratorExpression)
add_RunCMake_test(GeneratorPlatform)
add_RunCMake_test(GeneratorToolset)
-add_RunCMake_test(GNUInstallDirs)
+add_RunCMake_test(GNUInstallDirs -DSYSTEM_NAME=${CMAKE_SYSTEM_NAME})
add_RunCMake_test(TargetPropertyGeneratorExpressions)
add_RunCMake_test(Languages)
add_RunCMake_test(LinkStatic)
diff --git a/Tests/RunCMake/GNUInstallDirs/Common.cmake b/Tests/RunCMake/GNUInstallDirs/Common.cmake
index 5f119af..919cd91 100644
--- a/Tests/RunCMake/GNUInstallDirs/Common.cmake
+++ b/Tests/RunCMake/GNUInstallDirs/Common.cmake
@@ -1,8 +1,5 @@
set(CMAKE_SIZEOF_VOID_P 8)
set(CMAKE_LIBRARY_ARCHITECTURE "arch")
-if(CMAKE_SYSTEM_NAME STREQUAL "OpenBSD")
- set(CMAKE_SYSTEM_NAME "OpenBSD-Fake")
-endif()
include(GNUInstallDirs)
set(dirs
BINDIR
diff --git a/Tests/RunCMake/GNUInstallDirs/Opt-BSD-stderr.txt b/Tests/RunCMake/GNUInstallDirs/Opt-BSD-stderr.txt
new file mode 100644
index 0000000..09ae303
--- /dev/null
+++ b/Tests/RunCMake/GNUInstallDirs/Opt-BSD-stderr.txt
@@ -0,0 +1,30 @@
+^CMAKE_INSTALL_BINDIR='bin'
+CMAKE_INSTALL_DATADIR='share'
+CMAKE_INSTALL_DATAROOTDIR='share'
+CMAKE_INSTALL_DOCDIR='share/doc/Opt'
+CMAKE_INSTALL_INCLUDEDIR='include'
+CMAKE_INSTALL_INFODIR='info'
+CMAKE_INSTALL_LIBDIR='(lib|lib64)'
+CMAKE_INSTALL_LIBEXECDIR='libexec'
+CMAKE_INSTALL_LOCALEDIR='share/locale'
+CMAKE_INSTALL_LOCALSTATEDIR='var'
+CMAKE_INSTALL_RUNSTATEDIR='var/run'
+CMAKE_INSTALL_MANDIR='man'
+CMAKE_INSTALL_SBINDIR='sbin'
+CMAKE_INSTALL_SHAREDSTATEDIR='com'
+CMAKE_INSTALL_SYSCONFDIR='etc'
+CMAKE_INSTALL_FULL_BINDIR='/opt/Opt/bin'
+CMAKE_INSTALL_FULL_DATADIR='/opt/Opt/share'
+CMAKE_INSTALL_FULL_DATAROOTDIR='/opt/Opt/share'
+CMAKE_INSTALL_FULL_DOCDIR='/opt/Opt/share/doc/Opt'
+CMAKE_INSTALL_FULL_INCLUDEDIR='/opt/Opt/include'
+CMAKE_INSTALL_FULL_INFODIR='/opt/Opt/info'
+CMAKE_INSTALL_FULL_LIBDIR='/opt/Opt/(lib|lib64)'
+CMAKE_INSTALL_FULL_LIBEXECDIR='/opt/Opt/libexec'
+CMAKE_INSTALL_FULL_LOCALEDIR='/opt/Opt/share/locale'
+CMAKE_INSTALL_FULL_LOCALSTATEDIR='/var/opt/Opt'
+CMAKE_INSTALL_FULL_RUNSTATEDIR='/var/run/opt/Opt'
+CMAKE_INSTALL_FULL_MANDIR='/opt/Opt/man'
+CMAKE_INSTALL_FULL_SBINDIR='/opt/Opt/sbin'
+CMAKE_INSTALL_FULL_SHAREDSTATEDIR='/opt/Opt/com'
+CMAKE_INSTALL_FULL_SYSCONFDIR='/etc/opt/Opt'$
diff --git a/Tests/RunCMake/GNUInstallDirs/Root-BSD-stderr.txt b/Tests/RunCMake/GNUInstallDirs/Root-BSD-stderr.txt
new file mode 100644
index 0000000..4be66bc
--- /dev/null
+++ b/Tests/RunCMake/GNUInstallDirs/Root-BSD-stderr.txt
@@ -0,0 +1,30 @@
+^CMAKE_INSTALL_BINDIR='usr/bin'
+CMAKE_INSTALL_DATADIR='usr/share'
+CMAKE_INSTALL_DATAROOTDIR='usr/share'
+CMAKE_INSTALL_DOCDIR='usr/share/doc/Root'
+CMAKE_INSTALL_INCLUDEDIR='usr/include'
+CMAKE_INSTALL_INFODIR='usr/info'
+CMAKE_INSTALL_LIBDIR='usr/(lib|lib64)'
+CMAKE_INSTALL_LIBEXECDIR='usr/libexec'
+CMAKE_INSTALL_LOCALEDIR='usr/share/locale'
+CMAKE_INSTALL_LOCALSTATEDIR='var'
+CMAKE_INSTALL_RUNSTATEDIR='var/run'
+CMAKE_INSTALL_MANDIR='usr/man'
+CMAKE_INSTALL_SBINDIR='usr/sbin'
+CMAKE_INSTALL_SHAREDSTATEDIR='usr/com'
+CMAKE_INSTALL_SYSCONFDIR='etc'
+CMAKE_INSTALL_FULL_BINDIR='/usr/bin'
+CMAKE_INSTALL_FULL_DATADIR='/usr/share'
+CMAKE_INSTALL_FULL_DATAROOTDIR='/usr/share'
+CMAKE_INSTALL_FULL_DOCDIR='/usr/share/doc/Root'
+CMAKE_INSTALL_FULL_INCLUDEDIR='/usr/include'
+CMAKE_INSTALL_FULL_INFODIR='/usr/info'
+CMAKE_INSTALL_FULL_LIBDIR='/usr/(lib|lib64)'
+CMAKE_INSTALL_FULL_LIBEXECDIR='/usr/libexec'
+CMAKE_INSTALL_FULL_LOCALEDIR='/usr/share/locale'
+CMAKE_INSTALL_FULL_LOCALSTATEDIR='/var'
+CMAKE_INSTALL_FULL_RUNSTATEDIR='/var/run'
+CMAKE_INSTALL_FULL_MANDIR='/usr/man'
+CMAKE_INSTALL_FULL_SBINDIR='/usr/sbin'
+CMAKE_INSTALL_FULL_SHAREDSTATEDIR='/usr/com'
+CMAKE_INSTALL_FULL_SYSCONFDIR='/etc'$
diff --git a/Tests/RunCMake/GNUInstallDirs/RunCMakeTest.cmake b/Tests/RunCMake/GNUInstallDirs/RunCMakeTest.cmake
index f88569a..b544ba6 100644
--- a/Tests/RunCMake/GNUInstallDirs/RunCMakeTest.cmake
+++ b/Tests/RunCMake/GNUInstallDirs/RunCMakeTest.cmake
@@ -1,6 +1,17 @@
include(RunCMake)
-run_cmake(Opt)
-run_cmake(Root)
-run_cmake(Usr)
-run_cmake(UsrLocal)
+if(SYSTEM_NAME MATCHES "^(.*BSD|DragonFly)$")
+ set(EXPECT_BSD 1)
+endif()
+
+foreach(case
+ Opt
+ Root
+ Usr
+ UsrLocal
+ )
+ if(EXPECT_BSD)
+ set(RunCMake-stderr-file ${case}-BSD-stderr.txt)
+ endif()
+ run_cmake(${case})
+endforeach()
diff --git a/Tests/RunCMake/GNUInstallDirs/Usr-BSD-stderr.txt b/Tests/RunCMake/GNUInstallDirs/Usr-BSD-stderr.txt
new file mode 100644
index 0000000..3d7b4c8
--- /dev/null
+++ b/Tests/RunCMake/GNUInstallDirs/Usr-BSD-stderr.txt
@@ -0,0 +1,30 @@
+^CMAKE_INSTALL_BINDIR='bin'
+CMAKE_INSTALL_DATADIR='share'
+CMAKE_INSTALL_DATAROOTDIR='share'
+CMAKE_INSTALL_DOCDIR='share/doc/Usr'
+CMAKE_INSTALL_INCLUDEDIR='include'
+CMAKE_INSTALL_INFODIR='info'
+CMAKE_INSTALL_LIBDIR='(lib|lib64|lib/arch)'
+CMAKE_INSTALL_LIBEXECDIR='libexec'
+CMAKE_INSTALL_LOCALEDIR='share/locale'
+CMAKE_INSTALL_LOCALSTATEDIR='var'
+CMAKE_INSTALL_RUNSTATEDIR='var/run'
+CMAKE_INSTALL_MANDIR='man'
+CMAKE_INSTALL_SBINDIR='sbin'
+CMAKE_INSTALL_SHAREDSTATEDIR='com'
+CMAKE_INSTALL_SYSCONFDIR='etc'
+CMAKE_INSTALL_FULL_BINDIR='/usr/bin'
+CMAKE_INSTALL_FULL_DATADIR='/usr/share'
+CMAKE_INSTALL_FULL_DATAROOTDIR='/usr/share'
+CMAKE_INSTALL_FULL_DOCDIR='/usr/share/doc/Usr'
+CMAKE_INSTALL_FULL_INCLUDEDIR='/usr/include'
+CMAKE_INSTALL_FULL_INFODIR='/usr/info'
+CMAKE_INSTALL_FULL_LIBDIR='/usr/(lib|lib64|lib/arch)'
+CMAKE_INSTALL_FULL_LIBEXECDIR='/usr/libexec'
+CMAKE_INSTALL_FULL_LOCALEDIR='/usr/share/locale'
+CMAKE_INSTALL_FULL_LOCALSTATEDIR='/var'
+CMAKE_INSTALL_FULL_RUNSTATEDIR='/var/run'
+CMAKE_INSTALL_FULL_MANDIR='/usr/man'
+CMAKE_INSTALL_FULL_SBINDIR='/usr/sbin'
+CMAKE_INSTALL_FULL_SHAREDSTATEDIR='/usr/com'
+CMAKE_INSTALL_FULL_SYSCONFDIR='/etc'$
diff --git a/Tests/RunCMake/GNUInstallDirs/UsrLocal-BSD-stderr.txt b/Tests/RunCMake/GNUInstallDirs/UsrLocal-BSD-stderr.txt
new file mode 100644
index 0000000..e1425d5
--- /dev/null
+++ b/Tests/RunCMake/GNUInstallDirs/UsrLocal-BSD-stderr.txt
@@ -0,0 +1,30 @@
+^CMAKE_INSTALL_BINDIR='bin'
+CMAKE_INSTALL_DATADIR='share'
+CMAKE_INSTALL_DATAROOTDIR='share'
+CMAKE_INSTALL_DOCDIR='share/doc/UsrLocal'
+CMAKE_INSTALL_INCLUDEDIR='include'
+CMAKE_INSTALL_INFODIR='info'
+CMAKE_INSTALL_LIBDIR='(lib|lib64)'
+CMAKE_INSTALL_LIBEXECDIR='libexec'
+CMAKE_INSTALL_LOCALEDIR='share/locale'
+CMAKE_INSTALL_LOCALSTATEDIR='var'
+CMAKE_INSTALL_RUNSTATEDIR='var/run'
+CMAKE_INSTALL_MANDIR='man'
+CMAKE_INSTALL_SBINDIR='sbin'
+CMAKE_INSTALL_SHAREDSTATEDIR='com'
+CMAKE_INSTALL_SYSCONFDIR='etc'
+CMAKE_INSTALL_FULL_BINDIR='/usr/local/bin'
+CMAKE_INSTALL_FULL_DATADIR='/usr/local/share'
+CMAKE_INSTALL_FULL_DATAROOTDIR='/usr/local/share'
+CMAKE_INSTALL_FULL_DOCDIR='/usr/local/share/doc/UsrLocal'
+CMAKE_INSTALL_FULL_INCLUDEDIR='/usr/local/include'
+CMAKE_INSTALL_FULL_INFODIR='/usr/local/info'
+CMAKE_INSTALL_FULL_LIBDIR='/usr/local/(lib|lib64)'
+CMAKE_INSTALL_FULL_LIBEXECDIR='/usr/local/libexec'
+CMAKE_INSTALL_FULL_LOCALEDIR='/usr/local/share/locale'
+CMAKE_INSTALL_FULL_LOCALSTATEDIR='/usr/local/var'
+CMAKE_INSTALL_FULL_RUNSTATEDIR='/usr/local/var/run'
+CMAKE_INSTALL_FULL_MANDIR='/usr/local/man'
+CMAKE_INSTALL_FULL_SBINDIR='/usr/local/sbin'
+CMAKE_INSTALL_FULL_SHAREDSTATEDIR='/usr/local/com'
+CMAKE_INSTALL_FULL_SYSCONFDIR='/usr/local/etc'$
diff --git a/Utilities/Release/consolidate-relnotes.bash b/Utilities/Release/consolidate-relnotes.bash
new file mode 100755
index 0000000..91307ac
--- /dev/null
+++ b/Utilities/Release/consolidate-relnotes.bash
@@ -0,0 +1,27 @@
+#!/usr/bin/env bash
+
+set -e
+
+usage='usage: consolidate-relnotes.bash <new-release-version> <prev-release-version>'
+
+die() {
+ echo "$@" 1>&2; exit 1
+}
+
+test "$#" = 2 || die "$usage"
+
+files="$(ls Help/release/dev/* | grep -v Help/release/dev/0-sample-topic.rst)"
+title="CMake $1 Release Notes"
+underline="$(echo "$title" | sed 's/./*/g')"
+echo "$title
+$underline
+
+.. only:: html
+
+ .. contents::
+
+Changes made since CMake $2 include the following." > Help/release/"$1".rst
+tail -q -n +3 $files >> Help/release/"$1".rst
+sed -i "/^ $2 / i\\
+ $1 <$1>" Help/release/index.rst
+rm $files
diff --git a/bootstrap b/bootstrap
index 84285a8..84df54a 100755
--- a/bootstrap
+++ b/bootstrap
@@ -1307,6 +1307,7 @@ cmake_report cmConfigure.h${_tmp} "#define CMAKE_BIN_DIR \"/bootstrap-not-insall
cmake_report cmConfigure.h${_tmp} "#define CMAKE_DATA_DIR \"/bootstrap-not-insalled\""
cmake_report cmConfigure.h${_tmp} "#define CMAKE_BOOTSTRAP"
cmake_report cmConfigure.h${_tmp} "#define CM_EQ_DELETE"
+cmake_report cmConfigure.h${_tmp} "#define CM_FALLTHROUGH"
cmake_report cmConfigure.h${_tmp} "#define CM_NULLPTR 0"
cmake_report cmConfigure.h${_tmp} "#define CM_OVERRIDE"
cmake_report cmConfigure.h${_tmp} "#define CM_DISABLE_COPY(Class)"