|
| 1 | +###################################################################### |
| 2 | +# |
| 3 | +# CMAKE build recipe for QNX Board Support Package (BSP) |
| 4 | +# |
| 5 | +###################################################################### |
| 6 | + |
| 7 | +# This basic implementation library should be generic enough to use |
| 8 | +# on any QNX based processor board. |
| 9 | +add_library(osal_generic-qnx_impl OBJECT |
| 10 | + src/bsp_start.c |
| 11 | + src/bsp_console.c |
| 12 | +) |
| 13 | + |
| 14 | +# OSAL needs conformance to at least POSIX.1c (aka POSIX 1995) - this includes all the |
| 15 | +# real-time support and threading extensions. |
| 16 | +# |
| 17 | +# When compiling against glibc, using "_XOPEN_SOURCE=600" enables the X/Open 6 standard. |
| 18 | +# XPG6 includes all necessary XPG5, POSIX.1c features as well as SUSv2/UNIX98 extensions. |
| 19 | +# This OSAL implementation uses clock_nanosleep(), mq_timedreceive(), and |
| 20 | +# mq_timedsend() which are enhancements added in the XPG6 standard. |
| 21 | +# |
| 22 | +# See http://www.gnu.org/software/libc/manual/html_node/Feature-Test-Macros.html |
| 23 | +# for a more detailed description of the feature test macros and available values |
| 24 | +target_compile_definitions(osal_public_api INTERFACE |
| 25 | + _XOPEN_SOURCE=600 |
| 26 | +) |
| 27 | + |
| 28 | +# QNX system libraries required for the final link of applications using OSAL |
| 29 | +if (QNX_SDP_VERSION EQUAL 800) |
| 30 | +target_link_libraries(osal_public_api INTERFACE |
| 31 | + socket unwind unwind-nto unwind-generic |
| 32 | +) |
| 33 | +elseif (QNX_SDP_VERSION EQUAL 710) |
| 34 | +target_link_libraries(osal_public_api INTERFACE |
| 35 | + socket backtrace |
| 36 | +) |
| 37 | +endif() |
| 38 | + |
| 39 | +# This BSP only works with "qnx" OS layer. |
| 40 | +# Confirming this reduces risk of accidental misconfiguration |
| 41 | +set_property(TARGET osal_generic-qnx_impl PROPERTY OSAL_EXPECTED_OSTYPE "qnx") |
| 42 | + |
| 43 | +# Configure the ut_coverage_compile and ut_coverage_link for enabling coverage |
| 44 | +# testing on this platform. |
| 45 | +if (NOT CMAKE_CROSSCOMPILING AND ENABLE_UNIT_TESTS) |
| 46 | + # Support for other compilers/coverage tools could be added here. |
| 47 | + # for now only the GNU "gcov" will be enabled |
| 48 | + if (CMAKE_C_COMPILER_ID STREQUAL GNU) |
| 49 | + target_compile_options(ut_coverage_compile INTERFACE -pg -ftest-coverage -fprofile-arcs) |
| 50 | + target_link_libraries(ut_coverage_link INTERFACE gcov) |
| 51 | + endif() |
| 52 | +endif() |
0 commit comments