mirror of
https://github.com/reactos/CMake.git
synced 2024-11-25 20:49:41 +00:00
69d3d1835c
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.
17 lines
269 B
C
17 lines
269 B
C
#if defined(_WIN32) && defined(SHARED_C)
|
|
# define IMPORT_C __declspec(dllimport)
|
|
#else
|
|
# define IMPORT_C
|
|
#endif
|
|
extern IMPORT_C int b1(void);
|
|
extern IMPORT_C int b2(void);
|
|
extern IMPORT_C int c(void);
|
|
int main(void)
|
|
{
|
|
return 0
|
|
+ c()
|
|
+ b1()
|
|
+ b2()
|
|
;
|
|
}
|