From 688db1b744af02d74d0c49d8aa20697f5335e51a Mon Sep 17 00:00:00 2001 From: Alwin Joshy Date: Mon, 11 Sep 2023 15:22:07 +1000 Subject: [PATCH] Change to support BSD sed Signed-off-by: Alwin Joshy --- libpicotcp/CMakeLists.txt | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/libpicotcp/CMakeLists.txt b/libpicotcp/CMakeLists.txt index 1671b1acb..24a2d9139 100644 --- a/libpicotcp/CMakeLists.txt +++ b/libpicotcp/CMakeLists.txt @@ -45,14 +45,14 @@ if(LibPicotcp) " -I$, -I>" ) - if (CMAKE_C_COMPILER_ID STREQUAL "Clang") + if(CMAKE_C_COMPILER_ID STREQUAL "Clang") list(APPEND compile_options "${CMAKE_C_COMPILE_OPTIONS_TARGET}${CMAKE_C_COMPILER_TARGET}") set(C_COMPILER clang) else() set(C_COMPILER ${CROSS_COMPILER_PREFIX}gcc) endif() - if (NOT "${CMAKE_BUILD_TYPE}" STREQUAL "Debug") + if(NOT "${CMAKE_BUILD_TYPE}" STREQUAL "Debug") set(perf_flags "\"PERF=1\" \"DEBUG=0\"") endif() # generate a build.sh script to avoid nasty escape issues, we then invoke this in ExternalProject_Add @@ -72,6 +72,11 @@ if(LibPicotcp) add_custom_target(get_muslc) add_dependencies(get_muslc muslc) + set(sed_inplace_suffix "") + if(CMAKE_HOST_APPLE) + set(sed_inplace_suffix "''") + endif() + # build picotcp using its very own build system include(ExternalProject) ExternalProject_Add( @@ -89,6 +94,7 @@ if(LibPicotcp) PATCH_COMMAND sed -i + ${sed_inplace_suffix} "s/(CROSS_COMPILE)gcc/(C_COMPILER)/g" picotcp/Makefile CONFIGURE_COMMAND