Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix erroneous test for XCode 15.1 #145

Merged
merged 1 commit into from
Mar 31, 2024
Merged

Conversation

asimilon
Copy link
Contributor

@asimilon asimilon commented Mar 30, 2024

With Xcode 15.3 installed:

/usr/bin/c++ --version
Apple clang version 15.0.0 (clang-1500.3.9.4)

CMake reports:

-- The C compiler identification is AppleClang 15.0.0.15000309
-- The CXX compiler identification is AppleClang 15.0.0.15000309

Hence this test does not work as intended:
if( ${CMAKE_CXX_COMPILER_VERSION} VERSION_GREATER_EQUAL "15.0.0" AND ${CMAKE_CXX_COMPILER_VERSION} VERSION_LESS "15.1")

To confirm my suspicions about how the version number is reported by Apple Clang I booted into an old install running Xcode 14.2:

/usr/bin/c++ --version
Apple clang version 14.0.0 (clang-1400.0.29.202)

which CMake reports as:

-- The C compiler identification is AppleClang 14.0.0.14000029
-- The CXX compiler identification is AppleClang 14.0.0.14000029

so the real version number of Clang is in the 4th part, and takes the format for 2 digits for each part, dropping the final part from the longer number reported from --version.

I think this revised test is OK, although I was unable to test against a relevant version of Xcode that needs the linker flags and change of deployment target.

@asimilon
Copy link
Contributor Author

btw I found this list of Xcode and corresponding Clang versions, which shows:

# Xcode 15.1 (15C65) 
Apple clang version 15.0.0 (clang-1500.1.0.2.5)

so I think that the corresponding CMAKE_CXX_COMPILER_VERSION for this version would be 15.0.0.15000100 and my updated version test should hold, as both the prior Xcode versions are:

# Xcode 15.0 (15A240d)
Apple clang version 15.0.0 (clang-1500.0.40.1)

which should show as 15.0.0.15000040 (assuming there is logic to the Apple Clang version number!)

@jatinchowdhury18
Copy link
Collaborator

Thanks for looking into this! The change appears correct to me, but I'd prefer to wait for Paul to have a look before merging.

@baconpaul
Copy link
Collaborator

I’m on vaca right now but it also looks correct esp with the crazy cmake versions whic we guessed before Xcode 15.1 even shipped! Let’s merge it.

@baconpaul baconpaul merged commit 8d0754f into free-audio:main Mar 31, 2024
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants