Support for -fvisibility=hidden and -fvisibility=default
Djinni supports both the -fvisibility=hidden and the -fvisibility=default flags.
The symbols that are belonging to the public interfaces that are generated by Djinni are automatically defined to be visible symbols.
To achieve this Djinni is marking the generated code with PROJECT_EXPORT.
PROJECT_EXPORT is defined in support-lib/djinni_common.hpp.
This macro is using the correct attribute specifier for the actual compiler. For more details, please check the macro definition in the support-lib/djinni_common.hpp header.
This PROJECT_EXPORT does nothing in case if you are using the -fvisibility=default compiler flag.
This PROJECT_EXPORT in case if you are using the -fvisibility=default compiler flag.
Since the generated headers are including this support-lib/djinni_common.hpp, you must distribute it together with your library that is using Djinni.
Windows
For Windows builds, you must define BUILDING_DLL based on your needs.
You can define it as a compiler option like -DBUILDING_DLL.
For more details, please check the macro definition in the support-lib/djinni_common.hpp header.
I quote the updated README.md here :
Support for
-fvisibility=hidden
and-fvisibility=default
Djinni supports both the
-fvisibility=hidden
and the-fvisibility=default
flags.The symbols that are belonging to the public interfaces that are generated by Djinni are automatically defined to be visible symbols. To achieve this Djinni is marking the generated code with
PROJECT_EXPORT
.PROJECT_EXPORT
is defined insupport-lib/djinni_common.hpp
. This macro is using the correct attribute specifier for the actual compiler. For more details, please check the macro definition in thesupport-lib/djinni_common.hpp
header. ThisPROJECT_EXPORT
does nothing in case if you are using the-fvisibility=default
compiler flag. ThisPROJECT_EXPORT
in case if you are using the-fvisibility=default
compiler flag.Since the generated headers are including this
support-lib/djinni_common.hpp
, you must distribute it together with your library that is using Djinni.Windows
For Windows builds, you must define
BUILDING_DLL
based on your needs. You can define it as a compiler option like-DBUILDING_DLL
. For more details, please check the macro definition in thesupport-lib/djinni_common.hpp
header.