ObjFW  Check-in [20122a7016]

Overview
Comment:Fix linking ObjFWHID on macOS and iOS
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | gamecontroller
Files: files | file ages | folders
SHA3-256: 20122a7016c8d4c91aac4d716b2acd57259c55cbbf344b62b44540ee80e13c85
User & Date: js on 2024-05-13 21:57:36
Other Links: branch diff | manifest | tags
Context
2024-05-13
22:06
Merge trunk into branch "gamecontroller" check-in: cf9195c859 user: js tags: gamecontroller
21:57
Fix linking ObjFWHID on macOS and iOS check-in: 20122a7016 user: js tags: gamecontroller
21:13
Fix compilation with --disable-shared check-in: bb55076c9d user: js tags: gamecontroller
Changes

Modified configure.ac from [811c09f1d2] to [1971bc906c].

431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
	AC_SUBST(LIBOBJFWHID_DEP, "../src/hid/libobjfwhid.a")
	AC_SUBST(LIBOBJFWHID_DEP_LVL2, "../../src/hid/libobjfwhid.a")
])

AS_IF([test x"$build_framework" = x"yes"], [
	TESTS_LIBS="-framework ObjFW \${RUNTIME_FRAMEWORK_LIBS} $TESTS_LIBS"
	TESTS_LIBS="-framework ObjFWHID $TESTS_LIBS"
	TESTS_LIBS="-F../src -F../src/runtime $TESTS_LIBS"
], [
	TESTS_LIBS="\${RUNTIME_LIBS} $TESTS_LIBS"
	TESTS_LIBS="-L../src/runtime $TESTS_LIBS"
	TESTS_LIBS="-L../src -lobjfwhid -lobjfw $TESTS_LIBS"
])

AC_ARG_ENABLE(static, AS_HELP_STRING([--enable-static], [build static library]))
AS_IF([test x"$enable_shared" = x"no"], [
	enable_static="yes"
])
AS_IF([test x"$enable_static" = x"yes"], [







|

<
|
|







431
432
433
434
435
436
437
438
439

440
441
442
443
444
445
446
447
448
	AC_SUBST(LIBOBJFWHID_DEP, "../src/hid/libobjfwhid.a")
	AC_SUBST(LIBOBJFWHID_DEP_LVL2, "../../src/hid/libobjfwhid.a")
])

AS_IF([test x"$build_framework" = x"yes"], [
	TESTS_LIBS="-framework ObjFW \${RUNTIME_FRAMEWORK_LIBS} $TESTS_LIBS"
	TESTS_LIBS="-framework ObjFWHID $TESTS_LIBS"
	TESTS_LIBS="-F../src -F../src/runtime -F../src/hid $TESTS_LIBS"
], [

	TESTS_LIBS="-L../src/runtime \${RUNTIME_LIBS} $TESTS_LIBS"
	TESTS_LIBS="-L../src/hid -lobjfwhid -L../src -lobjfw $TESTS_LIBS"
])

AC_ARG_ENABLE(static, AS_HELP_STRING([--enable-static], [build static library]))
AS_IF([test x"$enable_shared" = x"no"], [
	enable_static="yes"
])
AS_IF([test x"$enable_static" = x"yes"], [

Modified src/hid/Makefile from [e63a386a0a] to [cb5296d389].

42
43
44
45
46
47
48
49
50
CPPFLAGS += -I.				\
	    -I..			\
	    -I../..			\
	    -I../exceptions		\
	    -I../runtime		\
	    -DOBJFWHID_LOCAL_INCLUDES
LD = ${OBJC}
FRAMEWORK_LIBS := -F.. -framework ObjFW ${LIBS}
LIBS := -L.. -lobjfw -L../runtime ${RUNTIME_LIBS} ${LIBS}







|

42
43
44
45
46
47
48
49
50
CPPFLAGS += -I.				\
	    -I..			\
	    -I../..			\
	    -I../exceptions		\
	    -I../runtime		\
	    -DOBJFWHID_LOCAL_INCLUDES
LD = ${OBJC}
FRAMEWORK_LIBS := -F.. -framework ObjFW ${RUNTIME_LIBS} ${LIBS}
LIBS := -L.. -lobjfw -L../runtime ${RUNTIME_LIBS} ${LIBS}

Modified tests/Makefile from [5d8fb13d89] to [1858d93af6].

271
272
273
274
275
276
277
278
279
280
281
282
283
284
OBJCFLAGS_RuntimeARCTests.m = -fobjc-arc -fobjc-arc-exceptions
# Repetition of libraries is required for Wii U, as otherwise it cannot find
# main. Just moving -lobjfwtest later doesn't work either, as then the linker
# cannot find ObjFW symbols. So the only solution is to list everything twice,
# but hide it behind a variable because listing it twice causes a warning on
# macOS.
LIBS := -L../src/test		\
	-L../src/hid		\
	-lobjfwtest		\
	${TESTS_LIBS}		\
	${LIBS}			\
	${WII_U_TESTS_LIBS}
LDFLAGS += ${MAP_LDFLAGS}
LD = ${OBJC}







<






271
272
273
274
275
276
277

278
279
280
281
282
283
OBJCFLAGS_RuntimeARCTests.m = -fobjc-arc -fobjc-arc-exceptions
# Repetition of libraries is required for Wii U, as otherwise it cannot find
# main. Just moving -lobjfwtest later doesn't work either, as then the linker
# cannot find ObjFW symbols. So the only solution is to list everything twice,
# but hide it behind a variable because listing it twice causes a warning on
# macOS.
LIBS := -L../src/test		\

	-lobjfwtest		\
	${TESTS_LIBS}		\
	${LIBS}			\
	${WII_U_TESTS_LIBS}
LDFLAGS += ${MAP_LDFLAGS}
LD = ${OBJC}