[cmake-commits] king committed CMakeLists.txt 1.52 1.53 complex.cxx
1.85 1.86
cmake-commits at cmake.org
cmake-commits at cmake.org
Fri Sep 15 14:31:26 EDT 2006
Update of /cvsroot/CMake/CMake/Tests/Complex/Executable
In directory public:/mounts/ram/cvs-serv10478/Executable
Modified Files:
CMakeLists.txt complex.cxx
Log Message:
ENH: Added test for linking to a static library that is next to a shared library. See bug#1644 for related changes.
Index: CMakeLists.txt
===================================================================
RCS file: /cvsroot/CMake/CMake/Tests/Complex/Executable/CMakeLists.txt,v
retrieving revision 1.52
retrieving revision 1.53
diff -u -d -r1.52 -r1.53
--- CMakeLists.txt 3 Aug 2006 13:26:36 -0000 1.52
+++ CMakeLists.txt 15 Sep 2006 18:31:21 -0000 1.53
@@ -37,6 +37,12 @@
ENDIF(NOT BORLAND)
ENDIF (UNIX)
+# Test linking to static lib when a shared lib has the same name.
+IF(CMAKE_EXE_LINK_STATIC_CXX_FLAGS)
+ ADD_DEFINITIONS(-DCOMPLEX_TEST_LINK_STATIC)
+ TARGET_LINK_LIBRARIES(complex CMakeTestLinkStatic)
+ENDIF(CMAKE_EXE_LINK_STATIC_CXX_FLAGS)
+
# can we get the path to a source file
GET_SOURCE_FILE_PROPERTY(A_LOCATION A.cxx LOCATION)
IF ("${A_LOCATION}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}/A.cxx")
Index: complex.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Tests/Complex/Executable/complex.cxx,v
retrieving revision 1.85
retrieving revision 1.86
diff -u -d -r1.85 -r1.86
--- complex.cxx 23 May 2006 16:51:26 -0000 1.85
+++ complex.cxx 15 Sep 2006 18:31:21 -0000 1.86
@@ -23,6 +23,12 @@
#include <string.h>
#endif
+#ifdef COMPLEX_TEST_LINK_STATIC
+extern "C"
+{
+ int TestLinkGetType();
+}
+#endif
int cm_passed = 0;
int cm_failed = 0;
@@ -1270,7 +1276,18 @@
// Test the generated file stream.
TestCMGeneratedFileSTream();
#endif
-
+
+#ifdef COMPLEX_TEST_LINK_STATIC
+ if(TestLinkGetType())
+ {
+ cmPassed("Link to static over shared worked.");
+ }
+ else
+ {
+ cmFailed("Link to static over shared failed.");
+ }
+#endif
+
// ----------------------------------------------------------------------
// Summary
More information about the Cmake-commits
mailing list