Reordering of arguments specified in the pkg-config.pc file.
pkg-config --version
0.29.2
cat app.pc:
prefix=/opt/app
exec_prefix=${prefix}
libdir=${exec_prefix}/lib64
includedir=${exec_prefix}/include
Name: app
Description: app lib
Version: 0
Libs: -L ${libdir} -l app -Wl,-rpath=${libdir}
Cflags: -I${includedir}
pkg-config --cflags app
-I/opt/app/include
Changing the Cflags line to:
Cflags: -I ${includedir}
that is, with a space between -I and the path, causes the following, (arguments reordered):
pkg-config --cflags app
/opt/app/include -I
Considering that both POSIX and gcc specify -I<SPACE>path
as valid command line arguments for the c99/gcc commands respectivly, I consider this to be a bug.
POSIX: https://pubs.opengroup.org/onlinepubs/9699919799/utilities/c99.html
c99 [options...] pathname [[pathname] [-I directory]
[-L directory] [-l library]]...
...
-I directory
GCC: https://gcc.gnu.org/onlinedocs/gcc/Directory-Options.html#Directory-Options
3.16 Options for Directory Search
These options specify directories to search for header files, for libraries and for parts of the compiler:
-I dir