[Cmake-commits] CMake branch, master, updated. v3.14.1-622-gc756fbc
Kitware Robot
kwrobot at kitware.com
Mon Apr 8 07:53:06 EDT 2019
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".
The branch, master has been updated
via c756fbce9ba94e2d7f1b787d595df24dbe99c9c1 (commit)
via 99ce35ab9cbdac4a7cc626590f5e86c36ae29070 (commit)
via 658efb4c1ab309646f0a29f806315f805de477a4 (commit)
via 0090907e86d5e837f23fea9823664ceff6b3832f (commit)
via c1d1027ac1bf922972ebb121f369ff59be27103d (commit)
via a1e6b414b9ade99a8f4e6bbe9bbff43ee1a05e88 (commit)
via 266dadf8683c9c0081368604c4ccae12e8ffc9f7 (commit)
from 52aa68228401c62dbe79c54b2b8346bdb8621dfc (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c756fbce9ba94e2d7f1b787d595df24dbe99c9c1
commit c756fbce9ba94e2d7f1b787d595df24dbe99c9c1
Merge: 99ce35a a1e6b41
Author: Brad King <brad.king at kitware.com>
AuthorDate: Mon Apr 8 11:43:22 2019 +0000
Commit: Kitware Robot <kwrobot at kitware.com>
CommitDate: Mon Apr 8 07:45:13 2019 -0400
Merge topic 'ghs_os_dir'
a1e6b414b9 GHS: Update GHS_BSP_NAME processing
266dadf868 GHS: Print status message regarding GHS_OS_DIR
Acked-by: Kitware Robot <kwrobot at kitware.com>
Merge-request: !3123
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=99ce35ab9cbdac4a7cc626590f5e86c36ae29070
commit 99ce35ab9cbdac4a7cc626590f5e86c36ae29070
Merge: 658efb4 c1d1027
Author: Brad King <brad.king at kitware.com>
AuthorDate: Mon Apr 8 11:42:59 2019 +0000
Commit: Kitware Robot <kwrobot at kitware.com>
CommitDate: Mon Apr 8 07:44:10 2019 -0400
Merge topic 'tidy-fixes'
c1d1027ac1 Enabled performance-inefficient-vector-operation check in clang-tidy
Acked-by: Kitware Robot <kwrobot at kitware.com>
Merge-request: !3185
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=658efb4c1ab309646f0a29f806315f805de477a4
commit 658efb4c1ab309646f0a29f806315f805de477a4
Merge: 52aa682 0090907
Author: Brad King <brad.king at kitware.com>
AuthorDate: Mon Apr 8 11:42:47 2019 +0000
Commit: Kitware Robot <kwrobot at kitware.com>
CommitDate: Mon Apr 8 07:42:56 2019 -0400
Merge topic 'modernize-raw-string-literal'
0090907e86 tidy: Fix modernize-raw-string-literal in FreeBSD CPack generator
Acked-by: Kitware Robot <kwrobot at kitware.com>
Merge-request: !3198
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0090907e86d5e837f23fea9823664ceff6b3832f
commit 0090907e86d5e837f23fea9823664ceff6b3832f
Author: Brad King <brad.king at kitware.com>
AuthorDate: Fri Apr 5 08:32:39 2019 -0400
Commit: Brad King <brad.king at kitware.com>
CommitDate: Fri Apr 5 08:32:39 2019 -0400
tidy: Fix modernize-raw-string-literal in FreeBSD CPack generator
diff --git a/Source/CPack/cmCPackFreeBSDGenerator.cxx b/Source/CPack/cmCPackFreeBSDGenerator.cxx
index dd8127d..9fdafa4 100644
--- a/Source/CPack/cmCPackFreeBSDGenerator.cxx
+++ b/Source/CPack/cmCPackFreeBSDGenerator.cxx
@@ -181,7 +181,7 @@ public:
{
s << "{\n";
for (std::string const& elem : value) {
- s << " \"" << elem << "\": {\"origin\": \"" << elem << "\"},\n";
+ s << " \"" << elem << R"(": {"origin": ")" << elem << "\"},\n";
}
s << '}';
}
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c1d1027ac1bf922972ebb121f369ff59be27103d
commit c1d1027ac1bf922972ebb121f369ff59be27103d
Author: Jakub Kalinski <jakub.kalinski1993 at gmail.com>
AuthorDate: Tue Apr 2 22:04:02 2019 +0200
Commit: Jakub Kalinski <jakub.kalinski1993 at gmail.com>
CommitDate: Tue Apr 2 22:17:24 2019 +0200
Enabled performance-inefficient-vector-operation check in clang-tidy
diff --git a/.clang-tidy b/.clang-tidy
index 520b1a9..f51c8fc 100644
--- a/.clang-tidy
+++ b/.clang-tidy
@@ -19,7 +19,6 @@ modernize-*,\
-modernize-use-using,\
performance-*,\
-performance-inefficient-string-concatenation,\
--performance-inefficient-vector-operation,\
readability-*,\
-readability-function-size,\
-readability-identifier-naming,\
diff --git a/Source/cmSourceGroupCommand.cxx b/Source/cmSourceGroupCommand.cxx
index 34ded38..2bc4c39 100644
--- a/Source/cmSourceGroupCommand.cxx
+++ b/Source/cmSourceGroupCommand.cxx
@@ -77,6 +77,7 @@ std::vector<std::string> prepareFilesPathsForTree(
const std::string& currentSourceDir)
{
std::vector<std::string> prepared;
+ prepared.reserve(filesPaths.size());
for (auto const& filePath : filesPaths) {
prepared.push_back(prepareFilePathForTree(filePath, currentSourceDir));
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a1e6b414b9ade99a8f4e6bbe9bbff43ee1a05e88
commit a1e6b414b9ade99a8f4e6bbe9bbff43ee1a05e88
Author: Fred Baksik <frodak17 at gmail.com>
AuthorDate: Fri Mar 22 17:06:33 2019 -0400
Commit: Brad King <brad.king at kitware.com>
CommitDate: Fri Mar 29 12:38:34 2019 -0400
GHS: Update GHS_BSP_NAME processing
-- Set name earlier so that the initial project() compiler checks
run correctly when GHS_BSP_NAME is not specified on command line.
diff --git a/Source/cmGlobalGhsMultiGenerator.cxx b/Source/cmGlobalGhsMultiGenerator.cxx
index 4379b34..9f361f6 100644
--- a/Source/cmGlobalGhsMultiGenerator.cxx
+++ b/Source/cmGlobalGhsMultiGenerator.cxx
@@ -119,10 +119,11 @@ bool cmGlobalGhsMultiGenerator::SetGeneratorToolset(std::string const& ts,
bool cmGlobalGhsMultiGenerator::SetGeneratorPlatform(std::string const& p,
cmMakefile* mf)
{
+ std::string arch;
if (p.empty()) {
cmSystemTools::Message(
"Green Hills MULTI: -A <arch> not specified; defaulting to \"arm\"");
- std::string arch = "arm";
+ arch = "arm";
/* store the platform name for later use
* -- already done if -A<arch> was specified
@@ -130,6 +131,8 @@ bool cmGlobalGhsMultiGenerator::SetGeneratorPlatform(std::string const& p,
mf->AddCacheDefinition("CMAKE_GENERATOR_PLATFORM", arch.c_str(),
"Name of generator platform.",
cmStateEnums::INTERNAL);
+ } else {
+ arch = p;
}
/* check if OS location has been updated by platform scripts */
@@ -157,6 +160,23 @@ bool cmGlobalGhsMultiGenerator::SetGeneratorPlatform(std::string const& p,
}
this->OsDir = osdir;
+ // Determine GHS_BSP_NAME
+ std::string bspName = mf->GetSafeDefinition("GHS_BSP_NAME");
+
+ if (cmSystemTools::IsOff(bspName.c_str()) &&
+ platform.find("integrity") != std::string::npos) {
+ bspName = "sim" + arch;
+ /* write back the calculate name for next time */
+ mf->AddCacheDefinition("GHS_BSP_NAME", bspName.c_str(),
+ "Name of GHS target platform.",
+ cmStateEnums::STRING, true);
+ std::string m =
+ "Green Hills MULTI: GHS_BSP_NAME not specified; defaulting to \"";
+ m += bspName;
+ m += "\"";
+ cmSystemTools::Message(m);
+ }
+
return true;
}
@@ -258,32 +278,9 @@ void cmGlobalGhsMultiGenerator::WriteTopLevelProject(
fout << "# Top Level Project File" << std::endl;
// Specify BSP option if supplied by user
- // -- not all platforms require this entry in the project file
- // integrity platforms require this field; use default if needed
- std::string platform;
- if (const char* p =
- this->GetCMakeInstance()->GetCacheDefinition("GHS_TARGET_PLATFORM")) {
- platform = p;
- }
-
- std::string bspName;
- if (char const* bspCache =
- this->GetCMakeInstance()->GetCacheDefinition("GHS_BSP_NAME")) {
- bspName = bspCache;
- this->GetCMakeInstance()->MarkCliAsUsed("GHS_BSP_NAME");
- } else {
- bspName = "IGNORE";
- }
-
- if (platform.find("integrity") != std::string::npos &&
- cmSystemTools::IsOff(bspName.c_str())) {
- const char* a =
- this->GetCMakeInstance()->GetCacheDefinition("CMAKE_GENERATOR_PLATFORM");
- bspName = "sim";
- bspName += (a ? a : "");
- }
-
- if (!cmSystemTools::IsOff(bspName.c_str())) {
+ const char* bspName =
+ this->GetCMakeInstance()->GetCacheDefinition("GHS_BSP_NAME");
+ if (!cmSystemTools::IsOff(bspName)) {
fout << " -bsp " << bspName << std::endl;
}
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=266dadf8683c9c0081368604c4ccae12e8ffc9f7
commit 266dadf8683c9c0081368604c4ccae12e8ffc9f7
Author: Fred Baksik <frodak17 at gmail.com>
AuthorDate: Tue Mar 19 20:56:30 2019 -0400
Commit: Brad King <brad.king at kitware.com>
CommitDate: Fri Mar 29 12:38:12 2019 -0400
GHS: Print status message regarding GHS_OS_DIR
-- Rename platform script so it runs before initial try_compile() in
project() command.
-- Fix incorrect variable name GHS_OS_DIR_OPTION
-- Remove unnecessary ".*" from REGEX expression for GHS_CANDIDATE_OS_DIRS
-- Forward GHS_OS_DIR_OPTION to try_compile() and preserve trailing
whitespace of the variable.
diff --git a/Help/generator/Green Hills MULTI.rst b/Help/generator/Green Hills MULTI.rst
index 09c5b15..138e214 100644
--- a/Help/generator/Green Hills MULTI.rst
+++ b/Help/generator/Green Hills MULTI.rst
@@ -40,11 +40,12 @@ Cache variables that are used for toolset and target system customization:
| Root path for RTOS searches.
| Defaults to ``C:/ghs`` in Windows or ``/usr/ghs`` in Linux.
-* ``GHS_OS_DIR``
+* ``GHS_OS_DIR`` and ``GHS_OS_DIR_OPTION``
| Sets ``-os_dir`` entry in project file.
| Defaults to latest platform OS installation at ``GHS_OS_ROOT``. Set this value if
a specific RTOS is to be used.
+ | ``GHS_OS_DIR_OPTION`` default value is ``-os_dir``.
* ``GHS_BSP_NAME``
diff --git a/Modules/Platform/GHS-MULTI-Initialize.cmake b/Modules/Platform/GHS-MULTI-Determine.cmake
similarity index 83%
rename from Modules/Platform/GHS-MULTI-Initialize.cmake
rename to Modules/Platform/GHS-MULTI-Determine.cmake
index db65d14..349d906 100644
--- a/Modules/Platform/GHS-MULTI-Initialize.cmake
+++ b/Modules/Platform/GHS-MULTI-Determine.cmake
@@ -13,39 +13,40 @@ mark_as_advanced(GHS_OS_ROOT)
set(GHS_OS_DIR "NOTFOUND" CACHE PATH "GHS platform OS directory")
mark_as_advanced(GHS_OS_DIR)
-set(GHS_OS_DIR_OPTION "-os_dir " CACHE STRING "GHS compiler os option")
-mark_as_advanced(GHS_OS_DIR)
+set(GHS_OS_DIR_OPTION "-os_dir " CACHE STRING "GHS compiler OS option")
+mark_as_advanced(GHS_OS_DIR_OPTION)
#set GHS_OS_DIR if not set by user
-if ( NOT GHS_OS_DIR )
- if (EXISTS ${GHS_OS_ROOT})
+if(NOT GHS_OS_DIR)
+ if(EXISTS ${GHS_OS_ROOT})
#get all directories in root directory
FILE(GLOB GHS_CANDIDATE_OS_DIRS
LIST_DIRECTORIES true RELATIVE ${GHS_OS_ROOT} ${GHS_OS_ROOT}/*)
FILE(GLOB GHS_CANDIDATE_OS_FILES
LIST_DIRECTORIES false RELATIVE ${GHS_OS_ROOT} ${GHS_OS_ROOT}/*)
- if ( GHS_CANDIDATE_OS_FILES )
+ if(GHS_CANDIDATE_OS_FILES)
list(REMOVE_ITEM GHS_CANDIDATE_OS_DIRS ${GHS_CANDIDATE_OS_FILES})
endif ()
#filter based on platform name
- if (GHS_TARGET_PLATFORM MATCHES "integrity")
- list(FILTER GHS_CANDIDATE_OS_DIRS INCLUDE REGEX "int[0-9][0-9][0-9][0-9a-z].*")
+ if(GHS_TARGET_PLATFORM MATCHES "integrity")
+ list(FILTER GHS_CANDIDATE_OS_DIRS INCLUDE REGEX "int[0-9][0-9][0-9][0-9a-z]")
else() #fall-back for standalone
unset(GHS_CANDIDATE_OS_DIRS)
set(GHS_OS_DIR "IGNORE")
- endif ()
+ endif()
- if (GHS_CANDIDATE_OS_DIRS)
+ if(GHS_CANDIDATE_OS_DIRS)
list(SORT GHS_CANDIDATE_OS_DIRS)
list(GET GHS_CANDIDATE_OS_DIRS -1 GHS_OS_DIR)
string(CONCAT GHS_OS_DIR ${GHS_OS_ROOT} "/" ${GHS_OS_DIR})
endif()
+ #update cache with new value
set(GHS_OS_DIR "${GHS_OS_DIR}" CACHE PATH "GHS platform OS directory" FORCE)
- endif ()
-endif ()
+ endif()
+endif()
set(GHS_BSP_NAME "IGNORE" CACHE STRING "BSP name")
diff --git a/Source/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx
index 69d4374..62fba74 100644
--- a/Source/cmCoreTryCompile.cxx
+++ b/Source/cmCoreTryCompile.cxx
@@ -60,7 +60,8 @@ static std::string const kCMAKE_WARN_DEPRECATED = "CMAKE_WARN_DEPRECATED";
/* GHS Multi platform variables */
static std::set<std::string> ghs_platform_vars{
"GHS_TARGET_PLATFORM", "GHS_PRIMARY_TARGET", "GHS_TOOLSET_ROOT",
- "GHS_OS_ROOT", "GHS_OS_DIR", "GHS_BSP_NAME"
+ "GHS_OS_ROOT", "GHS_OS_DIR", "GHS_BSP_NAME",
+ "GHS_OS_DIR_OPTION"
};
static void writeProperty(FILE* fout, std::string const& targetName,
@@ -881,7 +882,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv,
// Forward the GHS variables to the inner project cache.
for (std::string const& var : ghs_platform_vars) {
if (const char* val = this->Makefile->GetDefinition(var)) {
- std::string flag = "-D" + var + "=" + val;
+ std::string flag = "-D" + var + "=" + "'" + val + "'";
cmakeFlags.push_back(std::move(flag));
}
}
diff --git a/Source/cmGlobalGhsMultiGenerator.cxx b/Source/cmGlobalGhsMultiGenerator.cxx
index e6a1d78..4379b34 100644
--- a/Source/cmGlobalGhsMultiGenerator.cxx
+++ b/Source/cmGlobalGhsMultiGenerator.cxx
@@ -132,17 +132,30 @@ bool cmGlobalGhsMultiGenerator::SetGeneratorPlatform(std::string const& p,
cmStateEnums::INTERNAL);
}
- const char* tgtPlatform = mf->GetDefinition("GHS_TARGET_PLATFORM");
- if (tgtPlatform == nullptr) {
- cmSystemTools::Message("Green Hills MULTI: GHS_TARGET_PLATFORM not "
- "specified; defaulting to \"integrity\"");
- tgtPlatform = "integrity";
+ /* check if OS location has been updated by platform scripts */
+ std::string platform = mf->GetSafeDefinition("GHS_TARGET_PLATFORM");
+ std::string osdir = mf->GetSafeDefinition("GHS_OS_DIR");
+ if (cmSystemTools::IsOff(osdir.c_str()) &&
+ platform.find("integrity") != std::string::npos) {
+ if (!this->CMakeInstance->GetIsInTryCompile()) {
+ /* required OS location is not found */
+ std::string m =
+ "Green Hills MULTI: GHS_OS_DIR not specified; No OS found in \"";
+ m += mf->GetSafeDefinition("GHS_OS_ROOT");
+ m += "\"";
+ cmSystemTools::Message(m);
+ }
+ osdir = "GHS_OS_DIR-NOT-SPECIFIED";
+ } else if (!this->CMakeInstance->GetIsInTryCompile() &&
+ cmSystemTools::IsOff(this->OsDir) &&
+ !cmSystemTools::IsOff(osdir)) {
+ /* OS location was updated by auto-selection */
+ std::string m = "Green Hills MULTI: GHS_OS_DIR not specified; found \"";
+ m += osdir;
+ m += "\"";
+ cmSystemTools::Message(m);
}
-
- /* store the platform name for later use */
- mf->AddCacheDefinition("GHS_TARGET_PLATFORM", tgtPlatform,
- "Name of GHS target platform.",
- cmStateEnums::INTERNAL);
+ this->OsDir = osdir;
return true;
}
@@ -153,6 +166,21 @@ void cmGlobalGhsMultiGenerator::EnableLanguage(
mf->AddDefinition("CMAKE_SYSTEM_NAME", "GHS-MULTI");
mf->AddDefinition("GHSMULTI", "1"); // identifier for user CMake files
+
+ const char* tgtPlatform = mf->GetDefinition("GHS_TARGET_PLATFORM");
+ if (!tgtPlatform) {
+ cmSystemTools::Message("Green Hills MULTI: GHS_TARGET_PLATFORM not "
+ "specified; defaulting to \"integrity\"");
+ tgtPlatform = "integrity";
+ }
+
+ /* store the platform name for later use */
+ mf->AddCacheDefinition("GHS_TARGET_PLATFORM", tgtPlatform,
+ "Name of GHS target platform.", cmStateEnums::STRING);
+
+ /* store original OS location */
+ this->OsDir = mf->GetSafeDefinition("GHS_OS_DIR");
+
this->cmGlobalGenerator::EnableLanguage(l, mf, optional);
}
@@ -261,22 +289,17 @@ void cmGlobalGhsMultiGenerator::WriteTopLevelProject(
// Specify OS DIR if supplied by user
// -- not all platforms require this entry in the project file
- std::string osDir;
- std::string osDirOption;
- if (char const* osDirCache =
- this->GetCMakeInstance()->GetCacheDefinition("GHS_OS_DIR")) {
- osDir = osDirCache;
- }
-
- if (char const* osDirOptionCache =
- this->GetCMakeInstance()->GetCacheDefinition("GHS_OS_DIR_OPTION")) {
- osDirOption = osDirOptionCache;
- }
-
- if (!cmSystemTools::IsOff(osDir.c_str()) ||
- platform.find("integrity") != std::string::npos) {
- std::replace(osDir.begin(), osDir.end(), '\\', '/');
- fout << " " << osDirOption << "\"" << osDir << "\"" << std::endl;
+ if (!cmSystemTools::IsOff(this->OsDir.c_str())) {
+ const char* osDirOption =
+ this->GetCMakeInstance()->GetCacheDefinition("GHS_OS_DIR_OPTION");
+ std::replace(this->OsDir.begin(), this->OsDir.end(), '\\', '/');
+ fout << " ";
+ if (cmSystemTools::IsOff(osDirOption)) {
+ fout << "";
+ } else {
+ fout << osDirOption;
+ }
+ fout << "\"" << this->OsDir << "\"" << std::endl;
}
WriteSubProjects(fout, root, generators);
diff --git a/Source/cmGlobalGhsMultiGenerator.h b/Source/cmGlobalGhsMultiGenerator.h
index f8df6ef..3dcf077 100644
--- a/Source/cmGlobalGhsMultiGenerator.h
+++ b/Source/cmGlobalGhsMultiGenerator.h
@@ -120,6 +120,7 @@ private:
std::string trimQuotes(std::string const& str);
+ std::string OsDir;
static const char* DEFAULT_BUILD_PROGRAM;
static const char* DEFAULT_TOOLSET_ROOT;
};
-----------------------------------------------------------------------
Summary of changes:
.clang-tidy | 1 -
Help/generator/Green Hills MULTI.rst | 3 +-
...-Initialize.cmake => GHS-MULTI-Determine.cmake} | 23 ++--
Source/CPack/cmCPackFreeBSDGenerator.cxx | 2 +-
Source/cmCoreTryCompile.cxx | 5 +-
Source/cmGlobalGhsMultiGenerator.cxx | 124 ++++++++++++---------
Source/cmGlobalGhsMultiGenerator.h | 1 +
Source/cmSourceGroupCommand.cxx | 1 +
8 files changed, 92 insertions(+), 68 deletions(-)
rename Modules/Platform/{GHS-MULTI-Initialize.cmake => GHS-MULTI-Determine.cmake} (83%)
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list