2017-06-16 53 views
3

我碰到了一個編譯phantomjs的分支,後面是these instructions。我已經從Appstore安裝了完整的Xcode,並接受了許可協議(例如sudo xcodebuild -license),這似乎是針對此錯誤的其他SO問題的問題。但是當我嘗試編譯時:Xcode在編譯幻像時沒有正確設置

My-MBPX:phantomjs username$ python build.py 
Password: 
---------------------------------------- 
       WARNING 
---------------------------------------- 

Building PhantomJS from source takes a very long time, anywhere from 30 minutes 
to several hours (depending on the machine configuration). It is recommended to 
use the premade binary packages on supported operating systems. 

For details, please go the the web site: http://phantomjs.org/download.html. 

Do you want to continue (Y/n)? Y 
Executing in /Users/username/Documents/github/phantomjs: git submodule init 
Executing in /Users/username/Documents/github/phantomjs: git submodule update --init 
configuring Qt Base, please wait... 
Found OpenSSL installed via Brew 
Executing in /Users/username/Documents/github/phantomjs/src/qt/qtbase: /Users/username/Documents/github/phantomjs/src/qt/qtbase/configure -static -opensource -confirm-license -prefix /Users/username/Documents/github/phantomjs/src/qt/qtbase -qt-zlib -qt-libpng -qt-libjpeg -qt-pcre -nomake examples -nomake tools -nomake tests -no-qml-debug -no-dbus -no-opengl -no-audio-backend -D QT_NO_GRAPHICSVIEW -D QT_NO_GRAPHICSEFFECT -D QT_NO_STYLESHEET -D QT_NO_STYLE_CDE -D QT_NO_STYLE_CLEANLOOKS -D QT_NO_STYLE_MOTIF -D QT_NO_STYLE_PLASTIQUE -D QT_NO_PRINTPREVIEWDIALOG -qpa phantom -openssl -openssl-linked -no-openvg -no-eglfs -no-egl -no-glib -no-gtkstyle -no-cups -no-sm -no-xinerama -no-xkb -no-xcb -no-kms -no-linuxfb -no-directfb -no-mtdev -no-libudev -no-evdev -no-pulseaudio -no-alsa -no-feature-PRINTPREVIEWWIDGET -no-pkg-config -no-c++11 -I/usr/local/opt/openssl/include -L/usr/local/opt/openssl/lib -release 

    Xcode not set up properly. You may need to confirm the license 
    agreement by running /usr/bin/xcodebuild without arguments. 

ERROR: Failed to build PhantomJS! Configuration of Qt Base failed. 

使用sudo的結果相同。然後運行/usr/bin/xcodebuild爲勸回報:

xcodebuild: error: The directory /Users/username/Documents/github/phantomjs does not contain an Xcode project. 

我承認確實有對現有命令行工具版本之上升級了Xtools,並手動更改路徑(sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer),但現在正確地報告:

xcode-select -p 
/Applications/Xcode.app/Contents/Developer 

任何建議感激地收到。

回答

2

This solution似乎已經奏效:

cd /Applications/Xcode.app/Contents/Developer/usr/bin/ 
sudo ln -s xcodebuild xcrun 
+0

完美。謝謝!! – Linh