Skip to content

Cross Compiling #10

Locked Answered by vvaltchev
freetoair asked this question in Q&A
Sep 21, 2024 · 1 comments · 5 replies
Discussion options

You must be logged in to vote

Hi @freetoair,
I converted this to a discussion, since it's not a bug.
tfblib is a fairly simple C library and can be cross-compiled like any other CMake project.
Check this out: https://cmake.org/cmake/help/book/mastering-cmake/chapter/Cross%20Compiling%20With%20CMake.html

In summary, you need to create a "toolchain file" for CMake and call cmake like this:

cmake -DCMAKE_TOOLCHAIN_FILE=otherToolchainFile.cmake

The bare minimum things a toolchain file needs is the paths for the compiler and potentially other basic tools. Here's an example from another project of mine:

      set(CMAKE_C_COMPILER ${GCC_TOOLCHAIN}/${ARCH_GCC_TC}-linux-gcc)
      set(CMAKE_CXX_COMPILER ${GCC_TOOLCHAIN}/${ARC…

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@freetoair
Comment options

@freetoair
Comment options

@vvaltchev
Comment options

@freetoair
Comment options

@vvaltchev
Comment options

Answer selected by vvaltchev
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #8 on September 21, 2024 17:47.