Skip to content
This repository was archived by the owner on Aug 22, 2024. It is now read-only.

Commit 6dea37e

Browse files
wes-bschultetwin1Matt Schulte
authored
Arm64 Support (#1108)
* Adds ARM64 toolchain file and logic to determine target architecture * Enables non-sse version of rgbz transformation * Adds arm64 cross compile support to Dockerfile * Add ARM64 builds to pipeline * Enabling Functional Testing on ARM64 * Updating Display for ARM64 and glxinfo * fixing up build artifact names * Switch to publishing GNU binaries * Moving DepthEngine properly * Moving DepthEngine properly * fixing case * Don't run multi device tests on ARM64 Co-authored-by: Matt Schulte <[email protected]> Co-authored-by: Matt Schulte <[email protected]>
1 parent 52cfb4a commit 6dea37e

File tree

11 files changed

+336
-108
lines changed

11 files changed

+336
-108
lines changed

CMakeLists.txt

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,8 @@ if ("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
135135
set(CMAKE_BUILD_RPATH "\$ORIGIN")
136136
endif()
137137

138-
set(TARGET_ARCH ${CMAKE_SYSTEM_PROCESSOR})
138+
include(DetermineTargetArch)
139+
determine_target_arch(TARGET_ARCH)
139140

140141
# CMake doesn't set the target processor correctly for MSVC
141142
if ("${CMAKE_C_COMPILER_ID}" STREQUAL "MSVC")
@@ -149,16 +150,14 @@ if ("${CMAKE_C_COMPILER_ID}" STREQUAL "MSVC")
149150

150151
# Check what architecture we are building for. This assumes all 64-bit architectures are amd64, which will break
151152
# if we decide to support arm.
152-
if ("${CMAKE_SIZEOF_VOID_P}" STREQUAL "8")
153-
set(TARGET_ARCH "amd64")
153+
if ("${TARGET_ARCH}" STREQUAL "x86_64")
154154
configure_file(k4a.props.in ${CMAKE_CURRENT_SOURCE_DIR}/src/csharp/k4a.x64.props)
155155
configure_file(StubGenerator.xml.in ${CMAKE_CURRENT_SOURCE_DIR}/src/csharp/StubGenerator.x64.xml)
156-
elseif("${CMAKE_SIZEOF_VOID_P}" STREQUAL "4")
157-
set(TARGET_ARCH "x86")
156+
elseif("${TARGET_ARCH}" STREQUAL "i686")
158157
configure_file(k4a.props.in ${CMAKE_CURRENT_SOURCE_DIR}/src/csharp/k4a.x86.props)
159158
configure_file(StubGenerator.xml.in ${CMAKE_CURRENT_SOURCE_DIR}/src/csharp/StubGenerator.x86.xml)
160159
else()
161-
message(FATAL_ERROR "Unknown architecture with size of void* = ${CMAKE_SIZEOF_VOID_P}")
160+
message(FATAL_ERROR "Unknown architecture for MSVC: ${TARGET_ARCH}")
162161
endif()
163162
endif()
164163

azure-pipelines.yml

Lines changed: 71 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -369,28 +369,47 @@ jobs:
369369

370370
- job: LinuxK4ABuildTest
371371
displayName: Linux
372-
pool:
373-
vmImage: 'ubuntu-16.04'
374-
container: mcr.microsoft.com/akbuilder-linux:v3
375372
strategy:
376373
maxParallel: 100
377374
matrix:
378375
x64-clang_debug_ninja:
379376
CMakeLinuxTargetTriple: 'x86_64-linux-clang'
380377
CMakeConfiguration: 'debug'
381378
UsesOpenCV: 'TRUE'
379+
container: 'mcr.microsoft.com/akbuilder-linux:v5-amd64'
382380
x64-gnu_debug_ninja:
383381
CMakeLinuxTargetTriple: 'x86_64-linux-gnu'
384382
CMakeConfiguration: 'debug'
385383
UsesOpenCV: 'TRUE'
384+
container: 'mcr.microsoft.com/akbuilder-linux:v5-amd64'
386385
x64-clang_rel_ninja:
387386
CMakeLinuxTargetTriple: 'x86_64-linux-clang'
388387
CMakeConfiguration: 'relwithdebinfo'
389388
UsesOpenCV: 'TRUE'
389+
container: 'mcr.microsoft.com/akbuilder-linux:v5-amd64'
390390
x64-gnu_rel_ninja:
391391
CMakeLinuxTargetTriple: 'x86_64-linux-gnu'
392392
CMakeConfiguration: 'relwithdebinfo'
393393
UsesOpenCV: 'TRUE'
394+
container: 'mcr.microsoft.com/akbuilder-linux:v5-amd64'
395+
# arm64-clang_debug_ninja:
396+
# CMakeLinuxTargetTriple: 'arm64-linux-clang'
397+
# CMakeConfiguration: 'debug'
398+
# UsesOpenCV: 'FALSE'
399+
arm64-gnu_debug_ninja:
400+
CMakeLinuxTargetTriple: 'arm64-linux-gnu'
401+
CMakeConfiguration: 'debug'
402+
UsesOpenCV: 'FALSE'
403+
container: 'mcr.microsoft.com/akbuilder-linux:v5-arm64'
404+
# arm64-clang_rel_ninja:
405+
# CMakeLinuxTargetTriple: 'arm64-linux-clang'
406+
# CMakeConfiguration: 'relwithdebinfo'
407+
# UsesOpenCV: 'FALSE'
408+
arm64-gnu_rel_ninja:
409+
CMakeLinuxTargetTriple: 'arm64-linux-gnu'
410+
CMakeConfiguration: 'relwithdebinfo'
411+
UsesOpenCV: 'FALSE'
412+
container: 'mcr.microsoft.com/akbuilder-linux:v5-arm64'
394413

395414
# 32-bit builds are currently broken
396415
# i386-unknown-linux-clang_debug_ninja:
@@ -405,6 +424,9 @@ jobs:
405424
# i386-unknown-linux-gnu_relwithdebinfo_ninja:
406425
# CMakeLinuxTargetTriple: 'i386-linux-gnu'
407426
# CMakeConfiguration: 'relwithdebinfo'
427+
pool:
428+
vmImage: 'ubuntu-18.04'
429+
container: $[ variables['container'] ]
408430

409431
steps:
410432
- checkout: self
@@ -470,7 +492,7 @@ jobs:
470492
ArtifactName: '$(CMakeLinuxTargetTriple)-$(CMakeConfiguration)'
471493
parallel: true
472494
parallelCount: 8
473-
condition: and(succeeded(), contains(variables['CMakeLinuxTargetTriple'], 'clang'))
495+
condition: and(succeeded(), contains(variables['CMakeLinuxTargetTriple'], 'gnu'))
474496

475497
- job: DocumentationBuild
476498
displayName: Documentation Build
@@ -657,41 +679,41 @@ jobs:
657679
inputs:
658680
sourceFolder: "$(System.ArtifactsDirectory)/depthengineplugin/windows/amd64/release/"
659681
contents: "depthengine*.dll"
660-
targetFolder: "$(System.ArtifactsDirectory)/amd64-windows-msvc-RelWithDebInfo/bin"
682+
targetFolder: "$(System.ArtifactsDirectory)/amd64-windows-msvc-relwithdebinfo/bin"
661683
flattenFolders: true
662684

663685
- task: CopyFiles@2
664686
displayName: "Copy DepthEngine into C# functional tests folder"
665687
inputs:
666688
sourceFolder: "$(System.ArtifactsDirectory)/depthengineplugin/windows/amd64/release/"
667689
contents: "depthengine*.dll"
668-
targetFolder: "$(System.ArtifactsDirectory)/amd64-windows-msvc-RelWithDebInfo/bin/Release/Microsoft.AzureKinect.FunctionalTests/netcoreapp2.1/"
690+
targetFolder: "$(System.ArtifactsDirectory)/amd64-windows-msvc-relwithdebinfo/bin/Release/Microsoft.AzureKinect.FunctionalTests/netcoreapp2.1/"
669691
flattenFolders: true
670692

671-
- script: '.\amd64-windows-msvc-RelWithDebInfo\bin\AzureKinectFirmwareTool.exe -r'
693+
- script: '.\amd64-windows-msvc-relwithdebinfo\bin\AzureKinectFirmwareTool.exe -r'
672694
workingDirectory: '$(System.ArtifactsDirectory)'
673695
displayName: 'Reset K4A Device'
674696

675-
- script: '.\amd64-windows-msvc-RelWithDebInfo\bin\AzureKinectFirmwareTool.exe -u firmware/AzureKinectDK_Fw_$(firmware_version).bin'
697+
- script: '.\amd64-windows-msvc-relwithdebinfo\bin\AzureKinectFirmwareTool.exe -u firmware/AzureKinectDK_Fw_$(firmware_version).bin'
676698
workingDirectory: '$(System.ArtifactsDirectory)'
677699
displayName: 'Update Device'
678700

679-
- script: '.\amd64-windows-msvc-RelWithDebInfo\bin\enumerate_devices.exe'
701+
- script: '.\amd64-windows-msvc-relwithdebinfo\bin\enumerate_devices.exe'
680702
workingDirectory: '$(System.ArtifactsDirectory)'
681703
displayName: 'Check Device Health'
682704

683705
- script: 'python $(Build.SourcesDirectory)/scripts/RunTestList.py --list bin/functional_test_list.txt --bin bin/ --output=xml --gtest_filter=-*ONBOARDING*'
684-
workingDirectory: '$(System.ArtifactsDirectory)/amd64-windows-msvc-RelWithDebInfo'
706+
workingDirectory: '$(System.ArtifactsDirectory)/amd64-windows-msvc-relwithdebinfo'
685707
displayName: 'Run Functional Tests'
686708
timeoutInMinutes: 15
687709

688710
- script: 'python $(Build.SourcesDirectory)/scripts/RunTestList.py --list bin/functional_custom_test_list.txt --bin bin/ --output=xml --gtest_filter=-*ONBOARDING*'
689-
workingDirectory: '$(System.ArtifactsDirectory)/amd64-windows-msvc-RelWithDebInfo'
711+
workingDirectory: '$(System.ArtifactsDirectory)/amd64-windows-msvc-relwithdebinfo'
690712
displayName: 'Run Custom Functional Tests'
691713
timeoutInMinutes: 15
692714

693715
- script: 'python $(Build.SourcesDirectory)/scripts/RunTestList.py --list bin/functional_test_list.txt --bin bin/ --output=xml --gtest_filter=*ONBOARDING*'
694-
workingDirectory: '$(System.ArtifactsDirectory)/amd64-windows-msvc-RelWithDebInfo'
716+
workingDirectory: '$(System.ArtifactsDirectory)/amd64-windows-msvc-relwithdebinfo'
695717
displayName: 'Run Functional Tests - Onboarding'
696718
timeoutInMinutes: 15
697719
continueOnError: true
@@ -714,10 +736,19 @@ jobs:
714736
dependsOn: LinuxK4ABuildTest
715737
variables:
716738
firmware_version: "$(linux_firmware_version)"
739+
strategy:
740+
maxParallel: 100
741+
matrix:
742+
x86_64:
743+
CMakeLinuxTargetTriple: 'x86_64-linux-gnu'
744+
EdenArch: 'x64'
745+
arm64:
746+
CMakeLinuxTargetTriple: 'arm64-linux-gnu'
747+
EdenArch: 'arm64'
717748
pool:
718749
name: Analog-FwConnected
719750
demands:
720-
- Eden
751+
- EdenArch -equals $(EdenArch)
721752
- Agent.OS -equals Linux
722753

723754
steps:
@@ -730,7 +761,7 @@ jobs:
730761
- task: DownloadBuildArtifacts@0
731762
displayName: 'Download Build Artifacts'
732763
inputs:
733-
artifactName: 'x86_64-linux-clang-RelWithDebInfo'
764+
artifactName: '$(CMakeLinuxTargetTriple)-relwithdebinfo'
734765
parallelizationLimit: 8
735766

736767
- task: NuGetToolInstaller@0
@@ -755,19 +786,19 @@ jobs:
755786
displayName: "Temp List files"
756787

757788
- task: CopyFiles@2
758-
displayName: "Copy DepthEngine into amd64/debug artifacts folder"
789+
displayName: "Copy DepthEngine into $(EdenArch)/debug artifacts folder"
759790
inputs:
760-
sourceFolder: "$(System.ArtifactsDirectory)/NugetOutputDir/Microsoft.Azure.Kinect.Sensor.$(NuGetPackageVersion)/linux/lib/native/x64/release/"
791+
sourceFolder: "$(System.ArtifactsDirectory)/NugetOutputDir/Microsoft.Azure.Kinect.Sensor.$(NuGetPackageVersion)/linux/lib/native/$(EdenArch)/release/"
761792
contents: "libdepthengine*"
762-
targetFolder: "$(System.ArtifactsDirectory)/depthengineplugin/linux/x86_64/debug"
793+
targetFolder: "$(System.ArtifactsDirectory)/depthengineplugin/linux/$(EdenArch)/debug"
763794
flattenFolders: true
764795

765796
- task: CopyFiles@2
766-
displayName: "Copy DepthEngine into amd64/release artifacts folder"
797+
displayName: "Copy DepthEngine into $(EdenArch)/release artifacts folder"
767798
inputs:
768-
sourceFolder: "$(System.ArtifactsDirectory)/NugetOutputDir/Microsoft.Azure.Kinect.Sensor.$(NuGetPackageVersion)/linux/lib/native/x64/release/"
799+
sourceFolder: "$(System.ArtifactsDirectory)/NugetOutputDir/Microsoft.Azure.Kinect.Sensor.$(NuGetPackageVersion)/linux/lib/native/$(EdenArch)/release/"
769800
contents: "libdepthengine*"
770-
targetFolder: "$(System.ArtifactsDirectory)/depthengineplugin/linux/x86_64/release"
801+
targetFolder: "$(System.ArtifactsDirectory)/depthengineplugin/linux/$(EdenArch)/release"
771802
flattenFolders: true
772803

773804
- task: CopyFiles@2
@@ -788,17 +819,22 @@ jobs:
788819
- task: CopyFiles@2
789820
displayName: "Copy DepthEnginePlugin into Build Artifacts"
790821
inputs:
791-
sourceFolder: "$(System.ArtifactsDirectory)/depthengineplugin/linux/x86_64/release/"
822+
sourceFolder: "$(System.ArtifactsDirectory)/depthengineplugin/linux/$(EdenArch)/release/"
792823
contents: "libdepthengine.so*"
793-
targetFolder: "$(System.ArtifactsDirectory)/x86_64-linux-clang-relwithdebinfo/bin/"
824+
targetFolder: "$(System.ArtifactsDirectory)/$(CMakeLinuxTargetTriple)-relwithdebinfo/bin/"
794825
flattenFolders: true
795826

796-
- script: 'chmod +x ./x86_64-linux-clang-relwithdebinfo/bin/*'
827+
- script: 'chmod +x ./$(CMakeLinuxTargetTriple)-relwithdebinfo/bin/*'
797828
workingDirectory: '$(System.ArtifactsDirectory)'
798829
displayName: 'Add execution property to binary files'
799830

800831
# Set the DISPLAY variable since DepthEngine needs to open a display window (even there is no visual display).
801-
- script: 'echo "##vso[task.setvariable variable=DISPLAY]:0"'
832+
- script: |
833+
if [ $(EdenArch) == "arm64" ]; then
834+
echo "##vso[task.setvariable variable=DISPLAY]:1"
835+
else
836+
echo "##vso[task.setvariable variable=DISPLAY]:0"
837+
fi
802838
workingDirectory: '$(System.ArtifactsDirectory)'
803839
displayName: 'set DISPLAY variable'
804840
@@ -807,34 +843,38 @@ jobs:
807843
displayName: 'Check openGL version'
808844
timeoutInMinutes: 5
809845

810-
- script: './x86_64-linux-clang-relwithdebinfo/bin/AzureKinectFirmwareTool -r'
846+
- script: './$(CMakeLinuxTargetTriple)-relwithdebinfo/bin/AzureKinectFirmwareTool -r'
811847
workingDirectory: '$(System.ArtifactsDirectory)'
812848
displayName: 'Reset K4A Device'
813849
env:
814850
K4A_LOG_LEVEL: 'I'
815851

816-
- script: './x86_64-linux-clang-relwithdebinfo/bin/AzureKinectFirmwareTool -u firmware/AzureKinectDK_Fw_$(firmware_version).bin'
852+
- script: './$(CMakeLinuxTargetTriple)-relwithdebinfo/bin/AzureKinectFirmwareTool -u firmware/AzureKinectDK_Fw_$(firmware_version).bin'
817853
workingDirectory: '$(System.ArtifactsDirectory)'
818854
displayName: 'Update Device'
819855
env:
820856
K4A_LOG_LEVEL: 'I'
821857

822-
- script: './x86_64-linux-clang-relwithdebinfo/bin/enumerate_devices'
858+
- script: './$(CMakeLinuxTargetTriple)-relwithdebinfo/bin/enumerate_devices'
823859
workingDirectory: '$(System.ArtifactsDirectory)'
824860
displayName: 'Check Device Health'
825861

826862
- script: 'python $(Build.SourcesDirectory)/scripts/RunTestList.py --list bin/functional_test_list.txt --bin bin/ --output=xml --gtest_filter=-*ONBOARDING*'
827-
workingDirectory: '$(System.ArtifactsDirectory)/x86_64-linux-clang-relwithdebinfo'
863+
workingDirectory: '$(System.ArtifactsDirectory)/$(CMakeLinuxTargetTriple)-relwithdebinfo'
828864
displayName: 'Run Functional Tests'
829865
timeoutInMinutes: 15
830866

831-
- script: 'python $(Build.SourcesDirectory)/scripts/RunTestList.py --list bin/functional_custom_test_list.txt --bin bin/ --output=xml --gtest_filter=-*ONBOARDING*'
832-
workingDirectory: '$(System.ArtifactsDirectory)/x86_64-linux-clang-relwithdebinfo'
867+
- script: |
868+
# skip testing on ARM64 Jetson Nano doesn't like 2 USB devices running at once.
869+
if [ $(EdenArch) == "x64" ]; then
870+
python $(Build.SourcesDirectory)/scripts/RunTestList.py --list bin/functional_custom_test_list.txt --bin bin/ --output=xml --gtest_filter=-*ONBOARDING*
871+
fi
872+
workingDirectory: '$(System.ArtifactsDirectory)/$(CMakeLinuxTargetTriple)-relwithdebinfo'
833873
displayName: 'Run Custom Functional Tests'
834874
timeoutInMinutes: 15
835875
836876
- script: 'python $(Build.SourcesDirectory)/scripts/RunTestList.py --list bin/functional_test_list.txt --bin bin/ --output=xml --gtest_filter=*ONBOARDING*'
837-
workingDirectory: '$(System.ArtifactsDirectory)/x86_64-linux-clang-relwithdebinfo'
877+
workingDirectory: '$(System.ArtifactsDirectory)/$(CMakeLinuxTargetTriple)-relwithdebinfo'
838878
displayName: 'Run Functional Tests - Onboarding'
839879
timeoutInMinutes: 15
840880
continueOnError: true

cmake/DetermineTargetArch.cmake

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
function(determine_target_arch OUTPUT_VARIABLE)
2+
if("${CMAKE_C_COMPILER_ID}" STREQUAL "MSVC")
3+
if("${MSVC_C_ARCHITECTURE_ID}" STREQUAL "X86")
4+
set(ARCH "i686")
5+
elseif("${MSVC_C_ARCHITECTURE_ID}" STREQUAL "x64")
6+
set(ARCH "x86_64")
7+
elseif("${MSVC_C_ARCHITECTURE_ID}" STREQUAL "ARM")
8+
set(ARCH "arm")
9+
elseif("${MSVC_C_ARCHITECTURE_ID}" STREQUAL "ARM64")
10+
set(ARCH "arm64")
11+
else()
12+
message(FATAL_ERROR "Unrecognized architecture ${MSVC_C_ARCHITECTURE_ID} from ${CMAKE_C_COMPILER}")
13+
endif()
14+
elseif("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang" OR "${CMAKE_C_COMPILER_ID}" STREQUAL "GNU")
15+
if("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang")
16+
set(CMD_ARGS "-target" "${CMAKE_C_COMPILER_TARGET}" "-dumpmachine")
17+
else()
18+
set(CMD_ARGS "-dumpmachine")
19+
endif()
20+
execute_process(
21+
COMMAND
22+
${CMAKE_C_COMPILER} ${CMD_ARGS}
23+
RESULT_VARIABLE
24+
RESULT
25+
OUTPUT_VARIABLE
26+
ARCH
27+
ERROR_QUIET)
28+
if(RESULT)
29+
message(FATAL_ERROR "Failed to determine target architecture triplet: ${RESULT}")
30+
endif()
31+
string(REGEX MATCH "([^-]+).*" ARCH_MATCH ${ARCH})
32+
if(NOT CMAKE_MATCH_1 OR NOT ARCH_MATCH)
33+
message(FATAL_ERROR "Failed to match the target architecture triplet: ${ARCH}")
34+
endif()
35+
set(ARCH ${CMAKE_MATCH_1})
36+
37+
if("${ARCH}" STREQUAL "x86_64")
38+
# Do nothing
39+
elseif("${ARCH}" STREQUAL "aarch64")
40+
set(ARCH "arm64")
41+
elseif("${ARCH}" STREQUAL "i686")
42+
# Do nothing
43+
elseif("${ARCH}" STREQUAL "i386")
44+
# Do nothing
45+
else()
46+
message(FATAL_ERROR "Unrecognized architecture ${ARCH} from ${CMAKE_C_COMPILER}")
47+
endif()
48+
else()
49+
message(FATAL_ERROR "Unrecognized Compiler ${CMAKE_C_COMPILER_ID}")
50+
endif()
51+
message(STATUS "Target architecture - ${ARCH}")
52+
set(${OUTPUT_VARIABLE} ${ARCH} PARENT_SCOPE)
53+
endfunction()
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Copyright (c) Microsoft Corporation. All rights reserved.
2+
# Licensed under the MIT License.
3+
4+
# the name of the target OS and arch
5+
SET(CMAKE_SYSTEM_NAME Linux)
6+
SET(CMAKE_SYSTEM_PROCESSOR arm64)
7+
SET(triple aarch64-linux-gnu)
8+
9+
# which compilers to use
10+
SET(CMAKE_C_COMPILER "clang-6.0")
11+
SET(CMAKE_C_COMPILER_TARGET ${triple})
12+
SET(CMAKE_CXX_COMPILER "clang++-6.0")
13+
SET(CMAKE_CXX_COMPILER_TARGET ${triple})
14+
15+
# Tell pkgconfig to use aarch64
16+
SET(ENV{PKG_CONFIG_PATH} "/usr/lib/aarch64-linux-gnu/pkgconfig")
17+
18+
# Tell CMake to use qemu to emulate
19+
# Note: This should be automatically done by Ubuntu using binfmt_misc, but that
20+
# seems to be broken on WSL (https://github.com/microsoft/WSL/issues/2620) so
21+
# explicitly setting the emulator for now.
22+
SET(CMAKE_CROSSCOMPILING_EMULATOR qemu-aarch64-static)
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Copyright (c) Microsoft Corporation. All rights reserved.
2+
# Licensed under the MIT License.
3+
4+
# the name of the target OS and arch
5+
SET(CMAKE_SYSTEM_NAME Linux)
6+
SET(CMAKE_SYSTEM_PROCESSOR arm64)
7+
8+
# which compilers to use
9+
SET(CMAKE_C_COMPILER aarch64-linux-gnu-gcc)
10+
SET(CMAKE_CXX_COMPILER aarch64-linux-gnu-g++)
11+
12+
# Tell pkgconfig to use arm64
13+
SET(ENV{PKG_CONFIG_PATH} "/usr/lib/aarch64-linux-gnu/pkgconfig")
14+
15+
# Tell CMake to use qemu to emulate
16+
# Note: This should be automatically done by Ubuntu using binfmt_misc, but that
17+
# seems to be broken on WSL (https://github.com/microsoft/WSL/issues/2620) so
18+
# explicitly setting the emulator for now.
19+
SET(CMAKE_CROSSCOMPILING_EMULATOR qemu-aarch64-static)

cmake/toolchains/x86_64-linux-clang.cmake

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,13 @@
44
# the name of the target OS and arch
55
SET(CMAKE_SYSTEM_NAME Linux)
66
SET(CMAKE_SYSTEM_PROCESSOR x86_64)
7+
SET(triple x86_64-linux-gnu)
78

89
# which compilers to use
910
SET(CMAKE_C_COMPILER "clang-6.0")
10-
SET(CMAKE_C_FLAGS -m64)
11+
SET(CMAKE_C_COMPILER_TARGET ${triple})
1112
SET(CMAKE_CXX_COMPILER "clang++-6.0")
12-
SET(CMAKE_CXX_FLAGS -m64)
13+
SET(CMAKE_CXX_COMPILER_TARGET ${triple})
1314

1415
# save flags to cache
1516
SET(CMAKE_C_FLAGS ${CMAKE_C_FLAGS} CACHE STRING "C Flags" FORCE)

0 commit comments

Comments
 (0)