From d84be37aaa335e57bb6fe7de6bf4be736652a60d Mon Sep 17 00:00:00 2001 From: Chun-wei Fan Date: Thu, 5 Mar 2020 16:01:13 +0800 Subject: build: Do not use gendef.exe for glibmm Clean up the build files a bit and update the glibmmconfig.h.[in|meson] so that we use __declspec(dllexport) when GLIBMM_BUILD is defined (i.e. during the build of glibmm) on Visual Studio. Also, for the meson builds, disable warnings 4251 and 4275 as they all relate to building DLLs regarding symbol export, which is harmless as we know clearly that we are indeed building DLLs in our case, and we have already set GLIBMM_API appropriately --- MSVC_NMake/build-rules-msvc.mak | 4 ++-- MSVC_NMake/config-msvc.mak | 2 +- MSVC_NMake/generate-msvc.mak | 3 --- 3 files changed, 3 insertions(+), 6 deletions(-) (limited to 'MSVC_NMake') diff --git a/MSVC_NMake/build-rules-msvc.mak b/MSVC_NMake/build-rules-msvc.mak index 1512a881..fc9db598 100644 --- a/MSVC_NMake/build-rules-msvc.mak +++ b/MSVC_NMake/build-rules-msvc.mak @@ -93,8 +93,8 @@ $** # $(dependent_objects) # << # @-if exist $@.manifest mt /manifest $@.manifest /outputresource:$@;2 -$(GLIBMM_DLL): vs$(VSVER)\$(CFG)\$(PLAT)\glibmm\glibmm.def $(glibmm_OBJS) - link /DLL $(LDFLAGS_NOLTCG) $(GOBJECT_LIBS) $(LIBSIGC_LIB) /implib:$(GLIBMM_LIB) /def:vs$(VSVER)\$(CFG)\$(PLAT)\glibmm\glibmm.def -out:$@ @<< +$(GLIBMM_DLL): vs$(VSVER)\$(CFG)\$(PLAT)\glibmm $(glibmm_OBJS) + link /DLL $(LDFLAGS_NOLTCG) $(GOBJECT_LIBS) $(LIBSIGC_LIB) /implib:$(GLIBMM_LIB) -out:$@ @<< $(glibmm_OBJS) << diff --git a/MSVC_NMake/config-msvc.mak b/MSVC_NMake/config-msvc.mak index 58f255fc..ddfcd772 100644 --- a/MSVC_NMake/config-msvc.mak +++ b/MSVC_NMake/config-msvc.mak @@ -26,7 +26,7 @@ GLIBMM_BASE_CFLAGS = \ /Ivs$(VSVER)\$(CFG)\$(PLAT) \ /I..\untracked\glib /I..\untracked\glib\glibmm \ /I..\glib /I..\glib\glibmm /I.\glibmm \ - /wd4530 /std:c++17 \ + /wd4530 /wd4251 /wd4275 /std:c++17 \ /FImsvc_recommended_pragmas.h GIOMM_BASE_CFLAGS = \ diff --git a/MSVC_NMake/generate-msvc.mak b/MSVC_NMake/generate-msvc.mak index 5c441523..978687ee 100644 --- a/MSVC_NMake/generate-msvc.mak +++ b/MSVC_NMake/generate-msvc.mak @@ -17,9 +17,6 @@ vs$(VSVER)\$(CFG)\$(PLAT)\glib-extra-defs-gen: @-md $@ # Generate .def files -vs$(VSVER)\$(CFG)\$(PLAT)\glibmm\glibmm.def: $(GENDEF) vs$(VSVER)\$(CFG)\$(PLAT)\glibmm $(glibmm_OBJS) - vs$(VSVER)\$(CFG)\$(PLAT)\gendef.exe $@ $(GLIBMM_LIBNAME) vs$(VSVER)\$(CFG)\$(PLAT)\glibmm\*.obj - vs$(VSVER)\$(CFG)\$(PLAT)\giomm\giomm.def: $(GENDEF) vs$(VSVER)\$(CFG)\$(PLAT)\giomm $(giomm_OBJS) vs$(VSVER)\$(CFG)\$(PLAT)\gendef.exe $@ $(GIOMM_LIBNAME) vs$(VSVER)\$(CFG)\$(PLAT)\giomm\*.obj -- cgit v1.2.1