Skip to content

Conversation

fd00
Copy link
Contributor

@fd00 fd00 commented Jun 18, 2025

The make check command fails because the include path is not appropriate for the Makefile generated by autotools when the source and build directories are different.

$ cd /tmp
$ git clone https://github.com/recp/cglm.git
$ cd cglm
$ autoreconf -fiv
$ mkdir build
$ cd build
$ ../configure
:
$ make check
:
/Library/Developer/CommandLineTools/usr/bin/make  test/tests
  CC       test/tests-runner.o
In file included from ../test/runner.c:8:
../test/include/common.h:31:10: fatal error: 'cglm/cglm.h' file not found
   31 | #include <cglm/cglm.h>
      |          ^~~~~~~~~~~~~
1 error generated.
make[1]: *** [test/tests-runner.o] Error 1
make: *** [check-am] Error 2

@Copilot Copilot AI review requested due to automatic review settings June 18, 2025 12:02
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes the make check failure when the source directory differs from the build directory by updating the include path in the test build flags.

  • Changed relative include flag from -I./include to -I$(srcdir)/include
  • Ensures headers are found when srcdir != builddir

@@ -23,7 +23,7 @@ checkCFLAGS = $(AM_CFLAGS) \
-std=gnu11 \
-O3 \
-DCGLM_DEFINE_PRINTS \
-I./include
-I$(srcdir)/include
Copy link
Preview

Copilot AI Jun 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Preprocessor include paths are conventionally set in CPPFLAGS rather than CFLAGS; consider moving the -I$(srcdir)/include flag to check_CPPFLAGS or AM_CPPFLAGS for clearer separation of concerns.

Copilot uses AI. Check for mistakes.

@fd00
Copy link
Contributor Author

fd00 commented Jun 18, 2025

Sorry I forgot to disable Automatic Copilot code review.

@recp recp merged commit a4602f2 into recp:master Jun 18, 2025
161 of 188 checks passed
@recp
Copy link
Owner

recp commented Jun 18, 2025

@fd00 the PR is merged, thanks for your contributions 🚀

@fd00 fd00 deleted the fix-make branch June 19, 2025 21:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants