[Cmake-commits] [cmake-commits] king committed CMakeLists.txt 1.18 1.19 testLib6.c NONE 1.1 testLib6.cxx NONE 1.1

cmake-commits at cmake.org cmake-commits at cmake.org
Sat Jul 11 10:10:53 EDT 2009


Update of /cvsroot/CMake/CMake/Tests/ExportImport/Export
In directory public:/mounts/ram/cvs-serv18572/Tests/ExportImport/Export

Modified Files:
	CMakeLists.txt 
Added Files:
	testLib6.c testLib6.cxx 
Log Message:
ENH: Test export/import of link interface languages

This extends the ExportImport test.  The Export project creates a C++
static library and exports it.  Then the Import project links the
library into a C executable.  On most platforms the executable will link
only if the C++ linker is chosen correctly.


Index: CMakeLists.txt
===================================================================
RCS file: /cvsroot/CMake/CMake/Tests/ExportImport/Export/CMakeLists.txt,v
retrieving revision 1.18
retrieving revision 1.19
diff -C 2 -d -r1.18 -r1.19
*** CMakeLists.txt	8 Jul 2009 15:41:25 -0000	1.18
--- CMakeLists.txt	11 Jul 2009 14:10:49 -0000	1.19
***************
*** 1,4 ****
! cmake_minimum_required (VERSION 2.6)
! project(Export C)
  
  # Pretend that RelWithDebInfo should link to debug libraries to test
--- 1,4 ----
! cmake_minimum_required (VERSION 2.7.20090711)
! project(Export C CXX)
  
  # Pretend that RelWithDebInfo should link to debug libraries to test
***************
*** 46,49 ****
--- 46,51 ----
  add_library(testLib5 SHARED testLib5.c)
  
+ add_library(testLib6 STATIC testLib6.cxx testLib6.c)
+ 
  # Work-around: Visual Studio 6 does not support per-target object files.
  set(VS6)
***************
*** 77,80 ****
--- 79,83 ----
    testExe1 testLib1 testLib2 testExe2 testLib3 testLib4 testExe3
    testExe2lib testLib4lib testLib4libdbg testLib4libopt
+   testLib6
    EXPORT exp
    RUNTIME DESTINATION bin
***************
*** 112,116 ****
    FILE ExportBuildTree.cmake
    )
! export(TARGETS testExe2 testLib4 testLib5 testExe3 testExe2lib
    testLib4lib testLib4libdbg testLib4libopt
    NAMESPACE bld_
--- 115,119 ----
    FILE ExportBuildTree.cmake
    )
! export(TARGETS testExe2 testLib4 testLib5 testLib6 testExe3 testExe2lib
    testLib4lib testLib4libdbg testLib4libopt
    NAMESPACE bld_

--- NEW FILE: testLib6.c ---
extern int testLib6cxx(void);
int testLib6(void)
{
  return testLib6cxx();
}

--- NEW FILE: testLib6.cxx ---
extern "C" int testLib6cxx(void)
{
  // Reference C++ standard library symbols.
  delete new int;
  return 0;
}



More information about the Cmake-commits mailing list