windows: expose public APIs with dllimport for user apps

This commit is contained in:
Nguyen Anh Quynh 2014-06-03 23:10:07 +08:00
parent 0ea020ec8f
commit 1969b83b9b
2 changed files with 4 additions and 1 deletions

View File

@ -150,6 +150,7 @@ endif ()
include_directories("${PROJECT_SOURCE_DIR}/include")
if (BUILD_STATIC)
add_definitions(-DCAPSTONE_STATIC)
add_library(capstone STATIC ${SOURCES})
else ()
add_definitions(-DCAPSTONE_SHARED)

View File

@ -20,8 +20,10 @@ extern "C" {
#pragma warning(disable:4100)
#ifdef CAPSTONE_SHARED // compiling DLL file
#define CAPSTONE_EXPORT __declspec(dllexport)
#else
#elif defined(CAPSTONE_STATIC)
#define CAPSTONE_EXPORT
#else // code uses our DLL
#define CAPSTONE_EXPORT __declspec(dllimport)
#endif
#else // not MSVC
#define CAPSTONE_EXPORT