diff options
author | Chun-wei Fan <fanchunwei@src.gnome.org> | 2018-07-25 18:12:34 +0800 |
---|---|---|
committer | Behdad Esfahbod <behdad@behdad.org> | 2018-10-09 09:43:36 -0400 |
commit | 8e4ad1d7a0a35298ca04828ef1ef18b4c019ec03 (patch) | |
tree | d4ce8194737363b431f2fb2459d035f64ed07b1b /CMakeLists.txt | |
parent | e640f3a6b16f41cee5f7868ec738fda01244e96a (diff) |
builds: Fix and clean up MSVC DLL builds
Instead of passing a CFLAG/CXXFLAG to define HB_EXTERN, define it
directly in src/hb.hh as __declspec(dllexport) extern when we are
building HarfBuzz as DLLs on Visual Studio. Define HB_INTERNAL
as nothing without defining HB_NO_VISIBILITY when building HarfBuzz as
DLLs to avoid linker errors on Visual Studio builds.
Also "install" harfbuzz-subset.dll into $(PREFIX)\bin as the
hb-subset utility will depend on that DLL at runtime, when HarfBuzz is
built as DLLs. Since it consists of private APIs that are subject to
change, we do not install its headers nor .lib file.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 69496561..d97f7c26 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -574,7 +574,7 @@ if (HB_HAVE_GOBJECT) endif () if (BUILD_SHARED_LIBS AND WIN32 AND NOT MINGW) - add_definitions("-DHB_EXTERN=__declspec(dllexport) extern") + add_definitions("-DHB_DLL_EXPORT") endif () # On Windows, g-ir-scanner requires a DLL build in order for it to work @@ -772,6 +772,11 @@ if (NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL) DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/harfbuzz ) if (HB_BUILD_UTILS) + if (WIN32 AND BUILD_SHARED_LIBS) + install(TARGETS harfbuzz-subset + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + ) + endif () install(TARGETS hb-view RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) |