1
0
mirror of https://github.com/RPCS3/rpcs3.git synced 2024-11-22 02:32:36 +01:00

[macOS] Ask CMake to look in the right place for include & link directories (#12516)

* Ask CMake to look in the right place for include_directories and link_directories on macOS (arm64 and x86_64)

Homebrew installs to a different location on Arm Macs compared to Intel Macs. 

This change prevents this error when compiling on Arm:   
`ld: warning: directory not found for option '-L/opt/local/lib'`

Use STREQUAL instead of MATCHES, since MATCHES is supposed to be used with regular expressions. 

Also update the homebrew directories for Intel, since they were wrong.

Remove the conditional check for x86 Apple, as usr/local is part of the default search path.
Tested on Intel and the warning does not appear.
This commit is contained in:
shinra-electric 2022-09-26 19:07:05 +02:00 committed by GitHub
parent c996be321c
commit db9389d24c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -104,9 +104,9 @@ if(WIN32)
add_definitions(-D_WIN32_WINNT=0x0602) add_definitions(-D_WIN32_WINNT=0x0602)
endif() endif()
if(APPLE) if(APPLE AND CMAKE_OSX_ARCHITECTURES STREQUAL "arm64")
include_directories(/opt/local/include) include_directories(/opt/homebrew/include)
link_directories(/opt/local/lib) link_directories(/opt/homebrew/lib)
endif() endif()
# Warnings are silenced for 3rdparty code # Warnings are silenced for 3rdparty code