Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit e16fbb7

Browse files
committed
Add Linux ARM target for Native libraries.
1 parent 17a9de2 commit e16fbb7

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

src/Native/CMakeLists.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,13 @@ add_compile_options(-Wall -Werror -fPIC)
1111

1212
if (CMAKE_SYSTEM_PROCESSOR STREQUAL x86_64 OR CMAKE_SYSTEM_PROCESSOR STREQUAL amd64)
1313
add_definitions(-DBIT64=1)
14+
elseif (CMAKE_SYSTEM_PROCESSOR STREQUAL armv7l)
15+
add_definitions(-DBIT32=1)
16+
# Because we don't use CMAKE_C_COMPILER/CMAKE_CXX_COMPILER to use clang
17+
# we have to set the triple by adding a compiler argument
18+
add_compile_options(-target armv7-linux-gnueabihf)
19+
add_compile_options(-mthumb)
20+
add_compile_options(-mfpu=vfpv3)
1421
endif ()
1522

1623
string(TOUPPER ${CMAKE_BUILD_TYPE} UPPERCASE_CMAKE_BUILD_TYPE)

src/Native/build.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
usage()
44
{
55
echo "Usage: $0 [BuildArch] [BuildType] [clean] [verbose] [clangx.y]"
6-
echo "BuildArch can be: x64"
6+
echo "BuildArch can be: x64, arm"
77
echo "BuildType can be: Debug, Release"
88
echo "clean - optional argument to force a clean build."
99
echo "verbose - optional argument to enable verbose build output."
@@ -84,7 +84,7 @@ echo "Commencing CoreFX Native build"
8484

8585
# Argument types supported by this script:
8686
#
87-
# Build architecture - valid value is: x64.
87+
# Build architecture - valid values are: x64, arm.
8888
# Build Type - valid values are: Debug, Release
8989
#
9090
# Set the default arguments for build
@@ -148,6 +148,10 @@ for i in "$@"
148148
__BuildArch=x64
149149
__MSBuildBuildArch=x64
150150
;;
151+
arm)
152+
__BuildArch=arm
153+
__MSBuildBuildArch=arm
154+
;;
151155
debug)
152156
__BuildType=Debug
153157
;;

0 commit comments

Comments
 (0)