I had a go with openslp-2.0.0 and managed to make one GPR that builds the library and another, which with
s the first, to build the tests - no complaints about the duplicate file.
Both project files are at the top level.
As common for projects like openslp
, the configure
process generates a lengthy config.h
, at the top level, with a shedload of #define HAVE_FOO 1
’s.
This is the 'common' project file - I think there may also be an executable in there (slptool
), which might have to be a separate GPR since this one builds a library:
project Openslp is
for Languages use ("c");
for Source_Dirs use ("common", "libslp", "libslpattr");
for Excluded_Source_Files use
(
"slp_win32.c", -- not on Darwin! or Linux, ofc
"libslpattr_tiny.c" -- I think this must be an alternate version
);
for Library_Name use "slp";
for Library_Kind use "static";
for Library_Dir use "lib";
for Object_Dir use "obj-openslp";
for Create_Missing_Dirs use "true";
package Compiler is
for Switches ("c") use
(
"-DDARWIN",
"-DHAVE_CONFIG_H",
"-I" & project'Project_Dir, -- for config.h, created by configure
"-I" & project'Project_Dir & "/common",
"-I" & project'Project_Dir & "/libslp",
"-I" & project'Project_Dir & "/libslpattr",
"-DETCDIR=""" & project'Project_Dir & "/etc"""
);
end Compiler;
end Openslp;
and this is the 'test' one:
with "openslp";
project Openslp_Test is
for Languages use ("c");
for Source_Dirs use ("test/**");
for Object_Dir use "obj-openslp_test";
for Exec_Dir use "test/bin";
for Main use ("SLPFindAttrs.c"); -- etc, etc
for Create_Missing_Dirs use "true";
package Compiler is
for Switches ("c") use
("-I" & project'Project_Dir & "/test") -- for the local slp_debug.h
& Openslp.Compiler'Switches ("c");
end Compiler;
end Openslp_Test;