[Cmake-commits] CMake branch, next, updated. v2.8.7-2457-g483d295

Brad King brad.king at kitware.com
Fri Feb 3 15:50:56 EST 2012


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  483d2959b87467a3d7435fa12403cd5491b95c02 (commit)
       via  749584509ee3155bb87e56a08ee538e4100a59d8 (commit)
      from  932b1c2e51eafa0cf0075f078079f6329056cc58 (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=483d2959b87467a3d7435fa12403cd5491b95c02
commit 483d2959b87467a3d7435fa12403cd5491b95c02
Merge: 932b1c2 7495845
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Fri Feb 3 15:50:50 2012 -0500
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Fri Feb 3 15:50:50 2012 -0500

    Merge topic 'lang-enable-order-issue-12929' into next
    
    7495845 Fix CXX/Fortran MODULE flags when enabled before C (#12929)


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=749584509ee3155bb87e56a08ee538e4100a59d8
commit 749584509ee3155bb87e56a08ee538e4100a59d8
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Fri Feb 3 10:36:26 2012 -0500
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Fri Feb 3 15:45:13 2012 -0500

    Fix CXX/Fortran MODULE flags when enabled before C (#12929)
    
    If CXX or Fortran is enabled before C then the values of
    
      CMAKE_SHARED_MODULE_C_FLAGS
      CMAKE_SHARED_MODULE_CREATE_C_FLAGS
    
    may not be available.  On platforms where MODULE library (plugin) creation
    is the same as SHARED library creation initialize the MODULE creation
    flags from the SHARED creation flags of the matching language instead of
    assuming that C has been enabled first.
    
    Teach the COnly and CxxOnly tests to build MODULE libraries.  The latter
    covers this specific case.

diff --git a/Modules/CMakeCXXInformation.cmake b/Modules/CMakeCXXInformation.cmake
index b97a69c..25abb8c 100644
--- a/Modules/CMakeCXXInformation.cmake
+++ b/Modules/CMakeCXXInformation.cmake
@@ -93,12 +93,6 @@ IF(CMAKE_USER_MAKE_RULES_OVERRIDE_CXX)
 ENDIF()
 
 
-# for most systems a module is the same as a shared library
-# so unless the variable CMAKE_MODULE_EXISTS is set just
-# copy the values from the LIBRARY variables
-IF(NOT CMAKE_MODULE_EXISTS)
-  SET(CMAKE_SHARED_MODULE_CXX_FLAGS ${CMAKE_SHARED_LIBRARY_CXX_FLAGS})
-ENDIF(NOT CMAKE_MODULE_EXISTS)
 # Create a set of shared library variable specific to C++
 # For 90% of the systems, these are the same flags as the C versions
 # so if these are not set just copy the flags from the c version
@@ -158,6 +152,14 @@ IF(NOT CMAKE_INCLUDE_FLAG_SEP_CXX)
   SET(CMAKE_INCLUDE_FLAG_SEP_CXX ${CMAKE_INCLUDE_FLAG_SEP_C})
 ENDIF(NOT CMAKE_INCLUDE_FLAG_SEP_CXX)
 
+# for most systems a module is the same as a shared library
+# so unless the variable CMAKE_MODULE_EXISTS is set just
+# copy the values from the LIBRARY variables
+IF(NOT CMAKE_MODULE_EXISTS)
+  SET(CMAKE_SHARED_MODULE_CXX_FLAGS ${CMAKE_SHARED_LIBRARY_CXX_FLAGS})
+  SET(CMAKE_SHARED_MODULE_CREATE_CXX_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS})
+ENDIF(NOT CMAKE_MODULE_EXISTS)
+
 # repeat for modules
 IF(NOT CMAKE_SHARED_MODULE_CREATE_CXX_FLAGS)
   SET(CMAKE_SHARED_MODULE_CREATE_CXX_FLAGS ${CMAKE_SHARED_MODULE_CREATE_C_FLAGS})
diff --git a/Modules/CMakeFortranInformation.cmake b/Modules/CMakeFortranInformation.cmake
index aed1fd2..76cf34e 100644
--- a/Modules/CMakeFortranInformation.cmake
+++ b/Modules/CMakeFortranInformation.cmake
@@ -109,6 +109,14 @@ IF(NOT DEFINED CMAKE_SHARED_LIBRARY_SONAME_Fortran_FLAG)
   SET(CMAKE_SHARED_LIBRARY_SONAME_Fortran_FLAG ${CMAKE_SHARED_LIBRARY_SONAME_C_FLAG})
 ENDIF()
 
+# for most systems a module is the same as a shared library
+# so unless the variable CMAKE_MODULE_EXISTS is set just
+# copy the values from the LIBRARY variables
+IF(NOT CMAKE_MODULE_EXISTS)
+  SET(CMAKE_SHARED_MODULE_Fortran_FLAGS ${CMAKE_SHARED_LIBRARY_Fortran_FLAGS})
+  SET(CMAKE_SHARED_MODULE_CREATE_Fortran_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS})
+ENDIF(NOT CMAKE_MODULE_EXISTS)
+
 # repeat for modules
 IF(NOT DEFINED CMAKE_SHARED_MODULE_CREATE_Fortran_FLAGS)
   SET(CMAKE_SHARED_MODULE_CREATE_Fortran_FLAGS ${CMAKE_SHARED_MODULE_CREATE_C_FLAGS})
diff --git a/Tests/COnly/CMakeLists.txt b/Tests/COnly/CMakeLists.txt
index 7742055..5ef0f1e 100644
--- a/Tests/COnly/CMakeLists.txt
+++ b/Tests/COnly/CMakeLists.txt
@@ -19,3 +19,5 @@ if("${LANG}" STREQUAL "C")
 else("${LANG}" STREQUAL "C")
   message(FATAL_ERROR "Bad language for file conly.c")
 endif("${LANG}" STREQUAL "C")
+
+add_library(testCModule MODULE testCModule.c)
diff --git a/Tests/COnly/testCModule.c b/Tests/COnly/testCModule.c
new file mode 100644
index 0000000..1a89292
--- /dev/null
+++ b/Tests/COnly/testCModule.c
@@ -0,0 +1,6 @@
+#ifdef _WIN32
+# define TEST_EXPORT __declspec(dllexport)
+#else
+# define TEST_EXPORT
+#endif
+TEST_EXPORT int testCModule(void) { return 0; }
diff --git a/Tests/CxxOnly/CMakeLists.txt b/Tests/CxxOnly/CMakeLists.txt
index 5d27890..e62f3c7 100644
--- a/Tests/CxxOnly/CMakeLists.txt
+++ b/Tests/CxxOnly/CMakeLists.txt
@@ -9,3 +9,5 @@ add_library(testcxx1.my STATIC libcxx1.cxx ${EXTRA_SRCS})
 add_library(testcxx2 SHARED libcxx2.cxx)
 add_executable (CxxOnly cxxonly.cxx)
 target_link_libraries(CxxOnly testcxx1.my testcxx2)
+
+add_library(testCxxModule MODULE testCxxModule.cxx)
diff --git a/Tests/CxxOnly/testCxxModule.cxx b/Tests/CxxOnly/testCxxModule.cxx
new file mode 100644
index 0000000..dd16d2b
--- /dev/null
+++ b/Tests/CxxOnly/testCxxModule.cxx
@@ -0,0 +1,6 @@
+#ifdef _WIN32
+# define TEST_EXPORT __declspec(dllexport)
+#else
+# define TEST_EXPORT
+#endif
+TEST_EXPORT int testCxxModule(void) { return 0; }

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

Summary of changes:
 Modules/CMakeCXXInformation.cmake     |   14 ++++++++------
 Modules/CMakeFortranInformation.cmake |    8 ++++++++
 Tests/COnly/CMakeLists.txt            |    2 ++
 Tests/COnly/testCModule.c             |    6 ++++++
 Tests/CxxOnly/CMakeLists.txt          |    2 ++
 Tests/CxxOnly/testCxxModule.cxx       |    6 ++++++
 6 files changed, 32 insertions(+), 6 deletions(-)
 create mode 100644 Tests/COnly/testCModule.c
 create mode 100644 Tests/CxxOnly/testCxxModule.cxx


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list