[m-users.] Pass options to gcc compiler
Sean Charles (emacstheviking)
objitsu at gmail.com
Thu Nov 17 07:45:42 AEDT 2022
OK, that showed me the includes for mmc, I didn't phrase the question clearly enough, my fault. What I tried to ask for is how do I know what the final set of include paths is at compile time, and what compiler does mmc use as the default?
I wrote a simple test program, which compiles, links and runs just fine:
➜ agame cat test.c
#include <stdio.h>
#include <SDL.h>
int main(int argc, char* argv[]) {
SDL_version v;
SDL_GetVersion(&v);
printf("%i.%i.%i\n", v.major, v.minor, v.patch);
return 0;
}
➜ agame gcc test.c -o test `pkg-config --cflags sdl2` `pkg-config --libs sdl2`
➜ agame ./test
2.24.1
and
➜ agame clang test.c -o test `pkg-config --cflags sdl2` `pkg-config --libs sdl2`
➜ agame ./test
2.24.1
This must mean then that the compiler used to compile he mercury generated files is either not 'gcc' or the '-I' flag has not been passed through? I am at a loss as this Makefile and the flags worked fine on my intel mac, I must have written a dozen sdl2 programs without issue.
Sean.
> On 16 Nov 2022, at 20:35, Zoltan Somogyi <zoltan.somogyi at runbox.com> wrote:
>
>
> 2022-11-17 07:26 GMT+11:00 "Sean Charles (emacstheviking)" <objitsu at gmail.com>:
>> Is there a way to ask the compiler to show what include paths it has when compiling the generated C code ?
>
> --output-c-include-dir-flags
>
> Zoltan.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurylang.org/archives/users/attachments/20221116/8c38d95d/attachment.html>
More information about the users
mailing list