From 869e648f550d844d9fd9fa2eda05e1ca15745a14 Mon Sep 17 00:00:00 2001 From: Chun-wei Fan Date: Mon, 23 Sep 2024 17:46:59 +0800 Subject: [PATCH] NMake builds: Embed UAC manifest for dom_update_namespace ...if a 32-bit Windows build is being carried out. This will prevent UAC from interfering when the test program is run, as any 32-bit Windows executable with 'update' in its filename will trigger an UAC prompt which will get into our way. --- MSVC_NMake/build-rules-msvc.mak | 4 ++++ MSVC_NMake/config-msvc.mak | 6 ++++++ MSVC_NMake/create-lists-msvc.mak | 2 +- MSVC_NMake/generate-msvc.mak | 14 ++++++++++++++ 4 files changed, 25 insertions(+), 1 deletion(-) diff --git a/MSVC_NMake/build-rules-msvc.mak b/MSVC_NMake/build-rules-msvc.mak index 5df66ee4..1864476a 100644 --- a/MSVC_NMake/build-rules-msvc.mak +++ b/MSVC_NMake/build-rules-msvc.mak @@ -77,8 +77,12 @@ $(libxmlxx_OBJS) # $(dependent_objects) # << # @-if exist $@.manifest mt /manifest $@.manifest /outputresource:$@;1 +vs$(VSVER)\$(CFG)\$(PLAT)\dom_update_namespace.exe: $(LIBXMLXX_LIB) $(dom_update_namespace_OBJS) $(DOM_UPDATE_NAMESPACE_MANIFEST) + link $(LDFLAGS) $(dom_update_namespace_OBJS) $(LIBXMLXX_LIB) $(GLIBMM_LIB) $(LIBSIGC_LIB) $(GOBJECT_LIBS) $(LIBXML2_LIBS) /out:$@ + @if not "$(DOM_UPDATE_NAMESPACE_MANIFEST)" == "" mt /manifest $@.manifest /outputresource:$@;1 clean: + @-del /f /q vs$(VSVER)\$(CFG)\$(PLAT)\*.exe.manifest @-del /f /q vs$(VSVER)\$(CFG)\$(PLAT)\*.exe @-del /f /q vs$(VSVER)\$(CFG)\$(PLAT)\*.dll @-del /f /q vs$(VSVER)\$(CFG)\$(PLAT)\*.pdb diff --git a/MSVC_NMake/config-msvc.mak b/MSVC_NMake/config-msvc.mak index 5c807bb8..18863f52 100644 --- a/MSVC_NMake/config-msvc.mak +++ b/MSVC_NMake/config-msvc.mak @@ -79,3 +79,9 @@ LIBXMLXX_LIB = vs$(VSVER)\$(CFG)\$(PLAT)\$(LIBXMLXX_LIBNAME).lib LIBXML2_LIBS = libxml2.lib GOBJECT_LIBS = gobject-2.0.lib gmodule-2.0.lib glib-2.0.lib + +!if "$(PLAT)" == "Win32" +DOM_UPDATE_NAMESPACE_MANIFEST = vs$(VSVER)\$(CFG)\$(PLAT)\dom_update_namespace.exe.manifest +!else +DOM_UPDATE_NAMESPACE_MANIFEST = +!endif diff --git a/MSVC_NMake/create-lists-msvc.mak b/MSVC_NMake/create-lists-msvc.mak index fa529cb9..5e852c4d 100644 --- a/MSVC_NMake/create-lists-msvc.mak +++ b/MSVC_NMake/create-lists-msvc.mak @@ -74,7 +74,7 @@ NULL= !if [echo vs^$(VSVER)\^$(CFG)\^$(PLAT)\libxmlxx-examples\testutilities.obj: ..\examples\testutilities.cc>>libxmlxx.mak & @echo. if not exist ^$(@D)\ md ^$(@D)>>libxmlxx.mak & @echo. ^$(CXX) ^$(LIBXMLXX_EX_CFLAGS) ^$(CFLAGS) /Fo^$(@D)\ /Fd^$(@D)\ ^$** /c>>libxmlxx.mak & @echo.>>libxmlxx.mak] !endif -!if [for %d in (examples tests) do @for /f %t in ('dir /ad /b ..\%d') do @echo vs^$(VSVER)\^$(CFG)\^$(PLAT)\%t.exe: ^$(LIBXMLXX_LIB) ^$(%t_OBJS)>>libxmlxx.mak & @echo. link ^$(LDFLAGS) ^$** ^$(GLIBMM_LIB) ^$(LIBXML2_LIBS) ^$(GOBJECT_LIBS) ^$(LIBSIGC_LIB) /out:^$@>>libxmlxx.mak & @echo.>>libxmlxx.mak] +!if [for %d in (examples tests) do @for /f %t in ('dir /ad /b ..\%d') do @if not "%t" == "dom_update_namespace" echo vs^$(VSVER)\^$(CFG)\^$(PLAT)\%t.exe: ^$(LIBXMLXX_LIB) ^$(%t_OBJS)>>libxmlxx.mak & @echo. link ^$(LDFLAGS) ^$** ^$(GLIBMM_LIB) ^$(LIBXML2_LIBS) ^$(GOBJECT_LIBS) ^$(LIBSIGC_LIB) /out:^$@>>libxmlxx.mak & @echo.>>libxmlxx.mak] !endif !if [echo.>>libxmlxx.mak] diff --git a/MSVC_NMake/generate-msvc.mak b/MSVC_NMake/generate-msvc.mak index 80b6d741..ba28f0f2 100644 --- a/MSVC_NMake/generate-msvc.mak +++ b/MSVC_NMake/generate-msvc.mak @@ -44,3 +44,17 @@ pkg-ver.mak: ..\configure.ac @pkg-ver.bat @del ver.txt pkg-ver.bat $(MAKE) /f Makefile.vc CFG=$(CFG) GENERATE_VERSIONED_FILES=1 libxml++\libxml++.rc + +vs$(VSVER)\$(CFG)\$(PLAT)\dom_update_namespace.exe.manifest: + @echo Generating $@... + @echo ^>$@ + @echo ^>>$@ + @echo ^>>$@ + @echo ^>>$@ + @echo ^>>$@ + @echo ^>>$@ + @echo ^>>$@ + @echo ^>>$@ + @echo ^>>$@ + @echo ^>>$@ + @echo ^>>$@