1
0
mirror of https://github.com/RPCS3/rpcs3.git synced 2024-11-24 11:43:05 +01:00

build-macos: fix cmake config for arm64

This commit is contained in:
sguo35 2022-04-04 12:36:13 -07:00 committed by Ivan
parent afae58b231
commit 219ddf3e11
2 changed files with 16 additions and 5 deletions

2
3rdparty/llvm.cmake vendored
View File

@ -70,7 +70,7 @@ if(WITH_LLVM)
endif() endif()
if(COMPILER_ARM) if(COMPILER_ARM)
set(LLVM_LIBS ${LLVM_LIBS} LLVMX86CodeGen LLVMX86AsmParser LLVMARMCodeGen LLVMARMAsmParser) set(LLVM_LIBS ${LLVM_LIBS} LLVMX86CodeGen LLVMX86AsmParser LLVMARMCodeGen LLVMARMAsmParser LLVMAArch64CodeGen LLVMAArch64AsmParser)
endif() endif()
if(WIN32 OR CMAKE_SYSTEM MATCHES "Linux") if(WIN32 OR CMAKE_SYSTEM MATCHES "Linux")

View File

@ -21,7 +21,11 @@ else()
CHECK_CXX_COMPILER_FLAG("-no-pie" HAS_NO_PIE) CHECK_CXX_COMPILER_FLAG("-no-pie" HAS_NO_PIE)
CHECK_CXX_COMPILER_FLAG("-march=native" COMPILER_SUPPORTS_MARCH_NATIVE) CHECK_CXX_COMPILER_FLAG("-march=native" COMPILER_SUPPORTS_MARCH_NATIVE)
CHECK_CXX_COMPILER_FLAG("-msse -msse2 -mcx16" COMPILER_X86) CHECK_CXX_COMPILER_FLAG("-msse -msse2 -mcx16" COMPILER_X86)
CHECK_CXX_COMPILER_FLAG("-march=armv8.1-a" COMPILER_ARM) if (APPLE)
CHECK_CXX_COMPILER_FLAG("-march=armv8.4-a" COMPILER_ARM)
else()
CHECK_CXX_COMPILER_FLAG("-march=armv8.1-a" COMPILER_ARM)
endif()
add_compile_options(-Wall) add_compile_options(-Wall)
add_compile_options(-fno-exceptions) add_compile_options(-fno-exceptions)
@ -32,7 +36,11 @@ else()
endif() endif()
if (COMPILER_ARM) if (COMPILER_ARM)
add_compile_options(-march=armv8.1-a) if (APPLE)
add_compile_options(-march=armv8.4-a)
else()
add_compile_options(-march=armv8.1-a)
endif()
endif() endif()
add_compile_options(-Werror=old-style-cast) add_compile_options(-Werror=old-style-cast)
@ -93,8 +101,11 @@ else()
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
add_compile_options(-stdlib=libc++) add_compile_options(-stdlib=libc++)
endif() endif()
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-image_base,0x10000 -Wl,-pagezero_size,0x10000")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-no_pie") if (CMAKE_OSX_ARCHITECTURES MATCHES "x86_64")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-image_base,0x10000 -Wl,-pagezero_size,0x10000")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-no_pie")
endif()
elseif(WIN32) elseif(WIN32)
set(CMAKE_RC_COMPILER_INIT windres) set(CMAKE_RC_COMPILER_INIT windres)
enable_language(RC) enable_language(RC)