-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support for compiling as shared lib (#239)
* update configure and src/Makefile to support shared-library option
- Loading branch information
Showing
5 changed files
with
87 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,33 @@ | ||
#ifndef ZSV_EXPORT_H | ||
#define ZSV_EXPORT_H | ||
|
||
// clang-format off | ||
#ifdef __EMSCRIPTEN__ | ||
#include <emscripten.h> | ||
#define ZSV_EXPORT EMSCRIPTEN_KEEPALIVE | ||
# include <emscripten.h> | ||
# define ZSV_EXPORT EMSCRIPTEN_KEEPALIVE | ||
#else | ||
#define ZSV_EXPORT | ||
# ifdef ZSV_BUILD_SHARED | ||
# if defined(_WIN32) || defined(__CYGWIN__) | ||
# ifdef __GNUC__ | ||
# define ZSV_EXPORT __attribute__((dllexport)) | ||
# else | ||
# define ZSV_EXPORT __declspec(dllexport) | ||
# endif | ||
# else | ||
# ifdef __GNUC__ | ||
# define ZSV_EXPORT __attribute__((dllimport)) | ||
# else | ||
# define ZSV_EXPORT __declspec(dllimport) | ||
# endif | ||
# endif | ||
# else | ||
# if __GNUC__ >= 4 | ||
# define ZSV_EXPORT __attribute__((visibility("default"))) | ||
# else | ||
# define ZSV_EXPORT | ||
# endif | ||
# endif | ||
#endif | ||
// clang-format on | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
ifeq ($(OS),Windows_NT) | ||
WIN=1 | ||
endif | ||
|
||
ifeq ($(WIN),1) | ||
SHAREDLIB_EXT:=dll | ||
else | ||
UNAME_S := $(shell uname -s) | ||
ifeq ($(UNAME_S),Linux) | ||
SHAREDLIB_EXT := so | ||
endif | ||
ifeq ($(UNAME_S),Darwin) | ||
SHAREDLIB_EXT := dylib | ||
endif | ||
endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters