@@ -2,22 +2,34 @@ project (sc-machine)
22site_name (www.ostis.net)
33cmake_minimum_required (VERSION 2.8)
44
5- include (CTest)
5+ include (CTest)
6+ include (CheckCCompilerFlag)
67
7- set (SC_BIN_PATH "${CMAKE_CURRENT_LIST_DIR} /bin" )
8+ set (SC_BIN_PATH "${CMAKE_CURRENT_LIST_DIR} /bin" )
89
9- set (SC_MACHINE_ROOT ${CMAKE_CURRENT_LIST_DIR} )
10- set (SC_MACHINE_THIRDPARTY_PATH "${SC_MACHINE_ROOT} /thirdparty" )
10+ set (SC_MACHINE_ROOT ${CMAKE_CURRENT_LIST_DIR} )
11+ set (SC_MACHINE_THIRDPARTY_PATH "${SC_MACHINE_ROOT} /thirdparty" )
1112
1213option (SC_AUTO_TEST "Flag to build for automation testing" OFF )
1314option (SC_KPM_SCP "Flag to build SCP module" OFF )
1415option (SC_BUILD_SCTP "Flag to turn on/off sctp protocol support" OFF )
16+ option (SC_BUILD_ARM64 "Flag to build arm64" OFF )
1517
1618set (SC_USE_SANITIZER "none" CACHE STRING "Build with specified sanitizer" )
1719set_property (CACHE SC_USE_SANITIZER PROPERTY STRINGS none address memory)
1820
1921message ("Sanitizer: ${SC_USE_SANITIZER} " )
2022
23+ if (${SC_BUILD_ARM64} )
24+ check_c_compiler_flag("-arch arm64" IS_ARM64_SUPPORTED)
25+ if (${IS_ARM64_SUPPORTED} )
26+ set (CMAKE_OSX_ARCHITECTURES "arm64" CACHE STRING "Used architecture" FORCE)
27+ message ("-- Architecture: arm64" )
28+ else ()
29+ message (FATAL_ERROR "Arm64 platform is not supported by compiler" )
30+ endif ()
31+ endif ()
32+
2133# codegen
2234if (${UNIX} )
2335 set (SC_CODEGEN_TOOL "${SC_BIN_PATH} /sc-code-generator" )
@@ -91,7 +103,6 @@ if (${APPLE})
91103
92104 set (GLIB2_LIBRARIES ${GLIB_LDFLAGS} ${GLIB2_MODULE_LDFLAGS} )
93105
94- set (LIBCLANG_LLVM_CONFIG_EXECUTABLE "/usr/local/opt/llvm/bin/llvm-config" )
95106 if (NOT DEFINED LIBCLANG_LIBRARIES OR NOT DEFINED LIBCLANG_CXXFLAGS OR NOT DEFINED LIBCLANG_LIBDIR)
96107 find_package (LibClang REQUIRED)
97108 endif ()
0 commit comments