[Cmake-commits] CMake branch, next, updated. v3.5.2-1446-g1c84ab1

Brad King brad.king at kitware.com
Tue May 17 09:45:33 EDT 2016


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, next has been updated
       via  1c84ab1660ee48611ca04fc739613c7d553d6ae3 (commit)
       via  ae1f90c7643792e07cbd0211a68cd9ba4db7d4fb (commit)
      from  2d554fd67fd3c3a2880d02faff193c61e6f224e1 (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=1c84ab1660ee48611ca04fc739613c7d553d6ae3
commit 1c84ab1660ee48611ca04fc739613c7d553d6ae3
Merge: 2d554fd ae1f90c
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Tue May 17 09:45:32 2016 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Tue May 17 09:45:32 2016 -0400

    Merge topic 'ghs-shorter-object-names' into next
    
    ae1f90c7 GHS: Use shorter object file names on collision


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ae1f90c7643792e07cbd0211a68cd9ba4db7d4fb
commit ae1f90c7643792e07cbd0211a68cd9ba4db7d4fb
Author:     Geoff Viola <geoffrey.viola at asirobots.com>
AuthorDate: Sun May 15 09:59:43 2016 -0600
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Tue May 17 09:34:38 2016 -0400

    GHS: Use shorter object file names on collision

diff --git a/Modules/Compiler/GHS-C.cmake b/Modules/Compiler/GHS-C.cmake
index 50532ce..3072715 100644
--- a/Modules/Compiler/GHS-C.cmake
+++ b/Modules/Compiler/GHS-C.cmake
@@ -1,6 +1,7 @@
 include(Compiler/GHS)
 
 set(CMAKE_C_VERBOSE_FLAG "-v")
+set(CMAKE_C_OUTPUT_EXTENSION ".o")
 
 set(CMAKE_C_FLAGS_INIT "")
 set(CMAKE_C_FLAGS_DEBUG_INIT "-Odebug -g")
diff --git a/Modules/Compiler/GHS-CXX.cmake b/Modules/Compiler/GHS-CXX.cmake
index 2cffa0d..a51591b 100644
--- a/Modules/Compiler/GHS-CXX.cmake
+++ b/Modules/Compiler/GHS-CXX.cmake
@@ -1,6 +1,7 @@
 include(Compiler/GHS)
 
 set(CMAKE_CXX_VERBOSE_FLAG "-v")
+set(CMAKE_CXX_OUTPUT_EXTENSION ".o")
 
 set(CMAKE_CXX_FLAGS_INIT "")
 set(CMAKE_CXX_FLAGS_DEBUG_INIT "-Odebug -g")
diff --git a/Source/cmGhsMultiTargetGenerator.cxx b/Source/cmGhsMultiTargetGenerator.cxx
index 325a86e..0ef2612 100644
--- a/Source/cmGhsMultiTargetGenerator.cxx
+++ b/Source/cmGhsMultiTargetGenerator.cxx
@@ -18,7 +18,6 @@
 #include "cmSourceFile.h"
 #include "cmTarget.h"
 #include <assert.h>
-#include <cmAlgorithms.h>
 
 std::string const cmGhsMultiTargetGenerator::DDOption("-dynamic");
 
@@ -470,16 +469,11 @@ cmGhsMultiTargetGenerator::GetObjectNames(
     std::string const longestObjectDirectory(
       cmGhsMultiTargetGenerator::ComputeLongestObjectDirectory(
         localGhsMultiGenerator, generatorTarget, *sf));
-    std::string fullFilename = (*sf)->GetFullPath();
-    bool const ObjPathFound = cmLocalGeneratorCheckObjectName(
-      fullFilename, longestObjectDirectory.size(), MAX_FULL_PATH_LENGTH);
-    if (!ObjPathFound) {
-      cmSystemTools::Error("Object path \"", fullFilename.c_str(),
-                           "\" too long", "");
-    }
-    cmsys::SystemTools::ReplaceString(fullFilename, ":/", "_");
-    cmsys::SystemTools::ReplaceString(fullFilename, "/", "_");
-    objectNamesCorrected[*sf] = fullFilename;
+    std::string objFilenameName =
+      localGhsMultiGenerator->GetObjectFileNameWithoutTarget(
+        **sf, longestObjectDirectory);
+    cmsys::SystemTools::ReplaceString(objFilenameName, "/", "_");
+    objectNamesCorrected[*sf] = objFilenameName;
   }
 
   return objectNamesCorrected;
@@ -517,8 +511,7 @@ void cmGhsMultiTargetGenerator::WriteSources(
       this->WriteObjectLangOverride(this->FolderBuildStreams[sgPath], (*si));
       if (objectNames.end() != objectNames.find(*si)) {
         *this->FolderBuildStreams[sgPath]
-          << "    -o \"" << objectNames.find(*si)->second << ".o\""
-          << std::endl;
+          << "    -o \"" << objectNames.find(*si)->second << "\"" << std::endl;
       }
 
       this->WriteObjectDir(this->FolderBuildStreams[sgPath],
diff --git a/Tests/GhsMultiDuplicateSourceFilenames/CMakeLists.txt b/Tests/GhsMultiDuplicateSourceFilenames/CMakeLists.txt
index ffdb582..82a014b 100644
--- a/Tests/GhsMultiDuplicateSourceFilenames/CMakeLists.txt
+++ b/Tests/GhsMultiDuplicateSourceFilenames/CMakeLists.txt
@@ -1,7 +1,12 @@
 cmake_minimum_required(VERSION 3.5)
 project(demo C)
 
-add_library(libdemo test.c subfolder/test.c)
+add_library(libdemo
+  test.c
+  subfolder_test.c
+  subfolder_test_0.c
+  "subfolder/test.c"
+)
 
 add_executable(demo main.c)
 target_link_libraries(demo libdemo)
diff --git a/Tests/GhsMultiDuplicateSourceFilenames/main.c b/Tests/GhsMultiDuplicateSourceFilenames/main.c
index 301a32e..d5b7914 100644
--- a/Tests/GhsMultiDuplicateSourceFilenames/main.c
+++ b/Tests/GhsMultiDuplicateSourceFilenames/main.c
@@ -1,9 +1,13 @@
 int test_a(void);
 int test_b(void);
+int test_c(void);
+int test_d(void);
 
 int main(int argc, char* argv[])
 {
   test_a();
   test_b();
+  test_c();
+  test_d();
   return 0;
 }
diff --git a/Tests/GhsMultiDuplicateSourceFilenames/subfolder_test.c b/Tests/GhsMultiDuplicateSourceFilenames/subfolder_test.c
new file mode 100644
index 0000000..c552e6a
--- /dev/null
+++ b/Tests/GhsMultiDuplicateSourceFilenames/subfolder_test.c
@@ -0,0 +1,5 @@
+
+int test_c()
+{
+  return 1;
+}
diff --git a/Tests/GhsMultiDuplicateSourceFilenames/subfolder_test_0.c b/Tests/GhsMultiDuplicateSourceFilenames/subfolder_test_0.c
new file mode 100644
index 0000000..170b33d
--- /dev/null
+++ b/Tests/GhsMultiDuplicateSourceFilenames/subfolder_test_0.c
@@ -0,0 +1,5 @@
+
+int test_d()
+{
+  return 1;
+}

-----------------------------------------------------------------------

Summary of changes:
 Modules/Compiler/GHS-C.cmake                        |    1 +
 Modules/Compiler/GHS-CXX.cmake                      |    1 +
 Source/cmGhsMultiTargetGenerator.cxx                |   19 ++++++-------------
 .../GhsMultiDuplicateSourceFilenames/CMakeLists.txt |    7 ++++++-
 Tests/GhsMultiDuplicateSourceFilenames/main.c       |    4 ++++
 .../{test.c => subfolder_test.c}                    |    2 +-
 .../{test.c => subfolder_test_0.c}                  |    2 +-
 7 files changed, 20 insertions(+), 16 deletions(-)
 copy Tests/GhsMultiDuplicateSourceFilenames/{test.c => subfolder_test.c} (56%)
 copy Tests/GhsMultiDuplicateSourceFilenames/{test.c => subfolder_test_0.c} (56%)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list