-
-
Notifications
You must be signed in to change notification settings - Fork 473
Closed
Labels
Description
Describe the bug
Using XCode 13.3 and building for Catalyst, default deployment target will make clang raise an error.
To Reproduce
Steps to reproduce the behavior:
- Use XCode 13.3
- Build something with platform
MAC_CATALYST - Build fails, with error
FAILED: CMakeFiles/cmTC_48a6c.dir/testCCompiler.c.o
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang --target=x86_64-apple-ios13.0-macabi -isystem /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/System/iOSSupport/usr/include -iframework /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/System/iOSSupport/System/Library/Frameworks -target x86_64-apple-ios13.0-macabi -fobjc-abi-version=2 -fobjc-arc -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk -MD -MT CMakeFiles/cmTC_48a6c.dir/testCCompiler.c.o -MF CMakeFiles/cmTC_48a6c.dir/testCCompiler.c.o.d -o CMakeFiles/cmTC_48a6c.dir/testCCompiler.c.o -c /Users/canarypwn/Desktop/Kyaru/Texture2DDecoder/build/apple-MAC_CATALYST/CMakeFiles/CMakeTmp/testCCompiler.c
clang: error: invalid version number in '-target x86_64-apple-ios13.0-macabi'
Expected behavior
It builds successfully.
Environment
xcode version
Xcode 13.3
Build version 13E113
clang version
Apple clang version 13.1.6 (clang-1316.0.21.2)
Target: x86_64-apple-darwin21.4.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
- What version of CMake did you run?
cmake version 3.23.0
- Your faulty CMakeLists.txt here:
cmake_minimum_required(VERSION 3.13)
project(Texture2DDecoderNative)
set(CMAKE_CXX_STANDARD 17)
add_compile_definitions(_T2D_DLL)
# https://cmake.org/cmake/help/latest/guide/tutorial/Selecting%20Static%20or%20Shared%20Libraries.html
option(BUILD_SHARED_LIBS "Build using shared libraries" ON)
add_library(Texture2DDecoderNative
astc.cpp
atc.cpp
bcn.cpp
crunch.cpp
dllmain.cpp
etc.cpp
pvrtc.cpp
unitycrunch.cpp)
# Important: If compiling with gcc, be sure strict aliasing is disabled: -fno-strict-aliasing
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
set_target_properties(Texture2DDecoderNative PROPERTIES COMPILE_FLAGS "${COMPILE_FLAGS} -fno-strict-aliasing")
endif()
target_include_directories(Texture2DDecoderNative PRIVATE ${PROJECT_SOURCE_DIR})
install(TARGETS Texture2DDecoderNative DESTINATION ${CMAKE_INSTALL_LIBDIR})