Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libmetal(cmake): set HAVE_STDATOMIC_H default true in NuttX platform #316

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions cmake/depends.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,13 @@ if ("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
find_package(LibRt REQUIRED)
collect (PROJECT_LIB_DEPS "${LIBRT_LIBRARIES}")

else ("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
elseif ("${CMAKE_SYSTEM_NAME}" STREQUAL "NuttX")

# there is no need to use cmake include detection
# under NuttX platform
set(HAVE_STDATOMIC_H true)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems not a good idea to force HAVE_STDATOMIC_H here
what about ujsrt having

elseif (NOT "${CMAKE_SYSTEM_NAME}" STREQUAL "NuttX")

  # TODO: fix for find_path() to detect stdatomic.h
  # find_path (HAVE_STDATOMIC_H stdatomic.h)
  set (_saved_cmake_required_flags ${CMAKE_REQUIRED_FLAGS})
  set (CMAKE_REQUIRED_FLAGS "-c" CACHE STRING "")
  check_include_files (stdatomic.h HAVE_STDATOMIC_H)
  set (CMAKE_REQUIRED_FLAGS ${_saved_cmake_required_flags})

endif ()


else ()

# TODO: fix for find_path() to detect stdatomic.h
# find_path (HAVE_STDATOMIC_H stdatomic.h)
Expand All @@ -33,5 +39,5 @@ else ("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
check_include_files (stdatomic.h HAVE_STDATOMIC_H)
set (CMAKE_REQUIRED_FLAGS ${_saved_cmake_required_flags})

endif ("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
endif ()