ENH: use separate vars for creating c++ and c shared libraries and add a test for c libraries

This commit is contained in:
Bill Hoffman
2002-04-08 13:36:18 -04:00
parent 7883b6c7dc
commit 65e3edea04
23 changed files with 301 additions and 54 deletions

View File

@@ -4,7 +4,7 @@
SET_SOURCE_FILES_PROPERTIES(complex
COMPILE_FLAGS "-DFILE_HAS_EXTRA_COMPILE_FLAGS")
ADD_EXECUTABLE(complex complex)
SET(COMPLEX_LIBS CMakeTestLibrary;CMakeTestLibraryShared)
SET(COMPLEX_LIBS CMakeTestLibrary;CMakeTestLibraryShared;CMakeTestCLibraryShared)
TARGET_LINK_LIBRARIES(complex ${COMPLEX_LIBS})
#

View File

@@ -2,6 +2,9 @@
#include "ExtraSources/file1.h"
#include "file2.h"
#include "sharedFile.h"
extern "C" {
#include "testConly.h"
}
#include "cmStandardIncludes.h"
#include "cmSystemTools.h"
@@ -103,6 +106,14 @@ int main()
{
cmPassed("Call to sharedFunction from shared library worked.");
}
if(CsharedFunction() != 1)
{
cmFailed("Call to C sharedFunction from shared library failed.");
}
else
{
cmPassed("Call to C sharedFunction from shared library worked.");
}
if(file1() != 1)
{