File: ubuntu-arm-linux-gnueabihf.cmake

package info (click to toggle)
morph-browser 1.1.2%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 9,424 kB
  • sloc: cpp: 12,201; javascript: 2,042; xml: 92; makefile: 43
file content (21 lines) | stat: -rw-r--r-- 927 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# shamelessly copied over from oxide’s build system
# to enable ARM cross compilation

set(CMAKE_SYSTEM_NAME Linux CACHE INTERNAL "")

find_program(_DPKG_ARCH_EXECUTABLE dpkg-architecture)
if(_DPKG_ARCH_EXECUTABLE STREQUAL "DPKG_ARCHITECTURE_EXECUTABLE-NOTFOUND")
  message(FATAL_ERROR "dpkg-architecture not found")
endif()
execute_process(COMMAND ${_DPKG_ARCH_EXECUTABLE} -qDEB_BUILD_MULTIARCH
                RESULT_VARIABLE _RESULT
                OUTPUT_VARIABLE HOST_ARCHITECTURE
                OUTPUT_STRIP_TRAILING_WHITESPACE)
if(NOT _RESULT EQUAL 0)
  message(FATAL_ERROR "Failed to determine host architecture")
endif()

set(CMAKE_C_COMPILER arm-linux-gnueabihf-gcc CACHE INTERNAL "")
set(CMAKE_CXX_COMPILER arm-linux-gnueabihf-g++ CACHE INTERNAL "")
set(CMAKE_LIBRARY_ARCHITECTURE arm-linux-gnueabihf CACHE INTERNAL "")
set(ENV{PKG_CONFIG_PATH} /usr/lib/${CMAKE_LIBRARY_ARCHITECTURE}/pkgconfig CACHE INTERNAL "")