mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-10-02 11:56:38 +02:00
build: Use .m files directly
If we're on macOS we can count on an Objective C compiler to exist.
This commit is contained in:
@@ -601,39 +601,17 @@ libgio_2_0_la_LDFLAGS = $(GLIB_LINK_FLAGS) \
|
|||||||
-version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
|
-version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
|
||||||
-export-dynamic $(no_undefined)
|
-export-dynamic $(no_undefined)
|
||||||
|
|
||||||
# We cannot build .m files because it would require adding AC_PROG_OBJC in
|
|
||||||
# configure.ac, and it cannot be added conditionally. That means we would always
|
|
||||||
# depend on an objective-c compiler even when not needed. To work around that
|
|
||||||
# limitation we rename .m files to .c and compile them separately with
|
|
||||||
# -xobjective-c into an intermediary library. Note that we cannot rename those
|
|
||||||
# files to .c directly in the source tree because Meson needs the .m extension.
|
|
||||||
# This must be done outside of "if OS_COCOA" block otherwise distcheck fails.
|
|
||||||
# See https://bugzilla.gnome.org/show_bug.cgi?id=672777.
|
|
||||||
OBJC_FILES = \
|
|
||||||
gnextstepsettingsbackend.m \
|
|
||||||
gosxcontenttype.m \
|
|
||||||
gosxappinfo.m \
|
|
||||||
gcocoanotificationbackend.m \
|
|
||||||
$(NULL)
|
|
||||||
OBJC_C_FILES = $(OBJC_FILES:.m=.c)
|
|
||||||
BUILT_SOURCES += $(OBJC_C_FILES)
|
|
||||||
CLEANFILES += $(OBJC_C_FILES)
|
|
||||||
EXTRA_DIST += $(OBJC_FILES)
|
|
||||||
$(OBJC_C_FILES): %.c: %.m Makefile
|
|
||||||
cp $< $@
|
|
||||||
|
|
||||||
if OS_COCOA
|
if OS_COCOA
|
||||||
libgio_objc_2_0_la_CFLAGS = $(libgio_2_0_la_CFLAGS) -xobjective-c
|
libgio_objc_2_0_la_OBJCFLAGS = $(AM_OBJCFLAGS) $(libgio_2_0_la_CFLAGS)
|
||||||
libgio_objc_2_0_la_CPPFLAGS = $(libgio_2_0_la_CPPFLAGS)
|
libgio_objc_2_0_la_CPPFLAGS = $(libgio_2_0_la_CPPFLAGS)
|
||||||
libgio_objc_2_0_la_LDFLAGS = $(libgio_2_0_la_LDFLAGS) -Wl,-framework,Foundation -Wl,-framework,AppKit
|
libgio_objc_2_0_la_LDFLAGS = $(libgio_2_0_la_LDFLAGS) -Wl,-framework,Foundation -Wl,-framework,AppKit
|
||||||
libgio_objc_2_0_la_SOURCES = \
|
libgio_objc_2_0_la_SOURCES = \
|
||||||
gnextstepsettingsbackend.c \
|
gnextstepsettingsbackend.m \
|
||||||
gosxcontenttype.c \
|
gosxcontenttype.m \
|
||||||
gosxappinfo.c \
|
gosxappinfo.m
|
||||||
gosxappinfo.h
|
|
||||||
if MAC_OS_X_9
|
if MAC_OS_X_9
|
||||||
libgio_objc_2_0_la_SOURCES += \
|
libgio_objc_2_0_la_SOURCES += \
|
||||||
gcocoanotificationbackend.c
|
gcocoanotificationbackend.m
|
||||||
endif
|
endif
|
||||||
|
|
||||||
noinst_LTLIBRARIES += libgio-objc-2.0.la
|
noinst_LTLIBRARIES += libgio-objc-2.0.la
|
||||||
|
Reference in New Issue
Block a user