Skip to content

Commit 828a487

Browse files
author
Rick Weber
committed
Don't use dllimport/export for static linking
1 parent a6ed239 commit 828a487

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -547,6 +547,7 @@ if(SEAL_BUILD_SEAL_C)
547547
seal_set_version(sealc)
548548
if(SEAL_BUILD_STATIC_SEAL_C)
549549
seal_set_version_filename(sealc)
550+
add_compile_definitions(SEAL_BUILD_STATIC_SEAL_C)
550551
else()
551552
seal_set_soversion(sealc)
552553
endif()

native/src/seal/c/defines.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,15 @@ static_assert(sizeof(std::size_t) == 8, "Require sizeof(std::size_t) == 8");
1919
static_assert(false, "Require architecture == x64");
2020
#endif
2121

22+
#ifdef SEAL_BUILD_STATIC_SEAL_C
23+
#define SEAL_C_DECOR extern "C"
24+
#else // SEAL_BUILD_STATIC_SEAL_C
2225
#if defined(SEAL_C_EXPORTS) || defined(seal_c_EXPORTS) || defined(sealc_EXPORTS)
2326
#define SEAL_C_DECOR extern "C" __declspec(dllexport)
2427
#else
2528
#define SEAL_C_DECOR extern "C" __declspec(dllimport)
2629
#endif
30+
#endif // SEAL_BUILD_STATIC_SEAL_C
2731

2832
#define SEAL_C_CALL __cdecl
2933

0 commit comments

Comments
 (0)