From 37066a126eb3826d61733e83d9a1cfed04a532cd Mon Sep 17 00:00:00 2001 From: wtudio <95963900+wtudio@users.noreply.github.com> Date: Fri, 6 Dec 2024 09:42:07 +0800 Subject: [PATCH] fix (#120) --- CMakeLists.txt | 5 ++++- src/interface/aimrt_module_cpp_interface/co/aimrt_context.h | 6 +++--- src/runtime/core/aimrt_core.cc | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3ce2692dd..c2803404f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -95,7 +95,10 @@ if(AIMRT_MASTER_PROJECT) set(CMAKE_EXPORT_COMPILE_COMMANDS ON) endif() -set(CMAKE_POSITION_INDEPENDENT_CODE ON) +if(UNIX) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC") +endif() if(CMAKE_CXX_COMPILER_ID MATCHES "MSVC") add_compile_options(/utf-8 /wd4819) diff --git a/src/interface/aimrt_module_cpp_interface/co/aimrt_context.h b/src/interface/aimrt_module_cpp_interface/co/aimrt_context.h index 0d1b854ef..cca910f3b 100644 --- a/src/interface/aimrt_module_cpp_interface/co/aimrt_context.h +++ b/src/interface/aimrt_module_cpp_interface/co/aimrt_context.h @@ -253,7 +253,7 @@ class AimRTScheduler { : executor_ref_(executor_ref) {} template - OperationState> connect(Receiver&& receiver) { + auto connect(Receiver&& receiver) { return OperationState>( executor_ref_, (Receiver &&) receiver); } @@ -308,7 +308,7 @@ class AimRTScheduler { : executor_ref_(executor_ref), dt_(dt) {} template - SchedulerAfterOperationState> connect(Receiver&& receiver) { + auto connect(Receiver&& receiver) { return SchedulerAfterOperationState>( executor_ref_, dt_, (Receiver &&) receiver); } @@ -364,7 +364,7 @@ class AimRTScheduler { : executor_ref_(executor_ref), tp_(tp) {} template - SchedulerAtOperationState> connect(Receiver&& receiver) { + auto connect(Receiver&& receiver) { return SchedulerAtOperationState>( executor_ref_, tp_, (Receiver &&) receiver); } diff --git a/src/runtime/core/aimrt_core.cc b/src/runtime/core/aimrt_core.cc index b17372e1b..26c42da06 100644 --- a/src/runtime/core/aimrt_core.cc +++ b/src/runtime/core/aimrt_core.cc @@ -245,7 +245,7 @@ void AimRTCore::ShutdownImpl() { void AimRTCore::Start() { StartImpl(); - AIMRT_INFO("AimRT start completed, will waiting for shutdown."); + AIMRT_INFO("AimRT startup completed, will wait for shutdown."); shutdown_promise_.get_future().wait(); ShutdownImpl();