Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use CMAKE_SYSTEM_NAME and CMAKE_SYSTEM_PROCESSOR for cross-compiling #652

Merged
merged 2 commits into from
Jan 31, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 4 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
set(CMAKE_CXX_STANDARD 11)
cmake_minimum_required(VERSION 3.11)

# Set APPLE_ARM to TRUE if running on Apple Silicon
if(APPLE)
execute_process(COMMAND uname -m OUTPUT_VARIABLE OSX_ARCH OUTPUT_STRIP_TRAILING_WHITESPACE)
if (OSX_ARCH STREQUAL "arm64")
set(APPLE_ARM TRUE)
else() # x86_64
set(APPLE_ARM FALSE)
endif()
# Check if CMAKE_SYSTEM_NAME is Darwin (macOS) and CMAKE_SYSTEM_PROCESSOR is arm64
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND CMAKE_SYSTEM_PROCESSOR STREQUAL "arm64")
set(APPLE_ARM TRUE)
else()
set(APPLE_ARM FALSE)
endif(APPLE)
endif()

# Set the project name and language
if(APPLE)
Loading