File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ cmake_minimum_required (VERSION 3.20 )
2+
3+ option (BUILD_X86 "Build x86 version" OFF )
4+ option (BUILD_ARM "Build ARM version" OFF )
5+
6+
7+ if (BUILD_ARM AND NOT HOST_IS_ARM)
8+ set (CMAKE_SYSTEM_NAME Linux )
9+ set (CMAKE_SYSTEM_PROCESSOR aarch64)
10+ set (CMAKE_C_COMPILER aarch64-linux -gnu-gcc)
11+ set (CMAKE_CXX_COMPILER aarch64-linux -gnu-g++)
12+ message (STATUS "Cross-compiling for ARM" )
13+ endif ()
14+
15+ if (BUILD_X86 AND NOT HOST_IS_X86)
16+ set (CMAKE_SYSTEM_NAME Linux )
17+ set (CMAKE_SYSTEM_PROCESSOR x86_64)
18+ set (CMAKE_C_COMPILER x86_64-linux -gnu-gcc)
19+ set (CMAKE_CXX_COMPILER x86_64-linux -gnu-g++)
20+ message (STATUS "Cross-compiling for x86_64" )
21+ endif ()
22+
23+ if (NOT BUILD_ARM AND NOT BUILD_X86)
24+ message (STATUS "Using native compilation" )
25+ endif ()
26+
27+
28+ project (udf_product)
29+
30+ add_library (product SHARED src/product.cpp )
31+
32+ set_target_properties (product PROPERTIES
33+ PREFIX ""
34+ POSITION_INDEPENDENT_CODE ON
35+ )
You can’t perform that action at this time.
0 commit comments