nasa / bplib

Apache License 2.0
27 stars 13 forks source link

CMake configuration error in CFS build #214

Closed jphickey closed 1 year ago

jphickey commented 1 year ago

Describe the bug When building CFS in certain configurations, it creates the "bplib" target in a way based on the project config. Sometimes this is STATIC or SHARED but in some cases might also be the MODULE type.

Unfortunately, if it does use the MODULE type, then it is no longer linkable with a normal executable. This is a problem if tests are enabled, now producing this error:

CMake Error at /home/joe/code/cfecfs/github/libs/bplib/ut-functional/CMakeLists.txt:26 (target_link_libraries):
  Target "bplib" of type MODULE_LIBRARY may not be linked into another
  target.  One may link only to INTERFACE, OBJECT, STATIC or SHARED
  libraries, or to executables with the ENABLE_EXPORTS property set.

To Reproduce Configure BPLIB as a CFS module, and build with ENABLE_UNIT_TESTS=TRUE

Expected behavior Should build cleanly

System observed on: Ubuntu 22.04

Reporter Info Joseph Hickey, Vantage Systems, Inc.