Xcode not configured properly when compiling phantomjs

I hit the wall compiling the phantomjs fork following these instructions . I installed the complete Xcode from the Appstore and accepted the license agreement (for example sudo xcodebuild -license

), which seems to be a problem for other SO questions on this error. But when I try to compile:

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.

      

Same result using sudo

. Then run /usr/bin/xcodebuild

as instructed:

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

      

True, I had to update Xtools over the existing version of the command line tools and change the path manually ( sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer

), but now it's correct to report:

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

      

Any advice is greatly appreciated.

+3


source to share


1 answer


This solution works:



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

      

+2


source







All Articles