Skip to content

Commit

Permalink
start adding support for macOS in CMake
Browse files Browse the repository at this point in the history
Recognize macOS as a platform and take actions accordingly.
  • Loading branch information
midwan committed Dec 10, 2023
1 parent a4d9bc1 commit 9fe0379
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,16 @@ detect_architecture("__x86_64__" x86_64)
detect_architecture("__aarch64__" arm64)
message(STATUS "Target architecture: ${ARCHITECTURE}")

if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set(MACOS TRUE)
message(STATUS "macOS platform detected")
if (CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64" OR ARCHITECTURE MATCHES "arm64")
set(CMAKE_EXE_LINKER_FLAGS "-L/usr/local/lib external/libguisan/dylib/libguisan.dylib -L/opt/homebrew/lib/ -framework IOKit -framework Foundation")
else()
set(CMAKE_EXE_LINKER_FLAGS "-L/usr/local/lib external/libguisan/dylib/libguisan.dylib -framework IOKit -framework Foundation")
endif()
endif()

add_executable(${PROJECT_NAME}
src/a2065.cpp
src/a2091.cpp
Expand Down

0 comments on commit 9fe0379

Please sign in to comment.