forked from AuroraMiddleware/gtk
Visual Studio projects: Fix generating gtktypefuncs.inc
From the Meson port, gtk/gtktesteutils.c now includes gtk/gtktypefuncs.in instead of gtk/gtktypefuncs.c, so we should do the same thing in the Visual Studio projects, to fix the build. Also, since build/win32/gentypefuncs.py is an adaptation of the script from GTK master (in gtk/), and that we now have gtk/gentypefuncs.py, we should use the version of the script in gtk/ and drop the one in build/win32.
This commit is contained in:
parent
bd80b34ca8
commit
0b50915878
@ -36,7 +36,6 @@ SUBDIRS = \
|
||||
|
||||
EXTRA_DIST += \
|
||||
detectenv-msvc.mak \
|
||||
gentypefuncs.py \
|
||||
gtk-introspection-msvc.mak \
|
||||
introspection-msvc.mak \
|
||||
replace.py \
|
||||
|
@ -1,53 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import sys
|
||||
import re
|
||||
import os
|
||||
|
||||
debug = os.getenv('GTK_GENTYPEFUNCS_DEBUG') is not None
|
||||
|
||||
out_file = sys.argv[1]
|
||||
in_file = sys.argv[2]
|
||||
|
||||
funcs = []
|
||||
|
||||
|
||||
if debug: print ('Output file: ', out_file)
|
||||
|
||||
# if debug: print (len(in_files), 'input files')
|
||||
|
||||
def open_file(filename, mode):
|
||||
if sys.version_info[0] < 3:
|
||||
return open(filename, mode=mode)
|
||||
else:
|
||||
return open(filename, mode=mode, encoding='utf-8')
|
||||
|
||||
with open(in_file, 'r') as f:
|
||||
for line in f:
|
||||
line = line.rstrip('\n').rstrip('\r')
|
||||
# print line
|
||||
match = re.search(r'\bg[td]k_[a-zA-Z0-9_]*_get_type\b', line)
|
||||
if match:
|
||||
func = match.group(0)
|
||||
if not func in funcs:
|
||||
funcs.append(func)
|
||||
if debug: print ('Found ', func)
|
||||
|
||||
file_output = 'G_GNUC_BEGIN_IGNORE_DEPRECATIONS\n'
|
||||
|
||||
funcs = sorted(funcs)
|
||||
|
||||
for f in funcs:
|
||||
if f.startswith('gdk_x11') or f.startswith('gtk_socket') or f.startswith('gtk_plug'):
|
||||
file_output += '#ifdef GDK_WINDOWING_X11\n'
|
||||
file_output += '*tp++ = {0}();\n'.format(f)
|
||||
file_output += '#endif\n'
|
||||
else:
|
||||
file_output += '*tp++ = {0}();\n'.format(f)
|
||||
|
||||
if debug: print (len(funcs), 'functions')
|
||||
|
||||
ofile = open(out_file, "w")
|
||||
ofile.write(file_output)
|
||||
ofile.close()
|
@ -21,7 +21,7 @@
|
||||
<CustomBuild Include="..\..\..\gtk\gtkdbusinterfaces.xml"><Filter>Resource Files</Filter></CustomBuild>
|
||||
<CustomBuild Include="..\..\..\gtk\gtk-win32.rc.body"><Filter>Resource Files</Filter></CustomBuild>
|
||||
<CustomBuild Include="..\..\..\gtk\libgtk3.manifest.in"><Filter>Resource Files</Filter></CustomBuild>
|
||||
<CustomBuild Include="..\gentypefuncs.py"><Filter>Resource Files</Filter></CustomBuild>
|
||||
<CustomBuild Include="..\..\..\gtk\gentypefuncs.py"><Filter>Resource Files</Filter></CustomBuild>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
#include "gtk-3.vs10.sourcefiles.filters"
|
||||
|
@ -178,10 +178,10 @@
|
||||
<Command>$(GenerateGtkWin32Manifest)</Command>
|
||||
<Outputs>..\..\..\gtk\libgtk3.manifest;%(Outputs)</Outputs>
|
||||
</CustomBuild>
|
||||
<CustomBuild Include="..\gentypefuncs.py">
|
||||
<Message>Generating ..\..\..\gtk\gtktypefuncs.c</Message>
|
||||
<CustomBuild Include="..\..\..\gtk\gentypefuncs.py">
|
||||
<Message>Generating ..\..\..\gtk\gtktypefuncs.inc</Message>
|
||||
<Command>$(GenerateTypeFuncs)</Command>
|
||||
<Outputs>..\..\..\gtk\gtktypefuncs.c</Outputs>
|
||||
<Outputs>..\..\..\gtk\gtktypefuncs.inc</Outputs>
|
||||
</CustomBuild>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
@ -47,7 +47,7 @@ echo $(Configuration) > ..\..\..\MSVC_$(Configuration)_Broadway
|
||||
echo #undef GTK_COMPILATION > ..\..\..\gtk\gtktypefuncs.preproc.c
|
||||
echo #include "gtkx.h" >> ..\..\..\gtk\gtktypefuncs.preproc.c
|
||||
cl /EP /I..\..\..\gtk /I..\..\..\gdk /I..\..\..\gdk\win32 /I..\..\.. /I$(GlibEtcInstallRoot)\include\gdk-pixbuf-2.0 /I$(GlibEtcInstallRoot)\include\pango-1.0 /I$(GlibEtcInstallRoot)\include\atk-1.0 /I$(GlibEtcInstallRoot)\include\cairo /I$(GlibEtcInstallRoot)\include\gio-win32-2.0 /I$(GlibEtcInstallRoot)\include\glib-2.0 /I$(GlibEtcInstallRoot)\lib\glib-2.0\include /I$(GlibEtcInstallRoot)\include /DHAVE_CONFIG_H /DG_DISABLE_SINGLE_INCLUDES /DATK_DISABLE_SINGLE_INCLUDES /DGDK_PIXBUF_DISABLE_SINGLE_INCLUDES /DGTK_DISABLE_SINGLE_INCLUDES /D_USE_MATH_DEFINES /DINCLUDE_IM_am_et /DINCLUDE_IM_cedilla /DINCLUDE_IM_cyrillic_translit /DINCLUDE_IM_ime /DINCLUDE_IM_inuktitut /DINCLUDE_IM_ipa /DINCLUDE_IM_multipress /DINCLUDE_IM_thai /DINCLUDE_IM_ti_er /DINCLUDE_IM_ti_et /DINCLUDE_IM_viqr /DGTK_COMPILATION /DG_LOG_DOMAIN=\"Gtk\" /DGTK_HOST=\"i686-pc-vs$(VSVer)\" /DGTK_PRINT_BACKENDS=\"file\" /DGTK_PRINT_BACKEND_ENABLE_UNSUPPORTED /D$(GtkIncludedImmodulesDefines) /DGTK_LIBDIR=\"$(GtkDummyPrefix)/lib\" /DGTK_DATADIR=\"$(GtkDummyPrefix)/share\" /DGTK_DATA_PREFIX=\"$(GtkDummyPrefix)\" /DGTK_SYSCONFDIR=\"$(GtkDummyPrefix)/etc\" /DMULTIPRESS_CONFDIR=\"$(GtkDummyPrefix)/etc/gtk-$(ApiVersion)\" /DMULTIPRESS_LOCALEDIR=\"$(GtkDummyPrefix)/share/locale\" /DGTK_VERSION=\"$(GtkVersion)\" /DGTK_BINARY_VERSION=\"$(GtkBinaryVersion)\" /DGDK_DISABLE_DEPRECATED /DISOLATION_AWARE_ENABLED ..\..\..\gtk\gtktypefuncs.preproc.c > ..\..\..\gtk\gtktypefuncs.combined.c
|
||||
$(PythonDir)\python ..\gentypefuncs.py ..\..\..\gtk\gtktypefuncs.c ..\..\..\gtk\gtktypefuncs.combined.c
|
||||
$(PythonDir)\python ..\..\..\gtk\gentypefuncs.py ..\..\..\gtk\gtktypefuncs.inc ..\..\..\gtk\gtktypefuncs.combined.c
|
||||
del ..\..\..\gtk\gtktypefuncs.combined.c ..\..\..\gtk\gtktypefuncs.preproc.c
|
||||
</GenerateTypeFuncs>
|
||||
</PropertyGroup>
|
||||
|
@ -252,33 +252,33 @@
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File RelativePath="..\gentypefuncs.py">
|
||||
<File RelativePath="..\..\..\gtk\gentypefuncs.py">
|
||||
<FileConfiguration Name="Debug|Win32">
|
||||
<Tool Name="VCCustomBuildTool"
|
||||
Description="Generating ..\..\..\gtk\gtktypefuncs.c..."
|
||||
Description="Generating ..\..\..\gtk\gtktypefuncs.inc..."
|
||||
CommandLine="$(GenerateTypeFuncs)"
|
||||
Outputs="..\..\..\gtk\gtktypefuncs.c"
|
||||
Outputs="..\..\..\gtk\gtktypefuncs.inc"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration Name="Release|Win32">
|
||||
<Tool Name="VCCustomBuildTool"
|
||||
Description="Generating ..\..\..\gtk\gtktypefuncs.c..."
|
||||
Description="Generating ..\..\..\gtk\gtktypefuncs.inc..."
|
||||
CommandLine="$(GenerateTypeFuncs)"
|
||||
Outputs="..\..\..\gtk\gtktypefuncs.c"
|
||||
Outputs="..\..\..\gtk\gtktypefuncs.inc"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration Name="Debug|x64">
|
||||
<Tool Name="VCCustomBuildTool"
|
||||
Description="Generating ..\..\..\gtk\gtktypefuncs.c..."
|
||||
Description="Generating ..\..\..\gtk\gtktypefuncs.inc..."
|
||||
CommandLine="$(GenerateTypeFuncsX64)"
|
||||
Outputs="..\..\..\gtk\gtktypefuncs.c"
|
||||
Outputs="..\..\..\gtk\gtktypefuncs.inc"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration Name="Release|x64">
|
||||
<Tool Name="VCCustomBuildTool"
|
||||
Description="Generating ..\..\..\gtk\gtktypefuncs.c..."
|
||||
Description="Generating ..\..\..\gtk\gtktypefuncs.inc..."
|
||||
CommandLine="$(GenerateTypeFuncsX64)"
|
||||
Outputs="..\..\..\gtk\gtktypefuncs.c"
|
||||
Outputs="..\..\..\gtk\gtktypefuncs.inc"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
|
@ -84,7 +84,7 @@ echo $(ConfigurationName) > ..\..\..\MSVC_$(ConfigurationName)_Broadway
|
||||
echo #undef GTK_COMPILATION > ..\..\..\gtk\gtktypefuncs.preproc.c

|
||||
echo #include "gtkx.h" >> ..\..\..\gtk\gtktypefuncs.preproc.c

|
||||
cl /EP /I..\..\..\gtk /I..\..\..\gdk /I..\..\..\gdk\win32 /I..\..\.. /I$(GlibEtcInstallRoot)\include\gdk-pixbuf-2.0 /I$(GlibEtcInstallRoot)\include\pango-1.0 /I$(GlibEtcInstallRoot)\include\atk-1.0 /I$(GlibEtcInstallRoot)\include\cairo /I$(GlibEtcInstallRoot)\include\gio-win32-2.0 /I$(GlibEtcInstallRoot)\include\glib-2.0 /I$(GlibEtcInstallRoot)\lib\glib-2.0\include /I$(GlibEtcInstallRoot)\include /DHAVE_CONFIG_H /DG_DISABLE_SINGLE_INCLUDES /DATK_DISABLE_SINGLE_INCLUDES /DGDK_PIXBUF_DISABLE_SINGLE_INCLUDES /DGTK_DISABLE_SINGLE_INCLUDES /D_USE_MATH_DEFINES /DINCLUDE_IM_am_et /DINCLUDE_IM_cedilla /DINCLUDE_IM_cyrillic_translit /DINCLUDE_IM_ime /DINCLUDE_IM_inuktitut /DINCLUDE_IM_ipa /DINCLUDE_IM_multipress /DINCLUDE_IM_thai /DINCLUDE_IM_ti_er /DINCLUDE_IM_ti_et /DINCLUDE_IM_viqr /DGTK_COMPILATION /DG_LOG_DOMAIN=\"Gtk\" /DGTK_HOST=\"i686-pc-vs$(VSVer)\" /DGTK_PRINT_BACKENDS=\"file\" /DGTK_PRINT_BACKEND_ENABLE_UNSUPPORTED /D$(GtkIncludedImmodulesDefines) /DGTK_LIBDIR=\"$(GtkDummyPrefix)/lib\" /DGTK_DATADIR=\"$(GtkDummyPrefix)/share\" /DGTK_DATA_PREFIX=\"$(GtkDummyPrefix)\" /DGTK_SYSCONFDIR=\"$(GtkDummyPrefix)/etc\" /DMULTIPRESS_CONFDIR=\"$(GtkDummyPrefix)/etc/gtk-$(ApiVersion)\" /DMULTIPRESS_LOCALEDIR=\"$(GtkDummyPrefix)/share/locale\" /DGTK_VERSION=\"$(GtkVersion)\" /DGTK_BINARY_VERSION=\"$(GtkBinaryVersion)\" /DGDK_DISABLE_DEPRECATED /DISOLATION_AWARE_ENABLED ..\..\..\gtk\gtktypefuncs.preproc.c > ..\..\..\gtk\gtktypefuncs.combined.c

|
||||
$(PythonDir)\python ..\gentypefuncs.py ..\..\..\gtk\gtktypefuncs.c ..\..\..\gtk\gtktypefuncs.combined.c

|
||||
$(PythonDir)\python ..\..\..\gtk\gentypefuncs.py ..\..\..\gtk\gtktypefuncs.inc ..\..\..\gtk\gtktypefuncs.combined.c

|
||||
del ..\..\..\gtk\gtktypefuncs.combined.c ..\..\..\gtk\gtktypefuncs.preproc.c

|
||||
"
|
||||
/>
|
||||
@ -94,7 +94,7 @@ del ..\..\..\gtk\gtktypefuncs.combined.c ..\..\..\gtk\gtktypefuncs.preproc.c�
|
||||
echo #undef GTK_COMPILATION > ..\..\..\gtk\gtktypefuncs.preproc.c

|
||||
echo #include "gtkx.h" >> ..\..\..\gtk\gtktypefuncs.preproc.c

|
||||
cl /EP /I..\..\..\gtk /I..\..\..\gdk /I..\..\..\gdk\win32 /I..\..\.. /I$(GlibEtcInstallRoot)\include\gdk-pixbuf-2.0 /I$(GlibEtcInstallRoot)\include\pango-1.0 /I$(GlibEtcInstallRoot)\include\atk-1.0 /I$(GlibEtcInstallRoot)\include\cairo /I$(GlibEtcInstallRoot)\include\gio-win32-2.0 /I$(GlibEtcInstallRoot)\include\glib-2.0 /I$(GlibEtcInstallRoot)\lib\glib-2.0\include /I$(GlibEtcInstallRoot)\include /DHAVE_CONFIG_H /DG_DISABLE_SINGLE_INCLUDES /DATK_DISABLE_SINGLE_INCLUDES /DGDK_PIXBUF_DISABLE_SINGLE_INCLUDES /DGTK_DISABLE_SINGLE_INCLUDES /D_USE_MATH_DEFINES /DINCLUDE_IM_am_et /DINCLUDE_IM_cedilla /DINCLUDE_IM_cyrillic_translit /DINCLUDE_IM_ime /DINCLUDE_IM_inuktitut /DINCLUDE_IM_ipa /DINCLUDE_IM_multipress /DINCLUDE_IM_thai /DINCLUDE_IM_ti_er /DINCLUDE_IM_ti_et /DINCLUDE_IM_viqr /DGTK_COMPILATION /DG_LOG_DOMAIN=\"Gtk\" /DGTK_HOST=\"i686-pc-vs$(VSVer)\" /DGTK_PRINT_BACKENDS=\"file\" /DGTK_PRINT_BACKEND_ENABLE_UNSUPPORTED /D$(GtkIncludedImmodulesDefines) /DGTK_LIBDIR=\"$(GtkDummyPrefix)/lib\" /DGTK_DATADIR=\"$(GtkDummyPrefix)/share\" /DGTK_DATA_PREFIX=\"$(GtkDummyPrefix)\" /DGTK_SYSCONFDIR=\"$(GtkDummyPrefix)/etc\" /DMULTIPRESS_CONFDIR=\"$(GtkDummyPrefix)/etc/gtk-$(ApiVersion)\" /DMULTIPRESS_LOCALEDIR=\"$(GtkDummyPrefix)/share/locale\" /DGTK_VERSION=\"$(GtkVersion)\" /DGTK_BINARY_VERSION=\"$(GtkBinaryVersion)\" /DGDK_DISABLE_DEPRECATED /DISOLATION_AWARE_ENABLED ..\..\..\gtk\gtktypefuncs.preproc.c > ..\..\..\gtk\gtktypefuncs.combined.c

|
||||
$(PythonDirX64)\python ..\gentypefuncs.py ..\..\..\gtk\gtktypefuncs.c ..\..\..\gtk\gtktypefuncs.combined.c

|
||||
$(PythonDirX64)\python ..\..\..\gtk\gentypefuncs.py ..\..\..\gtk\gtktypefuncs.inc ..\..\..\gtk\gtktypefuncs.combined.c

|
||||
del ..\..\..\gtk\gtktypefuncs.combined.c ..\..\..\gtk\gtktypefuncs.preproc.c

|
||||
"
|
||||
/>
|
||||
|
Loading…
Reference in New Issue
Block a user