Mac M1 build fix proposal avoiding mixing up with homwbrew for Rosetta

as well.
This commit is contained in:
David CARLIER 2021-01-09 22:31:21 +00:00
parent b77bd9816d
commit 2899cf8977
5 changed files with 24 additions and 14 deletions

View File

@ -42,11 +42,21 @@ CMAKE_DEPENDENT_OPTION(USE_WIIUSE "Support for wiimote input devices" ON
"NOT SERVER_ONLY;NOT CYGWIN" OFF)
if(APPLE AND NOT IOS)
list(APPEND CMAKE_PREFIX_PATH /usr/local/opt)
include_directories(/usr/local/opt/openssl@1.1/include/)
include_directories(/usr/local/opt/openssl@1.1/include/openssl/)
include_directories(/usr/local/opt/freetype/include/freetype2/)
include_directories(/usr/local/opt/harfbuzz/include/harfbuzz/)
if(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "arm")
set(ARCHFLAGS "arm64")
list(APPEND CMAKE_PREFIX_PATH /opt/homebrew/opt)
include_directories(/opt/homebrew/opt/openssl@1.1/include/)
include_directories(/opt/homebrew/opt/openssl@1.1/include/openssl/)
include_directories(/opt/homebrew/opt/freetype/include/freetype2/)
include_directories(/opt/homebrew/opt/harfbuzz/include/harfbuzz/)
else()
set(ARCHFLAGS "${CMAKE_SYSTEM_PROCESSOR}")
list(APPEND CMAKE_PREFIX_PATH /usr/local/opt)
include_directories(/usr/local/opt/openssl@1.1/include/)
include_directories(/usr/local/opt/openssl@1.1/include/openssl/)
include_directories(/usr/local/opt/freetype/include/freetype2/)
include_directories(/usr/local/opt/harfbuzz/include/harfbuzz/)
endif()
endif()
if (IOS)
@ -317,8 +327,8 @@ endif()
include_directories(${STK_SOURCE_DIR})
if(APPLE AND NOT IOS)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -arch x86_64")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -arch x86_64 -F/Library/Frameworks")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -arch ${ARCHFLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -arch ${ARCHFLAGS} -F/Library/Frameworks")
elseif(MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP") # Enable multi-processor compilation (faster)
endif()

View File

@ -116,7 +116,7 @@ if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "^arm")
enable_language(ASM)
if(CMAKE_ASM_COMPILER_WORKS)
set(ANGELSCRIPT_SOURCE ${ANGELSCRIPT_SOURCE} ../../source/as_callfunc_arm.cpp ../../source/as_callfunc_arm_gcc.S)
if (NOT IOS)
if (NOT APPLE)
set_property(SOURCE ../../source/as_callfunc_arm_gcc.S APPEND PROPERTY COMPILE_FLAGS " -Wa,-mimplicit-it=always")
endif()
else()

View File

@ -3,8 +3,8 @@
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src/)
if(APPLE AND NOT IOS)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -arch x86_64")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -arch x86_64 -F/Library/Frameworks")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -arch ${ARCHFLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -arch ${ARCHFLAGS} -F/Library/Frameworks")
endif()
# libbulletmath

View File

@ -25,8 +25,8 @@ else()
endif()
if(APPLE AND NOT IOS)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -arch x86_64")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -arch x86_64 -F/Library/Frameworks")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -arch ${ARCHFLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -arch ${ARCHFLAGS} -F/Library/Frameworks")
endif()
if(HAS_FCNTL)

View File

@ -29,8 +29,8 @@ endif()
if(APPLE AND NOT IOS)
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/source/Irrlicht/MacOSX" "${CMAKE_CURRENT_SOURCE_DIR}/source/Irrlicht")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -arch x86_64")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -arch x86_64 -F/Library/Frameworks")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -arch ${ARCHFLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -arch ${ARCHFLAGS} -F/Library/Frameworks")
endif()
add_definitions(-DNDEBUG=1 -DIRRLICHT_EXPORTS=1 -DPNG_THREAD_UNSAFE_OK -DPNG_NO_MMX_CODE -DPNG_NO_MNG_FEATURES)