[Buildroot] [PATCH 1/5] core/pkg-cmake: provide our own platform description

Baruch Siach baruch at tkos.co.il
Thu Mar 2 12:29:40 UTC 2017


Hi Yann,

On Tue, Feb 28, 2017 at 07:07:22PM +0100, Yann E. MORIN wrote:
> -set(CMAKE_SYSTEM_NAME Linux)
> +set(CMAKE_SYSTEM_NAME Buildroot)
>  set(CMAKE_SYSTEM_PROCESSOR @@CMAKE_SYSTEM_PROCESSOR@@)

This breaks libiio.

http://autobuild.buildroot.net/results/281/2812b008a0ab6bab5fe4d45eb9ffe4e9496a8cb4/

/home/dawncrow/buildroot-test/scripts/instance-0/output/build/libiio-0.9/local.c: In function 'local_open':
/home/dawncrow/buildroot-test/scripts/instance-0/output/build/libiio-0.9/local.c:856:33: error: 'O_CLOEXEC' undeclared (first use in this function)

That is because the libiio CMakeLists.txt has the following code:

IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")

		[...]

        set(CMAKE_REQUIRED_DEFINITIONS "-D_GNU_SOURCE=1")
        add_definitions(-D_GNU_SOURCE=1)
endif()

Now cmake skips this code, thus omitting _GNU_SOURCE which leads to the build 
failure.

baruch

-- 
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -


More information about the buildroot mailing list