Skip to content

Commit

Permalink
[glibmm] Reintroduce CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS (microsoft#6550)
Browse files Browse the repository at this point in the history
(partially reverts change discussed in microsoft#5937)
  • Loading branch information
NNemec committed May 25, 2019
1 parent 36babc4 commit aaae648
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
5 changes: 5 additions & 0 deletions ports/glibmm/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ if(APPLE)
link_libraries(${COREFOUNDATION_LIBRARY} ${CORESERVICES_LIBRARY} ${FOUNDATION_LIBRARY})
endif()

# A hacky solution for building Windows DLLs from sources ported from Linux.
# The cleaner approach would be to manually add __declspec(dllexport) to all public symbols in the header files or
# construct a .def file.
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS TRUE)

if(BUILD_SHARED_LIBS)
add_definitions(-DGLIBMM_DLL -DGIOMM_DLL)
else()
Expand Down
8 changes: 4 additions & 4 deletions ports/glibmm/CONTROL
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Source: glibmm
Version: 2.52.1-8
Description: This is glibmm, a C++ API for parts of glib that are useful for C++. See http://www.gtkmm.org.
Build-Depends: zlib, pcre, libffi, gettext, libiconv, glib, libsigcpp
Source: glibmm
Version: 2.52.1-9
Description: This is glibmm, a C++ API for parts of glib that are useful for C++. See http://www.gtkmm.org.
Build-Depends: zlib, pcre, libffi, gettext, libiconv, glib, libsigcpp
5 changes: 4 additions & 1 deletion ports/glibmm/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ if (VCPKG_CMAKE_SYSTEM_NAME STREQUAL WindowsStore)
message(FATAL_ERROR "Error: UWP builds are currently not supported.")
endif()

vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
# This library itself would would as static library, but it is used by gtkmm, atkmm & pangomm which are all set to ONLY_DYNAMIC LIBRARY
# Having multiple dynamic libaries linking the same static library causes multiple copies of its static data to be present in the executable
# leading to confusing and hard-to-debug runtime effects.
vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY)

set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/glibmm-2.52.1)
vcpkg_download_distfile(ARCHIVE
Expand Down

0 comments on commit aaae648

Please sign in to comment.