Skip to content

Commit

Permalink
OS X: fix homebrew paths in project configuration
Browse files Browse the repository at this point in the history
Apple Silicon and Intel-based Macs seem to have different paths where
Homebrew can be installed. On Intel-based Macs it may lead to the
following error:

ld: warning: search path '/opt/homebrew/lib' not found
  • Loading branch information
gerbert committed Nov 13, 2024
1 parent eb4cf37 commit 08916cf
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions QLog.pro
Original file line number Diff line number Diff line change
Expand Up @@ -469,8 +469,15 @@ macx: {
INSTALLS += target
}

INCLUDEPATH += /usr/local/include /opt/homebrew/include
LIBS += -L/usr/local/lib -L/opt/homebrew/lib -lhamlib -lsqlite3
# If the host is Apple Silicon, Homebrew will likely be installed
# within /opt/homebrew path
isEqual($$system(uname -m), "arm64") {
INCLUDEPATH += /usr/local/include /opt/homebrew/include
LIBS += -L/usr/local/lib -L/opt/homebrew/lib -lhamlib -lsqlite3
} else {
INCLUDEPATH += /usr/local/include
LIBS += -L/usr/local/lib -lhamlib -lsqlite3
}
equals(QT_MAJOR_VERSION, 6): LIBS += -lqt6keychain
equals(QT_MAJOR_VERSION, 5): LIBS += -lqt5keychain
DISTFILES +=
Expand Down

0 comments on commit 08916cf

Please sign in to comment.