CMake/Tests/ObjectLibrary/c.c
Brad King 69d3d1835c Test OBJECT library success cases
Add "ObjectLibrary" test to build and use OBJECT libraries.  Build
multiple object libraries in separate directories with different flags.
Use a custom command to generate a source file in one OBJECT library.

Reference the OBJECT libraries for inclusion in a STATIC library, a
SHARED library, and an EXECUTABLE target.  Use the static and shared
libraries each in executables that end up using the object library
symbols.  Verify that object library symbols are exported from the
shared library.
2012-03-16 10:12:30 -04:00

20 lines
290 B
C

#if defined(_WIN32) && defined(Cshared_EXPORTS)
# define EXPORT_C __declspec(dllexport)
#else
# define EXPORT_C
#endif
extern int a1(void);
extern int a2(void);
extern int b1(void);
extern int b2(void);
EXPORT_C int c(void)
{
return 0
+ a1()
+ a2()
+ b1()
+ b2()
;
}