Compiling ardupilot to allow linking as an imported static library

Hi
I’ve spent a bit too much time trying to solve this issue so any help is appreciated.

Goal:
I have a standalone project where I wish to include the AR_AttitudeControl library.

Attempt:
Use CMakeLists
Compile ardupilot Rover using the sitl board and with the -fPIC flag.
Set macros needed to include AR_AttitudeControl.h
Add ardupilot as a static library and wrap malloc
Link ardupilot to the target

Problem:
The compiled target contains and undefined symbol “_ZN11RC_Channels8var_infoE”.
This should be defined in “libRover_libs.a”, but it is not.

The symbol is defined in ardupilots generated executable “ardurover”.
The symbol is also defined in “ardupilot/build/sitl/Rover/RC_Channel.cpp.0.o”.

I also tried linking to the object containing the definition, which resulted in a new missing definition and so forth until the linker complained about multiple definitions. Forgoing the library and just linking to object files yielded similar results.

Questions:
I assume the underlying issue is that I’m compiling ardupilot incorrectly. I’m also under the impression that this should be quite simple, but am somewhat illiterate when it comes to waf.

How should I go about compiling ardupilot so that the generated library contains all the symbols?
Or do I have the wrong approach altogether?