@@ -11,40 +11,51 @@ if (NOT CFE_SYSTEM_PSPNAME)
1111endif ()
1212
1313set (CFE_PSP_TARGETNAME "${CFE_SYSTEM_PSPNAME} " )
14- add_definitions (-D_CFE_PSP_)
14+ add_definitions (-D_CFE_PSP_) # macro to indicate PSP scope
15+
16+ # The "psp_module_api" defines the interface between internal PSP components
17+ add_library (psp_module_api INTERFACE )
18+ target_compile_definitions (psp_module_api INTERFACE
19+ $<TARGET_PROPERTY:osal,INTERFACE_COMPILE_DEFINITIONS > # use defs from OSAL
20+ )
21+ target_include_directories (psp_module_api INTERFACE
22+ fsw/inc # public API
23+ fsw/shared/inc # all PSP shared headers
24+ ${CFE_SOURCE_DIR} /cmake/target /inc # for sysconfig
25+ $<TARGET_PROPERTY:osal,INTERFACE_INCLUDE_DIRECTORIES > # use headers from OSAL
26+ )
27+
1528
1629# The PSP is currently built in two parts, consisting of a fully platform-specific
1730# module combined with a shared component which is built for multiple targets.
1831# The "shared" component is compiled using headers from the platform-specific module
1932# so it is still ultimately a platform-specific binary, and it all gets wrapped into
2033# a single PSP static library target.
21- include_directories (
22- fsw/inc
23- fsw/shared/inc # all local stuff
24- ${CFE_SOURCE_DIR} /cmake/target /inc # for sysconfig
25- $<TARGET_PROPERTY:osal,INTERFACE_INCLUDE_DIRECTORIES > # headers from OSAL
26- )
2734
2835add_subdirectory (fsw/${CFE_PSP_TARGETNAME} ${CFE_PSP_TARGETNAME} -impl)
29- target_compile_definitions (psp-${CFE_PSP_TARGETNAME} -impl PUBLIC
30- $<TARGET_PROPERTY:osal,INTERFACE_COMPILE_DEFINITIONS > # defs from OSAL
31- )
36+ #target_compile_definitions(psp-${CFE_PSP_TARGETNAME}-impl PUBLIC
37+ # $<TARGET_PROPERTY:psp_module_api,INTERFACE_COMPILE_DEFINITIONS>
38+ #)
39+ #target_include_directories(psp-${CFE_PSP_TARGETNAME}-impl PRIVATE
40+ # $<TARGET_PROPERTY:psp_module_api,INTERFACE_INCLUDE_DIRECTORIES>
41+ #)
3242
3343add_subdirectory (fsw/shared ${CFE_PSP_TARGETNAME} -shared)
34- target_compile_definitions (psp-${CFE_PSP_TARGETNAME} -shared PUBLIC
35- $<TARGET_PROPERTY:osal,INTERFACE_COMPILE_DEFINITIONS > # defs from OSAL
36- )
44+ #target_compile_definitions(psp-${CFE_PSP_TARGETNAME}-shared PRIVATE
45+ # $<TARGET_PROPERTY:psp_module_api,INTERFACE_COMPILE_DEFINITIONS>
46+ #)
47+ #target_include_directories(psp-${CFE_PSP_TARGETNAME}-shared PRIVATE
48+ # $<TARGET_PROPERTY:psp_module_api,INTERFACE_INCLUDE_DIRECTORIES>
49+ #)
3750
3851add_library (psp-${CFE_PSP_TARGETNAME} STATIC
3952 $<TARGET_OBJECTS:psp-${CFE_PSP_TARGETNAME} -shared>
4053 $<TARGET_OBJECTS:psp-${CFE_PSP_TARGETNAME} -impl>
4154)
42-
4355target_include_directories (psp-${CFE_PSP_TARGETNAME} INTERFACE
4456 fsw/inc
4557)
4658
47-
4859if (ENABLE_UNIT_TESTS)
4960 add_subdirectory (${CMAKE_CURRENT_SOURCE_DIR} /ut-stubs)
5061 add_subdirectory (${CMAKE_CURRENT_SOURCE_DIR} /unit-test -coverage)
0 commit comments