CMake не будет настраиваться, когда appletvos установлен как системный корень osx - PullRequest
0 голосов
/ 19 декабря 2018

Я пытаюсь настроить самый простой проект cmake:

cmake_minimum_required(VERSION 3.12)
enable_language(C)

Когда я пытаюсь настроить этот проект cmake со следующими аргументами:

 cmake -DCMAKE_OSX_SYSROOT=appletvos -DCMAKE_OSX_ARCHITECTURES=arm64 -GNinja ..

Я получаю следующую ошибкучто я могу исправить вручную, удалив флаг -arch armv7 в результирующем файле CMakeCache.txt.Кто-нибудь знает, почему этот флаг добавляется и есть ли способ программно удалить его с помощью вышеуказанной команды cmake?

-- The C compiler identification is AppleClang 10.0.0.10001145
-- The CXX compiler identification is AppleClang 10.0.0.10001145
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/usr/bin/gcc
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/usr/bin/gcc -- broken
CMake Error at /usr/local/Cellar/cmake/3.12.2/share/cmake/Modules/CMakeTestCCompiler.cmake:52 (message):
  The C compiler

    "/Applications/Xcode.app/Contents/Developer/usr/bin/gcc"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: /Users/Phil/work/build/CMakeFiles/CMakeTmp

    Run Build Command:"/usr/local/bin/ninja" "cmTC_fb5c2"
    [1/2] Building C object CMakeFiles/cmTC_fb5c2.dir/testCCompiler.c.o
    [2/2] Linking C executable cmTC_fb5c2
    FAILED: : && /Applications/Xcode.app/Contents/Developer/usr/bin/gcc  -arch armv7 -mtvos-version-min=10.2 -fembed-bitcode -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS12.1.sdk -Wl,-search_paths_first -Wl,-headerpad_max_install_names  CMakeFiles/cmTC_fb5c2.dir/testCCompiler.c.o  -o cmTC_fb5c2   && :
    ld: warning: -headerpad_max_install_names is ignored when used with -bitcode_bundle (Xcode setting ENABLE_BITCODE=YES)
    ld: warning: ignoring file /Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS12.1.sdk/usr/lib/libSystem.tbd, missing required architecture armv7 in file /Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS12.1.sdk/usr/lib/libSystem.tbd
    ld: dynamic main executables must link with libSystem.dylib for architecture armv7
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    ninja: build stopped: subcommand failed.




  CMake will not be able to correctly generate this project.


-- Configuring incomplete, errors occurred!
See also "/Users/Phil/work/build/CMakeFiles/CMakeOutput.log".
See also "/Users/Phil/work/build/CMakeFiles/CMakeError.log".
...