Skip to content

Commit

Permalink
fix: Add CMOCKA_CFLAGS to test program CFLAGS
Browse files Browse the repository at this point in the history
For some reason, macos-14 builds fail to find cmocka.h, even though the
header and library is installed. Adding CMOCKA_CFLAGS should help to fix
the build.
  • Loading branch information
nirenjan committed Jun 9, 2024
1 parent 50a9111 commit 2c108fa
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion cli/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ TESTS += test-cli
check_PROGRAMS += test-cli

test_cli_SOURCES = cli/x52_cli.c cli/test_x52_cli.c
test_cli_CFLAGS = -DX52_CLI_TESTING -I $(top_srcdir)/libx52
test_cli_CFLAGS = @CMOCKA_CFLAGS@ -DX52_CLI_TESTING -I $(top_srcdir)/libx52
test_cli_LDFLAGS = @CMOCKA_LIBS@ $(WARN_LDFLAGS)

# Add a dependency on test_x52_cli_tests.c
Expand Down
2 changes: 1 addition & 1 deletion daemon/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ x52d_mouse_test_CFLAGS = \
-I $(top_srcdir)/libx52 \
-I $(top_srcdir)/libx52io \
-I $(top_srcdir)/lib/pinelog \
$(WARN_CFLAGS)
$(WARN_CFLAGS) @CMOCKA_CFLAGS@
x52d_mouse_test_LDFLAGS = @CMOCKA_LIBS@ $(WARN_LDFLAGS)
x52d_mouse_test_LDADD = \
lib/pinelog/libpinelog.la \
Expand Down
4 changes: 2 additions & 2 deletions libx52/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ check_PROGRAMS += libx52test libx52-string-test

nodist_libx52test_SOURCES = libx52/test_libx52.c
libx52test_SOURCES = $(libx52_la_SOURCES)
libx52test_CFLAGS = @LIBUSB_CFLAGS@ -DLOCALEDIR='"$(localedir)"' -I $(top_srcdir) -I $(top_srcdir)/libx52
libx52test_CFLAGS = @CMOCKA_CFLAGS@ @LIBUSB_CFLAGS@ -DLOCALEDIR='"$(localedir)"' -I $(top_srcdir) -I $(top_srcdir)/libx52
libx52test_CFLAGS += -Dlibusb_control_transfer=__wrap_libusb_control_transfer
libx52test_LDFLAGS = @CMOCKA_LIBS@ @LIBUSB_LIBS@
libx52test_LDADD = libx52.la
Expand All @@ -60,7 +60,7 @@ libx52_string_test_SOURCES = \
libx52/test_strings.c \
libx52/x52_stringify.c \
libx52/x52_strerror.c
libx52_string_test_CFLAGS = -I $(top_srcdir) -I $(top_srcdir)/libx52
libx52_string_test_CFLAGS = @CMOCKA_CFLAGS@ -I $(top_srcdir) -I $(top_srcdir)/libx52
libx52_string_test_LDFLAGS = @CMOCKA_LIBS@
libx52_string_test_LDADD = libx52.la
endif
Expand Down
4 changes: 2 additions & 2 deletions libx52io/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ TESTS += test-axis test-parser
check_PROGRAMS += test-axis test-parser

test_axis_SOURCES = libx52io/test_axis.c $(libx52io_la_SOURCES)
test_axis_CFLAGS = $(libx52io_la_CFLAGS)
test_axis_CFLAGS = @CMOCKA_CFLAGS@ $(libx52io_la_CFLAGS)
test_axis_LDFLAGS = @CMOCKA_LIBS@ @HIDAPI_LIBS@ $(WARN_LDFLAGS)
test_axis_LDADD = @LTLIBINTL@

test_parser_SOURCES = libx52io/test_parser.c $(libx52io_la_SOURCES)
test_parser_CFLAGS = $(libx52io_la_CFLAGS)
test_parser_CFLAGS = @CMOCKA_CFLAGS@ $(libx52io_la_CFLAGS)
test_parser_LDFLAGS = @CMOCKA_LIBS@ @HIDAPI_LIBS@ $(WARN_LDFLAGS)
test_parser_LDADD = @LTLIBINTL@

Expand Down

0 comments on commit 2c108fa

Please sign in to comment.