From: Tim-Philipp Müller Date: Fri, 18 May 2018 08:10:17 +0000 (+0100) Subject: orc: fix static build on windows X-Git-Tag: orc-0.4.33~165 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cc3331599a777e475baf53cd4ff2efc63c747ef9;p=platform%2Fupstream%2Forc.git orc: fix static build on windows Orc users mustn't use __declspec(dllimport) when linking against a static liborc. --- diff --git a/orc/meson.build b/orc/meson.build index 541603f..e629f05 100644 --- a/orc/meson.build +++ b/orc/meson.build @@ -118,12 +118,15 @@ orc_sta = static_library ('orc-' + orc_api, if get_option('default_library') == 'static' orc_lib = orc_sta + orc_dep_cargs = ['-DORC_STATIC_COMPILATION'] else orc_lib = orc_shr + orc_dep_cargs = [] endif orc_dep = declare_dependency(include_directories : orc_inc, dependencies : orc_dependencies, + compile_args : orc_dep_cargs, link_with : orc_lib) executable ('generate-bytecode', diff --git a/orc/orcutils.h b/orc/orcutils.h index 9713d6f..dd73ea5 100644 --- a/orc/orcutils.h +++ b/orc/orcutils.h @@ -202,7 +202,7 @@ typedef unsigned int orc_bool; /* FIXME: unused, remove */ #define ORC_EXPORT -#if defined(_MSC_VER) || defined(_WIN32) +#if (defined(_MSC_VER) || defined(_WIN32)) && !defined(ORC_STATIC_COMPILATION) #define ORC_API_IMPORT __declspec(dllimport) extern #else #define ORC_API_IMPORT extern