mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-06 05:40:54 -06:00
ENH: use separate vars for creating c++ and c shared libraries and add a test for c libraries
This commit is contained in:
@@ -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})
|
||||
|
||||
#
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user