質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
CMake

CMakeはクロスプラットフォームで作動するオープンソースのビルドシステムです。コマンドライン又は組み込まれた開発環境で使うことができる元のmakefileとプロジェクトファイルを生成します。

Xcode

Xcodeはソフトウェア開発のための、Appleの統合開発環境です。Mac OSXに付随するかたちで配布されています。

Q&A

解決済

1回答

1563閲覧

XcodeProjectのcmakeでエラー:No architectures to compile for (ONLY_ACTIVE_ARCH=YES, active arch=arm64, ...

goto-c

総合スコア3

CMake

CMakeはクロスプラットフォームで作動するオープンソースのビルドシステムです。コマンドライン又は組み込まれた開発環境で使うことができる元のmakefileとプロジェクトファイルを生成します。

Xcode

Xcodeはソフトウェア開発のための、Appleの統合開発環境です。Mac OSXに付随するかたちで配布されています。

0グッド

0クリップ

投稿2020/09/24 08:02

前提・実現したいこと

Xcodeでプロジェクトを進めているのですが、今まで正常にcmakeでビルドできていたものが、エラーをはくようになってしまいました。

発生している問題・エラーメッセージ

エラーメッセージ全文

$ cmake -G Xcode .. -- The C compiler identification is AppleClang 12.0.0.12000032 -- The CXX compiler identification is AppleClang 12.0.0.12000032 -- 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 /usr/local/Cellar/cmake/3.17.2/share/cmake/Modules/CMakeTestCCompiler.cmake:60 (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/Namae/Desktop/OpenGL/build/CMakeFiles/CMakeTmp Run Build Command(s):/usr/bin/xcodebuild -project CMAKE_TRY_COMPILE.xcodeproj build -target cmTC_bc0d2 -configuration Debug -hideShellScriptEnvironment && Command line invocation: /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -project CMAKE_TRY_COMPILE.xcodeproj build -target cmTC_bc0d2 -configuration Debug -hideShellScriptEnvironment User defaults from command line: HideShellScriptEnvironment = YES Prepare build note: The Legacy Build System will be removed in a future release. You can configure the selected build system and this deprecation message in File > Project Settings. === BUILD TARGET cmTC_bc0d2 OF PROJECT CMAKE_TRY_COMPILE WITH CONFIGURATION Debug === Check dependencies No architectures to compile for (ONLY_ACTIVE_ARCH=YES, active arch=arm64, VALID_ARCHS=arm64 arm64e i386 x86_64, EXCLUDED_ARCHS=( arm64, arm64e )). ** BUILD FAILED ** The following build commands failed: Check dependencies (1 failure) CMake will not be able to correctly generate this project. Call Stack (most recent call first): CMakeLists.txt:3 (project) -- Configuring incomplete, errors occurred! See also "/Users/Namae/Desktop/OpenGL/build/CMakeFiles/CMakeOutput.log". See also "/Users/Namae/Desktop/OpenGL/build/CMakeFiles/CMakeError.log".

試したこと

エラーメッセージからアーキテクチャーが正しくないということは読み取れるのですが、その対処法が見つかりません。
同じようなエラーが出ている人の対処法を試してみましたが、やはりうまく行きませんでした。

補足情報(FW/ツールのバージョンなど)

XCode: Version12.0

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

crazyhero

2020/09/29 11:55 編集

you can usage "cmake <your cmake project path> -DCMAKE_OSX_ARCHITECTURES=x86_64 -GXcode"
goto-c

2020/09/29 23:16 編集

I'd really appreciate your help ! I could fix the bug and successfully build the project .
guest

回答1

0

自己解決

-DCMAKE_OSX_ARCHITECTURES=x86_64
というオプションをつけることで解決できました。
crazyheroさん、ありがとうございました。

投稿2020/10/16 02:22

goto-c

総合スコア3

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問