Skip to content

Commit 152ca7e

Browse files
committed
better intel macos support
1 parent 05a63dc commit 152ca7e

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

examples/xcSSP.cmake

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
if(APPLE)
23
set(CMAKE_SYSTEM_NAME Darwin)
34
endif()
@@ -7,8 +8,8 @@ if (DEFINED ENV{BUILDROOT})
78
set(BUILDROOT $ENV{BUILDROOT})
89
set(CMAKE_SYSROOT ${BUILDROOT}/arm-rockchip-linux-gnueabihf/sysroot)
910
else ()
10-
message("warning: BUILDROOT environment variable assuming in current directory")
11-
set(BUILDROOT "$ENV{HOME}/buildroot/output/host")
11+
message("warning: BUILDROOT environment variable assuming in $ENV{HOME}/buildroot")
12+
set(BUILDROOT "$ENV{HOME}/buildroot/arm-rockchip-linux-gnueabihf_sdk-buildroot")
1213
set(CMAKE_SYSROOT ${BUILDROOT}/arm-rockchip-linux-gnueabihf/sysroot)
1314
endif ()
1415

@@ -18,10 +19,11 @@ else ()
1819
# sensible defaults
1920
if (CMAKE_SYSTEM_NAME STREQUAL "Darwin")
2021
# assume we are using homebrew
21-
set(TOOLSROOT /opt/homebrew/opt/llvm/bin)
22-
# non m1 macs need this instead, but you could also set TOOLS_ROOT
23-
# set(TOOLSROOT /usr/local/opt/llvm/bin)
24-
22+
if (${CMAKE_HOST_SYSTEM_PROCESSOR} MATCHES "arm64")
23+
set(TOOLSROOT /opt/homebrew/opt/llvm/bin)
24+
else ()
25+
set(TOOLSROOT /usr/local/opt/llvm/bin)
26+
endif()
2527
elseif (CMAKE_SYSTEM_NAME STREQUAL "Linux")
2628
set(TOOLSROOT "/usr/bin")
2729
endif ()

0 commit comments

Comments
 (0)