nuttx-apps/system/microros/Make.defs
Arjav Patel 0a0118b93c system/microros: Wire libmicroros include layout and sim final link.
libmicroros is installed by colcon under include/<pkg>/<pkg>/file.h
for ament-packaged headers (e.g. rcl, rmw, rosidl) and the flat
include/<pkg>/file.h for a few others (e.g. rclc). A single
-I include/ therefore resolves <rclc/rclc.h> but not <rcl/rcl.h>.

Enumerate every immediate subdirectory of include/ in addition to
include/ itself so both layouts resolve.

Switch the library hand-off from LDLIBS to EXTRA_LIBS. The sim
target's final link pulls EXTRA_LIBS, not LDLIBS, so the previous
form left rcl/rclc/rcutils symbols unresolved.

Signed-off-by: Arjav Patel <arjav1528@gmail.com>
2026-06-02 00:15:25 +08:00

32 lines
1.4 KiB
Text

############################################################################
# apps/system/microros/Make.defs
#
# SPDX-License-Identifier: Apache-2.0
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership. The
# ASF licenses this file to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance with the
# License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
############################################################################
ifneq ($(CONFIG_SYSTEM_MICROROS),)
CONFIGURED_APPS += $(APPDIR)/system/microros
MICROROS_INC_DIRS := $(APPDIR)/system/microros/include \
$(wildcard $(APPDIR)/system/microros/include/*)
CFLAGS += $(foreach d,$(MICROROS_INC_DIRS),${INCDIR_PREFIX}$(d))
CXXFLAGS += $(foreach d,$(MICROROS_INC_DIRS),${INCDIR_PREFIX}$(d))
EXTRA_LIBS += $(APPDIR)/system/microros/libmicroros.a
endif