[Buildroot] [PATCH] package/pulseview: fix build when linking against libatomic is needed

Samuel Martin s.martin49 at gmail.com
Thu May 26 21:52:50 UTC 2016


Thomas, all,

On Thu, May 26, 2016 at 12:00 AM, Thomas Petazzoni
<thomas.petazzoni at free-electrons.com> wrote:
> Hello,
>
> On Wed, 25 May 2016 23:45:54 +0200, Samuel Martin wrote:
>
>> ++    list(APPEND CMAKE_REQUIRED_LIBRARIES "atomic")
>
> Since you have this here.
>
>> ++    check_working_cxx_atomics(HAVE_CXX_ATOMICS_WITH_LIB)
>> ++    if (NOT HAVE_CXX_ATOMICS_WITH_LIB)
>> ++      message(FATAL_ERROR "Host compiler must support std::atomic!")
>> ++    endif()
>> ++  else()
>> ++    message(FATAL_ERROR "Host compiler appears to require libatomic, but cannot find it.")
>> ++  endif()
>> ++endif()
>> ++
>> ++if(HAVE_CXX_ATOMICS_WITH_LIB)
>> ++  set(ATOMIC_LIBRARIES "-latomic")
>
> Is this needed?

Unfortunately yes. :-/
CMAKE_REQUIRED_* variables are only used by check macros, not by the
native commands like target_link_libraries.
Following sigrok review, I've reworked this patch a bit, so v2 will be
there soon ;)

Regards,


-- 
Samuel



More information about the buildroot mailing list