[Cmake-commits] CMake branch, next, updated. v3.3.0-rc2-697-g44560cf

Brad King brad.king at kitware.com
Fri Jun 26 09:44:32 EDT 2015


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  44560cfe22c12ea37199e698e8354904f9ec5811 (commit)
       via  60330aadeacaf101fc72c1c22015be8af7fd46fb (commit)
      from  954b488d95c741596e6102d6ed151be90d66c667 (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 -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=44560cfe22c12ea37199e698e8354904f9ec5811
commit 44560cfe22c12ea37199e698e8354904f9ec5811
Merge: 954b488 60330aa
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Fri Jun 26 09:44:31 2015 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Fri Jun 26 09:44:31 2015 -0400

    Merge topic 'vs-librarian-machine-flag-default' into next
    
    60330aad VS: Add /machine: flag to Librarian tool (#11240)


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=60330aadeacaf101fc72c1c22015be8af7fd46fb
commit 60330aadeacaf101fc72c1c22015be8af7fd46fb
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Fri Jun 26 09:38:35 2015 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Fri Jun 26 09:38:35 2015 -0400

    VS: Add /machine: flag to Librarian tool (#11240)
    
    If a Windows resource (.rc) source file is included in a STATIC library,
    the VS "link" tool will process the compiled ".res" file and needs to know
    the target architecture.  Add /machine: to the default static library
    flags to give the link tool the information it needs.

diff --git a/Modules/Platform/Windows-MSVC.cmake b/Modules/Platform/Windows-MSVC.cmake
index 13fe8bc..2537e39 100644
--- a/Modules/Platform/Windows-MSVC.cmake
+++ b/Modules/Platform/Windows-MSVC.cmake
@@ -230,6 +230,7 @@ elseif(MSVC_Fortran_ARCHITECTURE_ID)
   set(_MACHINE_ARCH_FLAG "/machine:${MSVC_Fortran_ARCHITECTURE_ID}")
 endif()
 set(CMAKE_EXE_LINKER_FLAGS_INIT "${CMAKE_EXE_LINKER_FLAGS_INIT} ${_MACHINE_ARCH_FLAG}")
+set(CMAKE_STATIC_LINKER_FLAGS_INIT "${CMAKE_STATIC_LINKER_FLAGS_INIT} ${_MACHINE_ARCH_FLAG}")
 unset(_MACHINE_ARCH_FLAG)
 
 # add /debug and /INCREMENTAL:YES to DEBUG and RELWITHDEBINFO also add pdbtype
diff --git a/Tests/VSResource/CMakeLists.txt b/Tests/VSResource/CMakeLists.txt
index 17eb041..3b9cfc3 100644
--- a/Tests/VSResource/CMakeLists.txt
+++ b/Tests/VSResource/CMakeLists.txt
@@ -46,7 +46,10 @@ else()
   include_directories(${CMAKE_CURRENT_BINARY_DIR})
 endif()
 
+add_library(ResourceLib STATIC lib.cpp lib.rc)
+
 add_executable(VSResource main.cpp test.rc)
+target_link_libraries(VSResource ResourceLib)
 
 set_property(TARGET VSResource
   PROPERTY VS_GLOBAL_CMakeTestVsGlobalVariable "test val")
diff --git a/Tests/VSResource/lib.cpp b/Tests/VSResource/lib.cpp
new file mode 100644
index 0000000..006e3e4
--- /dev/null
+++ b/Tests/VSResource/lib.cpp
@@ -0,0 +1 @@
+int lib() { return 0; }
diff --git a/Tests/VSResource/lib.rc b/Tests/VSResource/lib.rc
new file mode 100644
index 0000000..e69de29
diff --git a/Tests/VSResource/main.cpp b/Tests/VSResource/main.cpp
index 7ee0c74..ccf700c 100644
--- a/Tests/VSResource/main.cpp
+++ b/Tests/VSResource/main.cpp
@@ -1,6 +1,8 @@
 #include <windows.h>
 #include <stdio.h>
 
+extern int lib();
+
 struct x
 {
   const char *txt;
@@ -76,5 +78,5 @@ int main(int argc, char** argv)
       }
     }
 
-  return ret;
+  return ret + lib();
 }

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

Summary of changes:
 Modules/Platform/Windows-MSVC.cmake                            |    1 +
 Tests/VSResource/CMakeLists.txt                                |    3 +++
 Tests/VSResource/lib.cpp                                       |    1 +
 Modules/IntelVSImplicitPath/hello.f => Tests/VSResource/lib.rc |    0
 Tests/VSResource/main.cpp                                      |    4 +++-
 5 files changed, 8 insertions(+), 1 deletion(-)
 create mode 100644 Tests/VSResource/lib.cpp
 copy Modules/IntelVSImplicitPath/hello.f => Tests/VSResource/lib.rc (100%)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list