forked from GitHub/gf-core
define COMPILING_STATIC_PGF for MSVC
This commit is contained in:
@@ -12,6 +12,9 @@
|
|||||||
#if defined(COMPILING_PGF)
|
#if defined(COMPILING_PGF)
|
||||||
#define PGF_API_DECL EXTERN_C __declspec(dllexport)
|
#define PGF_API_DECL EXTERN_C __declspec(dllexport)
|
||||||
#define PGF_API EXTERN_C __declspec(dllexport)
|
#define PGF_API EXTERN_C __declspec(dllexport)
|
||||||
|
#elif defined(COMPILING_STATIC_PGF)
|
||||||
|
#define PGF_API_DECL
|
||||||
|
#define PGF_API
|
||||||
#else
|
#else
|
||||||
#define PGF_API_DECL __declspec(dllimport)
|
#define PGF_API_DECL __declspec(dllimport)
|
||||||
#define PGF_API ERROR_NOT_COMPILING_LIBPGF
|
#define PGF_API ERROR_NOT_COMPILING_LIBPGF
|
||||||
@@ -68,6 +71,7 @@ typedef enum {
|
|||||||
PGF_EXN_NONE,
|
PGF_EXN_NONE,
|
||||||
PGF_EXN_SYSTEM_ERROR,
|
PGF_EXN_SYSTEM_ERROR,
|
||||||
PGF_EXN_PGF_ERROR,
|
PGF_EXN_PGF_ERROR,
|
||||||
|
PGF_EXN_TYPE_ERROR,
|
||||||
PGF_EXN_OTHER_ERROR
|
PGF_EXN_OTHER_ERROR
|
||||||
} PgfExnType;
|
} PgfExnType;
|
||||||
|
|
||||||
@@ -474,10 +478,10 @@ PGF_API_DECL
|
|||||||
void pgf_release_phrasetable_ids(PgfPhrasetableIds *seq_ids);
|
void pgf_release_phrasetable_ids(PgfPhrasetableIds *seq_ids);
|
||||||
|
|
||||||
PGF_API_DECL
|
PGF_API_DECL
|
||||||
void pgf_check_expr(PgfDB *db, PgfRevision revision,
|
PgfExpr pgf_check_expr(PgfDB *db, PgfRevision revision,
|
||||||
PgfExpr* pe, PgfType ty,
|
PgfExpr e, PgfType ty,
|
||||||
PgfMarshaller *m, PgfUnmarshaller *u,
|
PgfMarshaller *m, PgfUnmarshaller *u,
|
||||||
PgfExn *err);
|
PgfExn *err);
|
||||||
|
|
||||||
PGF_API_DECL
|
PGF_API_DECL
|
||||||
PgfType pgf_infer_expr(PgfDB *db, PgfRevision revision,
|
PgfType pgf_infer_expr(PgfDB *db, PgfRevision revision,
|
||||||
@@ -486,10 +490,10 @@ PgfType pgf_infer_expr(PgfDB *db, PgfRevision revision,
|
|||||||
PgfExn *err);
|
PgfExn *err);
|
||||||
|
|
||||||
PGF_API_DECL
|
PGF_API_DECL
|
||||||
void pgf_check_type(PgfDB *db, PgfRevision revision,
|
PgfType pgf_check_type(PgfDB *db, PgfRevision revision,
|
||||||
PgfType* pty,
|
PgfType ty,
|
||||||
PgfMarshaller *m, PgfUnmarshaller *u,
|
PgfMarshaller *m, PgfUnmarshaller *u,
|
||||||
PgfExn *err);
|
PgfExn *err);
|
||||||
|
|
||||||
PGF_API_DECL
|
PGF_API_DECL
|
||||||
PgfRevision pgf_start_transaction(PgfDB *db, PgfExn *err);
|
PgfRevision pgf_start_transaction(PgfDB *db, PgfExn *err);
|
||||||
|
|||||||
@@ -15,8 +15,10 @@ if on_windows:
|
|||||||
cpath = '../c/pgf/'
|
cpath = '../c/pgf/'
|
||||||
extra_sources = [cpath+f for f in os.listdir(cpath) if f.endswith('.cxx')]
|
extra_sources = [cpath+f for f in os.listdir(cpath) if f.endswith('.cxx')]
|
||||||
includes+=["../c"]
|
includes+=["../c"]
|
||||||
|
flags = ['/DCOMPILING_STATIC_PGF=1']
|
||||||
else:
|
else:
|
||||||
extra_sources = []
|
extra_sources = []
|
||||||
|
flags = ['-std=c99', '-Werror', '-Wno-error=unused-variable', '-Wno-comment']
|
||||||
|
|
||||||
pgf_module = Extension(
|
pgf_module = Extension(
|
||||||
'pgf',
|
'pgf',
|
||||||
@@ -26,7 +28,7 @@ pgf_module = Extension(
|
|||||||
'ffi.c',
|
'ffi.c',
|
||||||
'transactions.c'
|
'transactions.c'
|
||||||
]+extra_sources,
|
]+extra_sources,
|
||||||
extra_compile_args = [] if on_windows else ['-std=c99', '-Werror', '-Wno-error=unused-variable', '-Wno-comment'],
|
extra_compile_args = flags,
|
||||||
include_dirs = includes,
|
include_dirs = includes,
|
||||||
library_dirs = libraries,
|
library_dirs = libraries,
|
||||||
libraries = [] if on_windows else ['pgf'])
|
libraries = [] if on_windows else ['pgf'])
|
||||||
|
|||||||
Reference in New Issue
Block a user