build: Fix opaquetest build on Windows
Create 2 makefile variable to facilitate build on Windows: GENERATED_SOURCES_FILES to match files created by the code generator, and GENERATED_SOURCES_OPTION for the corresponding option to be passed to the compiler. Also adapt the makefile for the valtest sample to use these variables.
This commit is contained in:
parent
3495ca286d
commit
a6c9634748
4 changed files with 16 additions and 19 deletions
|
@ -54,7 +54,7 @@ build_references = $(addprefix -r:, $(references)) $(MONO_CAIRO_LIBS)
|
|||
|
||||
$(ASSEMBLY): generated-stamp $(SNK) $(build_sources) $(references)
|
||||
@rm -f $(ASSEMBLY).mdb
|
||||
$(CSC) $(CSFLAGS) -keyfile:$(SNK) -nowarn:0169,0612,0618 -unsafe -out:$(ASSEMBLY) -target:library $(build_references) $(GENERATED_SOURCES) $(build_sources) $(top_builddir)$(ASSEMBLYINFO)
|
||||
$(CSC) $(CSFLAGS) -keyfile:$(SNK) -nowarn:0169,0612,0618 -unsafe -out:$(ASSEMBLY) -target:library $(build_references) $(GENERATED_SOURCES_OPTION) $(build_sources) $(top_builddir)$(ASSEMBLYINFO)
|
||||
|
||||
install-data-local:
|
||||
@if test -n '$(pkg)'; then \
|
||||
|
|
|
@ -111,7 +111,8 @@ fi
|
|||
|
||||
if test "x$has_mono" = "xtrue"; then
|
||||
GACUTIL_FLAGS='/package $(PACKAGE_VERSION) /gacdir $(DESTDIR)$(prefix)/lib'
|
||||
GENERATED_SOURCES=generated/*/*.cs
|
||||
GENERATED_SOURCES_FILES=generated/*/*.cs
|
||||
GENERATED_SOURCES_OPTION=$GENERATED_SOURCES_FILES
|
||||
ASSEMBLYINFO=/AssemblyInfo.cs
|
||||
AC_PATH_PROG(RUNTIME, mono, no)
|
||||
|
||||
|
@ -144,7 +145,8 @@ dnl Check for .NET Framework
|
|||
AC_PATH_PROG(CSC, csc.exe, no)
|
||||
CSFLAGS="-nologo -platform:x86"
|
||||
GACUTIL_FLAGS=
|
||||
GENERATED_SOURCES="-recurse:generated\\\\*.cs"
|
||||
GENERATED_SOURCES_FILES="generated\\\\*.cs"
|
||||
GENERATED_SOURCES_OPTION="-recurse:$GENERATED_SOURCES_FILES"
|
||||
ASSEMBLYINFO=\\\\AssemblyInfo.cs
|
||||
AM_CONDITIONAL(ENABLE_THREADCHECK, false)
|
||||
enable_dotnet=yes
|
||||
|
@ -165,7 +167,8 @@ AC_SUBST(GACUTIL)
|
|||
AC_SUBST(GACUTIL_FLAGS)
|
||||
AC_SUBST(LIB_PREFIX)
|
||||
AC_SUBST(LIB_SUFFIX)
|
||||
AC_SUBST(GENERATED_SOURCES)
|
||||
AC_SUBST(GENERATED_SOURCES_FILES)
|
||||
AC_SUBST(GENERATED_SOURCES_OPTION)
|
||||
AC_SUBST(ASSEMBLYINFO)
|
||||
|
||||
GTK_REQUIRED_VERSION=3.0.0
|
||||
|
|
|
@ -4,8 +4,8 @@ lib_LTLIBRARIES = libopaque.la
|
|||
assemblies=../../glib/glib-sharp.dll ../../gio/gio-sharp.dll ../../pango/pango-sharp.dll ../../atk/atk-sharp.dll ../../gdk/gdk-sharp.dll ../../gtk/gtk-sharp.dll
|
||||
references=$(addprefix -r:, $(assemblies))
|
||||
|
||||
opaquetest.exe: OpaqueTest.cs $(GENERATED_SOURCES) $(assemblies)
|
||||
$(CSC) $(CSFLAGS) -out:opaquetest.exe $(references) $(srcdir)/OpaqueTest.cs $(GENERATED_SOURCES)
|
||||
opaquetest.exe: OpaqueTest.cs $(GENERATED_SOURCES_FILES) $(assemblies)
|
||||
$(CSC) $(CSFLAGS) -out:opaquetest.exe $(references) $(srcdir)/OpaqueTest.cs $(GENERATED_SOURCES_OPTION)
|
||||
|
||||
libopaque_la_SOURCES = \
|
||||
opaques.c \
|
||||
|
@ -17,7 +17,7 @@ libopaque_la_LIBADD = $(GTK_LIBS)
|
|||
|
||||
AM_CPPFLAGS = $(GTK_CFLAGS)
|
||||
|
||||
$(GENERATED_SOURCES): opaque-api.xml
|
||||
$(GENERATED_SOURCES_FILES): opaque-api.xml
|
||||
$(RUNTIME) ../../generator/gapi_codegen.exe --generate $(srcdir)/opaque-api.xml \
|
||||
--include=../../gtk/gtk-api.xml --include=../../gdk/gdk-api.xml \
|
||||
--outdir=generated --assembly-name=opaque-sharp \
|
||||
|
@ -32,7 +32,7 @@ install:
|
|||
CLEANFILES = \
|
||||
opaquetest.exe \
|
||||
opaquetest.exe.mdb \
|
||||
$(GENERATED_SOURCES)
|
||||
$(GENERATED_SOURCES_FILES)
|
||||
|
||||
EXTRA_DIST = \
|
||||
OpaqueTest.cs \
|
||||
|
|
|
@ -4,14 +4,8 @@ lib_LTLIBRARIES = libvalobj.la
|
|||
assemblies=../../glib/glib-sharp.dll ../../gio/gio-sharp.dll ../../cairo/cairo-sharp.dll ../../pango/pango-sharp.dll ../../atk/atk-sharp.dll ../../gdk/gdk-sharp.dll ../../gtk/gtk-sharp.dll
|
||||
references=$(addprefix -r:, $(assemblies))
|
||||
|
||||
if PLATFORM_WIN32
|
||||
VALOBJ=Gtksharp\\Valobj.cs
|
||||
else
|
||||
VALOBJ=Gtksharp/Valobj.cs
|
||||
endif
|
||||
|
||||
valtest.exe: Valtest.cs $(VALOBJ) $(assemblies)
|
||||
$(CSC) $(CSFLAGS) -out:valtest.exe $(references) $(srcdir)/Valtest.cs $(VALOBJ)
|
||||
valtest.exe: Valtest.cs $(GENERATED_SOURCES_FILES) $(assemblies)
|
||||
$(CSC) $(CSFLAGS) -out:valtest.exe $(references) $(srcdir)/Valtest.cs $(GENERATED_SOURCES_OPTION)
|
||||
|
||||
libvalobj_la_SOURCES = \
|
||||
valobj.c \
|
||||
|
@ -23,10 +17,10 @@ libvalobj_la_LIBADD = $(GTK_LIBS)
|
|||
|
||||
AM_CPPFLAGS = $(GTK_CFLAGS)
|
||||
|
||||
$(VALOBJ): valobj-api.xml
|
||||
$(GENERATED_SOURCES_FILES): valobj-api.xml
|
||||
$(RUNTIME) ../../generator/gapi_codegen.exe --generate $(srcdir)/valobj-api.xml \
|
||||
--include=../../gtk/gtk-api.xml --include=../../gdk/gdk-api.xml \
|
||||
--outdir=. --assembly-name=valobj-sharp \
|
||||
--outdir=generated --assembly-name=valobj-sharp \
|
||||
--schema=$(top_srcdir)/gapi.xsd
|
||||
|
||||
api:
|
||||
|
@ -37,7 +31,7 @@ install:
|
|||
CLEANFILES = \
|
||||
valtest.exe \
|
||||
valtest.exe.mdb \
|
||||
$(VALOBJ)
|
||||
$(GENERATED_SOURCES_FILES)
|
||||
|
||||
EXTRA_DIST = \
|
||||
Valtest.cs \
|
||||
|
|
Loading…
Reference in a new issue