aboutsummaryrefslogtreecommitdiff
path: root/ports/sqlite3/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'ports/sqlite3/CMakeLists.txt')
-rw-r--r--ports/sqlite3/CMakeLists.txt8
1 files changed, 7 insertions, 1 deletions
diff --git a/ports/sqlite3/CMakeLists.txt b/ports/sqlite3/CMakeLists.txt
index a2f0aeb03..16f529daf 100644
--- a/ports/sqlite3/CMakeLists.txt
+++ b/ports/sqlite3/CMakeLists.txt
@@ -3,7 +3,13 @@ project(sqlite3 C)
include_directories(.)
if(BUILD_SHARED_LIBS)
- set(API "-DSQLITE_API=__declspec(dllexport)")
+ if(CMAKE_SYSTEM_NAME MATCHES "Linux" OR CMAKE_SYSTEM_NAME MATCHES "Darwin")
+ set(API "-DSQLITE_API=__attribute__((visibility(\"default\")))")
+ elseif(CMAKE_SYSTEM_NAME MATCHES "Windows")
+ set(API "-DSQLITE_API=__declspec(dllexport)")
+ else()
+ message(FATAL_ERROR "Unsupported platform: ${CMAKE_SYSTEM_NAME}")
+ endif()
else()
set(API "-DSQLITE_API=extern")
endif()