Skip to content

Conversation

jpetrina
Copy link

Hello,

one of our customers has an non-x86 Linux target and we needed to change a few things in the build system to make this library integrate well with e.g. firmware build systems like Buildroot and to support cross-compilation.

For example, it is great help for us to do:

-DCMAKE_SYSTEM_NAME=Linux
-DCMAKE_SYSTEM_PROCESSOR=arm
-DCMAKE_C_COMPILER=/usr/bin/arm-linux-gnueabihf-gcc
-DCMAKE_CXX_COMPILER=/usr/bin/arm-linux-gnueabihf-g++
-DCMAKE_FIND_ROOT_PATH=/opt/arm-sysroot

and it Just Works™.

I'm using this PR as an opportunity to open the discussion and contribute upstream; let me know if you'd like some changes, thanks!

cc @spahijajakov @PL4typus

Forbidding in-source builds makes it harder to integrate with existing
firmware build systems like Buildroot.

Signed-off-by: Jakov Petrina <[email protected]>
This makes it possible to install the library and public includes using
standard commands. For example:

$ DESTDIR=./rootfs cmake --install ./build/ --prefix '/usr'
-- Install configuration: ""
-- Installing: ./rootfs/usr/lib/libnote_c.so
-- Installing: ./rootfs/usr/include/note-c/n_cjson.h
-- Installing: ./rootfs/usr/include/note-c/note.h

Signed-off-by: Jakov Petrina <[email protected]>
This fixes x86-specific arguments being set for non-x86 platforms,
allowing cross-compilation.

Signed-off-by: Jakov Petrina <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant