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

Cmake error in Xcode 6.2 #201

Open
startergo opened this issue May 17, 2024 · 5 comments
Open

Cmake error in Xcode 6.2 #201

startergo opened this issue May 17, 2024 · 5 comments
Assignees
Labels

Comments

@startergo
Copy link

startergo commented May 17, 2024

Describe the bug

The C compiler

    "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang"

  is not able to compile a simple test program.

To Reproduce
Steps to reproduce the behavior:

  1. Install toolchain in Mavericks:
cmake -B build -G Xcode -DCMAKE_TOOLCHAIN_FILE=../../ios.toolchain.cmake -DPLATFORM=MAC

Expected behavior
-- Build files have been written to:

Environment

  • What version of CMake did you run? 3.29.3
  • Your faulty CMakeLists.txt here:
cmake -B build -G Xcode -DCMAKE_TOOLCHAIN_FILE=../../ios.toolchain.cmake -DPLATFORM=MAC
-- [DEFAULTS] Using explicit named language support! E.g., enable_language(CXX) is needed in the project files.
-- [DEFAULTS] Using the default min-version since DEPLOYMENT_TARGET not provided!
-- [DEFAULTS] Disabling bitcode support by default. ENABLE_BITCODE not provided for override!
-- [DEFAULTS] Enabling ARC support by default. ENABLE_ARC not provided!
-- [DEFAULTS] Hiding symbols visibility by default. ENABLE_VISIBILITY not provided!
-- [DEFAULTS] Using NON-strict compiler checks by default. ENABLE_STRICT_TRY_COMPILE not provided!
-- Not setting any manual command-line buildflags, since Xcode is selected as the generator. Modifying the Xcode build-settings directly instead.
-- Configuring macosx build for platform: MAC, architecture(s): x86_64
-- Using SDK: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk
-- Using C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
-- Using CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++
-- Using libtool: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool
-- Using install name tool: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool
-- Autoconf target triple: x86_64-apple-macosx11.0
-- Using minimum deployment version: 11.0 (SDK version: 10.10)
-- Merging integrated CMake 3.14+ iOS,tvOS,watchOS,macOS toolchain(s) with this toolchain!
-- Using Xcode version: 6.2
-- CMake version: 3.29.3
-- Using a data_ptr size of: 8
-- Bitcode: Disabled
-- ARC: Enabled
-- Hiding symbols: Enabled
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - failed
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang - broken
CMake Error at /opt/local/share/cmake-3.29/Modules/CMakeTestCCompiler.cmake:67 (message):
  The C compiler

    "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: '/Users/mavericks/ios-cmake/example/example-lib/build/CMakeFiles/CMakeScratch/TryCompile-Jbv4Pp'
    
    Run Build Command(s): /usr/bin/xcodebuild -project CMAKE_TRY_COMPILE.xcodeproj build -target cmTC_97955 -configuration Debug
    === BUILD TARGET cmTC_97955 OF PROJECT CMAKE_TRY_COMPILE WITH CONFIGURATION Debug ===
    
    Check dependencies
    OS X deployment target '11.0' for architecture 'x86_64' and variant 'normal' is greater than the maximum value '10.10' for the OS X 10.10 SDK.
    
    Write auxiliary files
    /bin/mkdir -p /Users/mavericks/ios-cmake/example/example-lib/build/CMakeFiles/CMakeScratch/TryCompile-Jbv4Pp/build/cmTC_97955.build/Debug/Objects-normal/x86_64
    write-file /Users/mavericks/ios-cmake/example/example-lib/build/CMakeFiles/CMakeScratch/TryCompile-Jbv4Pp/build/cmTC_97955.build/Debug/Objects-normal/x86_64/cmTC_97955.LinkFileList
    
    CompileC build/cmTC_97955.build/Debug/Objects-normal/x86_64/testCCompiler.o testCCompiler.c normal x86_64 c com.apple.compilers.llvm.clang.1_0.compiler
        cd /Users/mavericks/ios-cmake/example/example-lib/build/CMakeFiles/CMakeScratch/TryCompile-Jbv4Pp
        export LANG=en_US.US-ASCII
        /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x c -arch x86_64 -fmessage-length=0 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit=0 -Wno-trigraphs -fpascal-strings -O0 -Wno-missing-field-initializers -Wno-missing-prototypes -Wno-return-type -Wno-missing-braces -Wparentheses -Wswitch -Wno-unused-function -Wno-unused-label -Wno-unused-parameter -Wno-unused-variable -Wunused-value -Wno-empty-body -Wno-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wno-constant-conversion -Wno-int-conversion -Wno-bool-conversion -Wno-enum-conversion -Wno-shorten-64-to-32 -Wpointer-sign -Wno-newline-eof -DCMAKE_INTDIR=\"Debug\" -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk -fasm-blocks -fstrict-aliasing -Wdeprecated-declarations -mmacosx-version-min=11.0 -Wno-sign-conversion -I/Users/mavericks/ios-cmake/example/example-lib/build/CMakeFiles/CMakeScratch/TryCompile-Jbv4Pp/Debug/include -I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include -I/Users/mavericks/ios-cmake/example/example-lib/build/CMakeFiles/CMakeScratch/TryCompile-Jbv4Pp/build/cmTC_97955.build/Debug/DerivedSources/x86_64 -I/Users/mavericks/ios-cmake/example/example-lib/build/CMakeFiles/CMakeScratch/TryCompile-Jbv4Pp/build/cmTC_97955.build/Debug/DerivedSources -F/Users/mavericks/ios-cmake/example/example-lib/build/CMakeFiles/CMakeScratch/TryCompile-Jbv4Pp/Debug -MMD -MT dependencies -MF /Users/mavericks/ios-cmake/example/example-lib/build/CMakeFiles/CMakeScratch/TryCompile-Jbv4Pp/build/cmTC_97955.build/Debug/Objects-normal/x86_64/testCCompiler.d --serialize-diagnostics /Users/mavericks/ios-cmake/example/example-lib/build/CMakeFiles/CMakeScratch/TryCompile-Jbv4Pp/build/cmTC_97955.build/Debug/Objects-normal/x86_64/testCCompiler.dia -c /Users/mavericks/ios-cmake/example/example-lib/build/CMakeFiles/CMakeScratch/TryCompile-Jbv4Pp/testCCompiler.c -o /Users/mavericks/ios-cmake/example/example-lib/build/CMakeFiles/CMakeScratch/TryCompile-Jbv4Pp/build/cmTC_97955.build/Debug/Objects-normal/x86_64/testCCompiler.o
    clang: error: invalid version number in '-mmacosx-version-min=11.0'
    Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang failed with exit code 1
    
    ** BUILD FAILED **
    
    
    The following build commands failed:
    	CompileC build/cmTC_97955.build/Debug/Objects-normal/x86_64/testCCompiler.o testCCompiler.c normal x86_64 c com.apple.compilers.llvm.clang.1_0.compiler
    (1 failure)
    
    

  

  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:2 (project)
@kambala-decapitator
Copy link

Dunno what you need such ancient xcode / compiler for, but try setting deployment target to 10.10, as this is your issue:

OS X deployment target '11.0' for architecture 'x86_64' and variant 'normal' is greater than the maximum value '10.10' for the OS X 10.10 SDK.

@startergo
Copy link
Author

startergo commented May 17, 2024

Thanks where should I do that? I am trying to compile an Xcode project which is broken if I run it in Sonoma. So I decided to go back to the toolchain it was supposed to compile with. The problem is I can't sign in Xcode in Mavericks.

@kambala-decapitator
Copy link

Additionally pass -D DEPLOYMENT_TARGET=10.10 to the cmake invocation

Still not sure why you're using such an ancient macos version, but that's not my business :)

@startergo
Copy link
Author

This is not a project I am trying to run. It s a part of the installation process I.e. this is an internal code for testing the installation of cmake ran automatically upon installation. Thanks for the tip though.

@kambala-decapitator
Copy link

btw for macOS you don't even really need this toolchain - cmake works just fine out of the box

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants