Skip to content

Commit

Permalink
Raspberry Pi toolchain (#78)
Browse files Browse the repository at this point in the history
* Refs #4671. Add Raspberry Pi toolchain.

* Refs #4671. Fix Windows error compilation.
  • Loading branch information
julionce authored and lemunozm committed Apr 1, 2019
1 parent 6f05fcc commit 9a6dee2
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 4 deletions.
10 changes: 8 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,14 @@ set_target_properties(${PROJECT_NAME} PROPERTIES
C_STANDARD_REQUIRED YES
)

target_link_libraries(${PROJECT_NAME} PUBLIC microcdr
$<$<BOOL:${WIN32}>:ws2_32>
target_compile_options(${PROJECT_NAME} PRIVATE $<$<C_COMPILER_ID:GNU>:-fdata-sections -ffunction-sections>)

target_link_libraries(${PROJECT_NAME}
PUBLIC
microcdr
$<$<BOOL:$<PLATFORM_ID:Windows>>:ws2_32>
PRIVATE
$<$<BOOL:$<PLATFORM_ID:Linux>>:rt>
)
target_include_directories(${PROJECT_NAME}
PUBLIC
Expand Down
2 changes: 0 additions & 2 deletions toolchains/nuttx_toolchain.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,3 @@ add_compile_options(
${ARCH_CPU_FLAGS}
${ARCH_OPT_FLAGS}
)

set(__BIG_ENDIAN__ 0)
13 changes: 13 additions & 0 deletions toolchains/raspberrypi_toolchain.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
set(CMAKE_SYSTEM_NAME Linux)

set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)

set(CMAKE_C_COMPILER ${RPI_COMPILER}/arm-linux-gnueabihf-gcc)
set(CMAKE_CXX_COMPILER ${RPI_COMPILER}/arm-linux-gnueabihf-g++)

add_compile_options(
-std=c99
)

0 comments on commit 9a6dee2

Please sign in to comment.