and don’t know how to get rid of it (other than by enumerating all packages with -DSWIPL_PACKAGE_LIST=…). There doesn’t seem to be a function install_test_cpp in the code (?)
I just pushed a fix for that (do not build the foreign language tests if STATIC_EXTENSIONS is given). Also pushed some changes that prevent installing the static libraries. Probably some more cleanup of what is installed is possible.
With that, this is enough to end up with a 5Mb executable that contains all standard extensions except those that require dynamic linking (jpl and sweep).
cmake -DSTATIC_EXTENSIONS=ON -G Ninja ..
Passes all tests, seems to work well, including graphics (on Linux).
Note that you do not need -DSWIPL_SHARED_LIB=OFF as this is implied by -DSTATIC_EXTENSIONS=ON and you also do not need -DSWIPL_STATIC_LIB=ON, which is there to force building and the static libswipl in addition to the dynamic one.
One more question This time, it is macOS. The swipl.pc seems to be missing (?). It’s there in the dynamic build, but not in the static build.
dynamic:
[100%] Built target library_index_library_http_always
Install the project...
-- Install configuration: "Release"
echo `ls ../inst/swipl`
bin lib share
echo `ls ../inst/swipl/share`
man pkgconfig
echo `ls ../inst/swipl/share/pkgconfig`
swipl.pc
static:
[100%] Built target memfile
[100%] Built target clib
[100%] Built target test_certificates
Install the project...
-- Install configuration: "Release"
echo `ls ../inst/swipl`
bin lib share
echo `ls ../inst/swipl/share`
man <<<--- no pkgconfig folder
echo `ls ../inst/swipl/share/pkgconfig`
ls: ../inst/swipl/share/pkgconfig: No such file or directory
libswipl.a only contains the core and an array with the entry points of the packages. The only thing you can do with it is to link it together with exactly the list of packages it was configured with to an executable.
As is, it can do only one thing: create a single executable with a selected set of packages distributed with the system. There are surely other scenarios that are useful, but that is another discussion.
I guess you know my specific use case, namely, a standalone dll/so/dynlib (instead of an executable) with swipl and the extensions in single one file. Why? Nothing special, the shared lib works well, it’s basically because the R/CRAN people prefer one single dll in their package system.
It’s not urgent, so I’ll tinker around with it when I have time and, if I am successful, I’ll submit a PR.