diff --git a/system/microros/micro_ros_lib/include_override/assert.h b/system/microros/micro_ros_lib/include_override/assert.h new file mode 100644 index 000000000..1874aa304 --- /dev/null +++ b/system/microros/micro_ros_lib/include_override/assert.h @@ -0,0 +1,41 @@ +/**************************************************************************** + * apps/system/microros/micro_ros_lib/include_override/assert.h + * + * 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. + * + ****************************************************************************/ + +#ifndef __MICROROS_INCLUDE_OVERRIDE_ASSERT_H +#define __MICROROS_INCLUDE_OVERRIDE_ASSERT_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +/* Pull the system assert.h, then redefine assert to a no-op when NDEBUG is + * set. Avoids an assert redefinition conflict in rosidl typesupport. + */ + +#include_next + +#ifdef NDEBUG +# undef assert +# define assert(x) ((void)(0)) +#endif + +#endif /* __MICROROS_INCLUDE_OVERRIDE_ASSERT_H */ diff --git a/system/microros/micro_ros_lib/toolchain.cmake.in b/system/microros/micro_ros_lib/toolchain.cmake.in new file mode 100644 index 000000000..dbdc290e2 --- /dev/null +++ b/system/microros/micro_ros_lib/toolchain.cmake.in @@ -0,0 +1,29 @@ +include(CMakeForceCompiler) + +set(CMAKE_SYSTEM_NAME Generic) +set(CMAKE_SYSTEM_PROCESSOR @CMAKE_SYSTEM_PROCESSOR@) +set(CMAKE_CROSSCOMPILING 1) +set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY) +set(PLATFORM_NAME "nuttx") + +set(CMAKE_C_COMPILER @CMAKE_C_COMPILER@) +set(CMAKE_CXX_COMPILER @CMAKE_CXX_COMPILER@) + +set(CMAKE_C_FLAGS_INIT "-std=c11 @ARCH_C_FLAGS@ -D'__attribute__(x)='" CACHE STRING "" FORCE) +set(CMAKE_CXX_FLAGS_INIT "-std=c++14 @ARCH_CPP_FLAGS@ -fno-rtti -D'__attribute__(x)='" CACHE STRING "" FORCE) + +set(NUTTX_TOPDIR @NUTTX_TOPDIR@) +set(NUTTX_APPDIR @NUTTX_APPDIR@) +set(INCLUDE_OVR_DIR @INCLUDE_OVR_DIR@) + +include_directories(SYSTEM + ${NUTTX_TOPDIR}/include + ${NUTTX_TOPDIR}/include/cxx + ${NUTTX_APPDIR}/include +) + +include_directories(AFTER SYSTEM + ${INCLUDE_OVR_DIR}/include_override +) + +set(__BIG_ENDIAN__ 0)