From 3b155c2c9a45955e0a89a5542db5d3b86c49f813 Mon Sep 17 00:00:00 2001 From: dongheng Date: Mon, 17 Jun 2019 11:20:24 +0800 Subject: [PATCH] fix(newlib): fix pthread macro lack for cpp --- components/newlib/CMakeLists.txt | 6 ------ components/newlib/Makefile.projbuild | 4 +--- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/components/newlib/CMakeLists.txt b/components/newlib/CMakeLists.txt index 12afa664..eb4bfb2d 100644 --- a/components/newlib/CMakeLists.txt +++ b/components/newlib/CMakeLists.txt @@ -18,11 +18,5 @@ target_compile_definitions(newlib PUBLIC -D_CLOCKS_PER_SEC_=CONFIG_FREERTOS_HZ -D_POSIX_THREADS=1 -D_UNIX98_THREAD_MUTEX_ATTRIBUTES=1 ) -if(CONFIG_ENABLE_PTHREAD) - target_compile_definitions(newlib PUBLIC - -D_POSIX_THREADS=1 -D_UNIX98_THREAD_MUTEX_AT - ) -endif() - target_link_libraries(newlib "-L ${CMAKE_CURRENT_SOURCE_DIR}/newlib/lib") target_link_libraries(newlib "${LIBC}" "${LIBM}") diff --git a/components/newlib/Makefile.projbuild b/components/newlib/Makefile.projbuild index 90b99fcb..bdb60c01 100644 --- a/components/newlib/Makefile.projbuild +++ b/components/newlib/Makefile.projbuild @@ -1,4 +1,2 @@ CFLAGS += -D_CLOCKS_PER_SEC_=CONFIG_FREERTOS_HZ -D_POSIX_THREADS=1 -D_UNIX98_THREAD_MUTEX_ATTRIBUTES=1 -ifdef CONFIG_ENABLE_PTHREAD -CFLAGS += -D_POSIX_THREADS=1 -D_UNIX98_THREAD_MUTEX_AT -endif +CPPFLAGS += -D_CLOCKS_PER_SEC_=CONFIG_FREERTOS_HZ -D_POSIX_THREADS=1 -D_UNIX98_THREAD_MUTEX_ATTRIBUTES=1