Mercurial > dwindows
view makefile.vc @ 2819:a2fc275fa9bb
iOS: Fix major memory leaks when destroying widgets and windows.
More surely needs to be done regardig this, iOS doesn't destroy subviews as
expected when the parent is removed. I was expecting it to bring the
reference counts to 0 and starts destroying subviews... so I had to do this
manually. Boxes, ScrollBoxes, Spinbuttons and Comboboxes all now destroy
their subviews. Probably will need to do the same for splitbar, notebooks
and possibly others. However this stops the memory leak in Interface
Builder when recreating the interface. Also need to figure out why the
reference count is lower for DWButtons.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Tue, 02 Aug 2022 06:17:09 +0000 |
parents | 1660b4ecb92f |
children | 939fbceec13f |
line wrap: on
line source
# # Visual C Makefile for Dynamic Windows # !include Version VER = $(DW_MAJOR_VERSION)$(DW_MINOR_VERSION) VERDOT = $(DW_MAJOR_VERSION).$(DW_MINOR_VERSION) VERREV = 0 # Configure alternate compiler based on Clang/LLVM !if "$(CLANG)" == "Y" WLIB=llvm-lib.exe CC=clang-cl.exe LINK=lld-link.exe !else WLIB=lib.exe CC=cl.exe LINK=link.exe !endif # # Configure settings for the target platform # Default to x86 if not specified # !if "$(TARGET_CPU)" == "" !if "$(VSCMD_ARG_TGT_ARCH)" == "" !if "$(PLATFORM)" == "" TARGET_CPU=x86 !else TARGET_CPU=$(PLATFORM) !endif !else TARGET_CPU=$(VSCMD_ARG_TGT_ARCH) !endif !endif # # Setup the source and destination directories # !if "$(DWINDOWS_SRCDIR)" == "" SRCDIR=. !else SRCDIR=$(DWINDOWS_SRCDIR) !endif !if "$(DWLIBDIR)" == "" DWLIBDIR=$(SRCDIR) !endif !if "$(TARGET_CPU)" == "x86" PLATFORM_DEF = -DWIN32 PLATFORM_NAME = win32 !else PLATFORM_DEF = -DWIN64 PLATFORM_NAME = win64 !endif # # Settings for either debug or release # !if "$(DEBUG)" == "Y" CFLAGS_DEBUG = -DDEBUG -Z7 -W3 -Od -MTd # was -Zi LINK_DEBUG = -debug !else CFLAGS_DEBUG = -Ox -MT LINK_DEBUG = -release !endif # Check the SVN revision number if possible !if ![subwcrev . win\__SVN__.REV SVN.REV > NUL] !include SVN.REV !message Revision is [$(VERREV)] SVNVERSION=-DVER_REV=$(VERREV) !else # Check the Mercurial revision number if possible !if ![hg log -r . --template="VER_REV={rev}" > HG.REV] !include HG.REV !message Revision is [$(VER_REV)] SVNVERSION=-DVER_REV=$(VER_REV) !endif !endif # # Settings for supporting embedded Edge (Chromium) WebView2 # !if "$(WEBVIEW2DIR)" == "" WEBVIEW2DIR=$(SRCDIR)\packages\Microsoft.Web.WebView2 !endif !if exists($(WEBVIEW2DIR)\build\native\include\WebView2.h) WEBVIEW2INC=-DBUILD_EDGE -I$(WEBVIEW2DIR)\build\native\include !if exists($(WEBVIEW2DIR)\build\native\$(TARGET_CPU)\WebView2LoaderStatic.lib) WEBVIEW2LIB=$(WEBVIEW2DIR)\build\native\$(TARGET_CPU)\WebView2LoaderStatic.lib version.lib !else WEBVIEW2LIB=$(WEBVIEW2DIR)\build\native\$(TARGET_CPU)\WebView2Loader.dll.lib WEBVIEW2LOADER=$(WEBVIEW2DIR)\build\native\$(TARGET_CPU)\WebView2Loader.dll !endif WEBVIEW2OBJ=edge.obj !endif # # Settings for supporting WinToast notifications # !if "$(WINTOASTDIR)" == "" WINTOASTDIR=$(SRCDIR)\packages\WinToast !endif !if exists($(WINTOASTDIR)\src\wintoastlib.h) WINTOASTINC=-DBUILD_TOAST -I$(WINTOASTDIR)\src WINTOASTOBJ=wintoast.obj wintoastlib.obj !endif # The Visual C CRT and other Windows components have deprecated lots of common functions # These options will hide the deprecation warnings; Comment the next line to see them CRT_FLAGS = -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNING -D_WINSOCK_DEPRECATED_NO_WARNINGS CFLAGS = -c $(PLATFORM_DEF) -D__WIN32__ -DMSVC -DRICHEDIT -DTOOLBAR -DGDIPLUS -DAEROGLASS -D_UNICODE -DUNICODE -DBUILD_DLL -DISOLATION_AWARE_ENABLED=1 -I$(SRCDIR)\platform -I$(SRCDIR) $(WEBVIEW2INC) $(WINTOASTINC) $(SVNVERSION) $(CRT_FLAGS) LIBS = wsock32.lib kernel32.lib user32.lib comctl32.lib gdi32.lib advapi32.lib shell32.lib comdlg32.lib ole32.lib oleaut32.lib userenv.lib msimg32.lib gdiplus.lib $(WEBVIEW2LIB) RES = LINKFLAGS = -machine:$(TARGET_CPU) -manifest $(LINK_DEBUG) DLLLINKFLAGS = -dll DEFFILE = $(SRCDIR)\win\dw.def DEFFILE2 = $(SRCDIR)\win\dwcompat.def OBJS = dw.obj browser.obj XBrowseForFolder.obj $(WEBVIEW2OBJ) $(WINTOASTOBJ) OBJS2 = dwcompat.obj dirent.obj all: dw dwcompat dwtest clean: -erase *.dll -erase *.exe -erase *.opt -erase *.lib -erase *.obj -erase *.o -erase *.map -erase *.pdb -erase *.ilk -erase *.exp -erase *.REV -erase *~ distclean: clean -rd /s /q $(DWLIBDIR)\x86 -rd /s /q $(DWLIBDIR)\x64 -erase readme-win.txt dw: dw.dll dw.dll: $(OBJS) $(DEFFILE) $(LINK) @<< -out:$(@) -def:$(DEFFILE) $(LINKFLAGS) $(DLLLINKFLAGS) $(OBJS) $(RES) $(LIBS) << $(WLIB) -def:$(DEFFILE) -machine:$(TARGET_CPU) -out:dw.lib mt.exe -manifest dw.dll.manifest $(SRCDIR)\win\dw.dll.$(TARGET_CPU).manifest -outputresource:dw.dll;2 -erase dw.dll.manifest -md $(DWLIBDIR)\$(TARGET_CPU) copy dw.lib $(DWLIBDIR)\$(TARGET_CPU)\dw.lib copy dw.dll $(DWLIBDIR)\$(TARGET_CPU)\dw.dll !if exists($(WEBVIEW2LOADER)) copy $(WEBVIEW2LOADER) $(DWLIBDIR)\$(TARGET_CPU)\WebView2Loader.dll !endif dwcompat: dwcompat.dll dwcompat.dll: $(OBJS2) $(DEFFILE2) $(LINK) @<< -out:$(@) -def:$(DEFFILE2) $(LINKFLAGS) $(DLLLINKFLAGS) $(OBJS2) $(RES) $(LIBS) << $(WLIB) -def:$(DEFFILE2) -machine:$(TARGET_CPU) -out:dwcompat.lib mt.exe -manifest dwcompat.dll.manifest -outputresource:dwcompat.dll;2 -erase dwcompat.dll.manifest -md $(DWLIBDIR)\$(TARGET_CPU) copy dwcompat.lib $(DWLIBDIR)\$(TARGET_CPU)\dwcompat.lib copy dwcompat.dll $(DWLIBDIR)\$(TARGET_CPU)\dwcompat.dll dw.obj: $(SRCDIR)\win\dw.c $(CC) $(CFLAGS) $(CFLAGS_DEBUG) $(SRCDIR)\win\dw.c browser.obj: $(SRCDIR)\win\browser.c $(CC) $(CFLAGS) $(CFLAGS_DEBUG) $(SRCDIR)\win\browser.c XBrowseForFolder.obj: $(SRCDIR)\win\XBrowseForFolder.cpp $(CC) $(CFLAGS) $(CFLAGS_DEBUG) $(SRCDIR)\win\XBrowseForFolder.cpp edge.obj: $(SRCDIR)\win\edge.cpp $(CC) $(CFLAGS) $(CFLAGS_DEBUG) $(SRCDIR)\win\edge.cpp wintoast.obj: $(SRCDIR)\win\wintoast.cpp $(CC) $(CFLAGS) /EHsc $(CFLAGS_DEBUG) $(SRCDIR)\win\wintoast.cpp wintoastlib.obj: $(WINTOASTDIR)\src\wintoastlib.cpp $(CC) $(CFLAGS) /EHsc $(CFLAGS_DEBUG) $(WINTOASTDIR)\src\wintoastlib.cpp dirent.obj: $(SRCDIR)\win\dirent.c $(CC) $(CFLAGS) $(CFLAGS_DEBUG) $(SRCDIR)\win\dirent.c dwcompat.obj: $(SRCDIR)\dwcompat.c $(CC) $(CFLAGS) $(CFLAGS_DEBUG) $(SRCDIR)\dwcompat.c dwtest.obj: $(SRCDIR)\dwtest.c $(CC) $(CFLAGS) $(CFLAGS_DEBUG) $(SRCDIR)\dwtest.c dwtest: dwtest.exe dwtest.exe: dwtest.obj $(LINK) $(LINKFLAGS) /out:dwtest.exe dwtest.obj /subsystem:windows $(DWLIBDIR)\dwcompat.lib $(DWLIBDIR)\dw.lib $(LIBS) mt.exe /manifest dwtest.exe.manifest $(SRCDIR)\win\dwtest.exe.$(TARGET_CPU).manifest /outputresource:dwtest.exe;1 -erase dwtest.exe.manifest zip: dw.dll copy win\readme-win.txt . zip dwindows-win-$(VERDOT).zip readme-win.txt readme.txt x64\dw.dll x64\dwcompat.dll x64\dw.lib x64\dwcompat.lib x86\dw.dll x86\dwcompat.dll x86\dw.lib x86\dwcompat.lib dw.h dwcompat.h