Skip to content

Commit 45637cd

Browse files
committed
sanity check of pkg conf added
1 parent c1eaa58 commit 45637cd

File tree

3 files changed

+27
-1
lines changed

3 files changed

+27
-1
lines changed

RTEMSConfig.cmake

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@
4040

4141
function(rtems_general_config TARGET_NAME RTEMS_PREFIX RTEMS_BSP_PAIR)
4242

43-
message(STATUS ${RTEMS_CONFIG_DIR})
4443
if(NOT RTEMS_CONFIG_DIR)
4544
message(STATUS
4645
"RTEMS_CONFIG_DIR not set. Assuming the CMake support was "

RTEMSGeneric.cmake

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,20 @@ if (${NUM_EXTRA_RTEMS_ARGS} EQUAL 1)
3939
set(RTEMS_PATH ${EXTRA_RTEMS_ARGS})
4040
endif()
4141

42+
if(NOT RTEMS_PREFIX)
43+
status(WARNING "No RTEMS prefix supplied!")
44+
endif()
45+
46+
4247
set(RTEMS_PREFIX ${RTEMS_PREFIX} CACHE FILEPATH "RTEMS prefix")
48+
get_filename_component(RTEMS_PREFIX "${RTEMS_PREFIX}" ABSOLUTE)
49+
set(RTEMS_PREFIX_ABS ${RTEMS_PREFIX} CACHE FILEPATH
50+
"RTEMS prefix (absolute path)"
51+
)
52+
4353
set(RTEMS_BSP ${RTEMS_BSP} CACHE STRING "RTEMS BSP pair")
54+
55+
4456
option(RTEMS_VERBOSE "Verbose output for the RTEMS CMake support" FALSE)
4557

4658
set(RTEMS_INSTALL

RTEMSHardware.cmake

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,22 @@ if(${RTEMS_SCAN_PKG_CONFIG})
5353
set(ENV{PKG_CONFIG_PATH} "$ENV{PKG_CONFIG_PATH}:${RTEMS_PKG_FILE_PATH}")
5454
pkg_check_modules(RTEMS_BSP_CONFIG "${RTEMS_PKG_MODULE_NAME}")
5555

56+
pkg_get_variable(RTEMS_BSP_CONFIG_PREFIX
57+
"${RTEMS_PKG_MODULE_NAME}" "prefix"
58+
)
59+
if(NOT "${RTEMS_BSP_CONFIG_PREFIX}" MATCHES "${RTEMS_PREFIX_ABS}")
60+
message(WARNING
61+
"Specified RTEMS prefix and prefix read from "
62+
"pkgconfig are different!"
63+
)
64+
message(WARNING
65+
"Consider adapting the pkg-config file manually if "
66+
"the toolchain has moved and the build fails."
67+
)
68+
endif()
69+
5670
if(${RTEMS_VERBOSE})
71+
message(STATUS "PKG prefix: ${RTEMS_BSP_CONFIG_PREFIX}")
5772
message(STATUS "PKG configuration file found: ${RTEMS_BSP_CONFIG_FOUND}")
5873
message(STATUS "Libraries: ${RTEMS_BSP_CONFIG_LIBRARIES}")
5974
message(STATUS "Link libraries: ${_RTEMS_BSP_CONFIGLINK_LIBRARIES}")

0 commit comments

Comments
 (0)