CMake compiler for macOS build not found


#1

Issue:
Hello, I’m trying to build citra on macOS by following directions/tutorial on Building for macOS (https://github.com/citra-emu/citra/wiki/Building-for-macOS). Have brew, have all dependencies, have Xcode. The problem begins at the building project files step. Input cmake … -GXcode in terminal (where I did everything so far) leads to this:

Computer-Name:build User$ cmake … -GXcode
– The C compiler identification is unknown
– The CXX compiler identification is unknown
CMake Error at CMakeLists.txt:36 (project):
No CMAKE_C_COMPILER could be found.

CMake Error at CMakeLists.txt:36 (project):
No CMAKE_CXX_COMPILER could be found.

– Configuring incomplete, errors occurred!
See also “/Users/User/citra/build/CMakeFiles/CMakeOutput.log”.
See also “/Users/User/citra/build/CMakeFiles/CMakeError.log”.

System Information: Mac 10.12.3 Sierra
Operating System: macOS
CPU: 2.5GHz Intel Core i5
GPU: Intel HD Graphics 4000 1536 MB

CMakeError.log:
Compiling the C compiler identification source file “CMakeCCompilerId.c” failed.
Compiler:
Build flags:
Id flags:

The output was:
1
xcode-select: error: tool ‘xcodebuild’ requires Xcode, but active developer directory ‘/Library/Developer/CommandLineTools’ is a command line tools instance

Compiling the CXX compiler identification source file “CMakeCXXCompilerId.cpp” failed.
Compiler:
Build flags:
Id flags:

The output was:
1
xcode-select: error: tool ‘xcodebuild’ requires Xcode, but active developer directory ‘/Library/Developer/CommandLineTools’ is a command line tools instance


#2

type in gcc and you should get a popup prompting you to install the xcode command line tools (which for some ungodly reason doesn’t get installed when you install xcode… macOS pls)

it should look something like this


#3

Yeah, you need this. I have it and worked as charm.


#4

I typed that in and i got back:
clang: error: no input files


#5

It’s been a few months and I scoured the internet for a solution. I finally found the answer to this problem here: (https://github.com/nodejs/node-gyp/issues/569#issuecomment-255589932), and resumed building according to macOS directions (https://github.com/citra-emu/citra/wiki/Building-for-macOS) resuming at Using CMake.

I hope no one else runs into the same problem and ends up spending months trying to fix it when it had such an easy fix haha.