Skip to content

Conversation

@FtZPetruska
Copy link
Contributor

@FtZPetruska FtZPetruska commented Mar 4, 2023

This PR allows user to edit the value of CMAKE_OSX_DEPLOYMENT_TARGET. It leaves the default of 10.15, but removes the FORCE keyword, allowing users to change the value through passing -DCMAKE_OSX_DEPLOYMENT_TARGET="<version>" to the command line, using environment variables, or by editing the cache.

The reason this change could be useful is that Homebrew libraries are built against your OS's current version SDK, which leads to the following warnings when linking the executable:

[1276/1276] Linking CXX executable soh/soh-macos
ld: warning: dylib (/opt/homebrew/lib/libSDL2.dylib) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: dylib (/opt/homebrew/lib/libSDL2.dylib) was built for newer macOS version (13.0) than being linked (11.0)
ld: warning: dylib (/opt/homebrew/lib/libGLEW.2.2.0.dylib) was built for newer macOS version (13.0) than being linked (11.0)

(Note that arm64 builds have to target 11.0 or above)

Build Artifacts

This leaves the default of 10.15, but allows a user to change it in the
cache. When using Homebrew libraries on newer macOS version, the linker
emits warnings:

```
ld: warning: dylib (/opt/homebrew/lib/libSDL2.dylib) was built
for newer macOS version (13.0) than being linked (11.0)
```
Copy link
Contributor

@dcvz dcvz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! No harm in not forcing this, will also help anyone trying to make this run sub 10.15 :)

@dcvz
Copy link
Contributor

dcvz commented Mar 4, 2023

Also cool to see another macOS dev :) thanks for the PR @FtZPetruska

@dcvz dcvz merged commit dbcc6b4 into HarbourMasters:develop Mar 5, 2023
@FtZPetruska FtZPetruska deleted the macos-deploy-target branch March 5, 2023 20:13
leggettc18 pushed a commit to leggettc18/Shipwright that referenced this pull request Mar 10, 2023
This leaves the default of 10.15, but allows a user to change it in the
cache. When using Homebrew libraries on newer macOS version, the linker
emits warnings:

```
ld: warning: dylib (/opt/homebrew/lib/libSDL2.dylib) was built
for newer macOS version (13.0) than being linked (11.0)
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants