Compiling Qt 5.7 applications without Xcode
-
Is it possible to build Qt 5.7 applications without using xcode command line tools? I am using clang 3.9 to build and cmake to configure my makefiles. Does this give me everything I need or does Xcode provide some needed libraries not included otherwise?
Thanks in advance
Paul -
Is it possible to build Qt 5.7 applications without using xcode command line tools? I am using clang 3.9 to build and cmake to configure my makefiles. Does this give me everything I need or does Xcode provide some needed libraries not included otherwise?
Thanks in advance
Paul@FamilyHistorian As long as your installation of clang installed all the required apple libraries you should be fine. I've never tried it without having a full install of xcode though.
I don't ever use xcode but I make sure it's installed so all the /Developer stuff is there.
-
Hi,
How did you install clang ?
Note that Qt officially only supports the compilers provided by Apple.
-
I downloaded and extracted ( tar.gz ) the clang package as a binary distribution into /usr/local.
I have /usr/local in my path before /usr/bin. Also gcc, g++ and cc all point to clang 3.9.
I do have xcode installed but I am going to clean my hard drive to free up some space and If I don't need xcode it may as well go :) So far, clang compiles Qt 5.7 without any issues. Again I was just wondering what, if anything, xcode contributed to the build. clang will generate Apple app bundles. It's just a command line option.Thanks
Paul -
Apple provide their custom version of clang (I don't remember the specifics of the differences with the official release, sorry). It also provides the debugger and macOS,iOS,tvOS SDKs.
-
I downloaded and extracted ( tar.gz ) the clang package as a binary distribution into /usr/local.
I have /usr/local in my path before /usr/bin. Also gcc, g++ and cc all point to clang 3.9.
I do have xcode installed but I am going to clean my hard drive to free up some space and If I don't need xcode it may as well go :) So far, clang compiles Qt 5.7 without any issues. Again I was just wondering what, if anything, xcode contributed to the build. clang will generate Apple app bundles. It's just a command line option.Thanks
Paul@FamilyHistorian I would hide the XCode stuff, move the directory or what I like to do is just change permissions.
sudo chmod 000 /Applications/Xcode.app
Now try your build again and if it tries to use anything in Xcode (since xcode doesn't use /Developer any more but instead uses /Applications/Xcode.app/Developer) then it should fail with a permissions error.
If not and your build works you could probably safely remove Xcode.
Oh and in case you aren't good with unix commands, restoring your permissions
sudo chmod 755 /Applications/Xcode.app
. :)I'm betting you need Xcode though.
-
@FamilyHistorian I would hide the XCode stuff, move the directory or what I like to do is just change permissions.
sudo chmod 000 /Applications/Xcode.app
Now try your build again and if it tries to use anything in Xcode (since xcode doesn't use /Developer any more but instead uses /Applications/Xcode.app/Developer) then it should fail with a permissions error.
If not and your build works you could probably safely remove Xcode.
Oh and in case you aren't good with unix commands, restoring your permissions
sudo chmod 755 /Applications/Xcode.app
. :)I'm betting you need Xcode though.
@ambershark
First, Linux Rocks!, Mac follows.
Windoze ..
.
.
.
You are correct. the build process needs xcrun, apparently to compile a simple test program before configuring my application so I do need Xcode.
Thanks for your help :)
Paul -
@ambershark
First, Linux Rocks!, Mac follows.
Windoze ..
.
.
.
You are correct. the build process needs xcrun, apparently to compile a simple test program before configuring my application so I do need Xcode.
Thanks for your help :)
Paul@FamilyHistorian said in Compiling Qt 5.7 applications without Xcode:
@ambershark
First, Linux Rocks!, Mac follows.
Windoze ..
.
.
.
You are correct. the build process needs xcrun, apparently to compile a simple test program before configuring my application so I do need Xcode.
Thanks for your help :)
PaulLol agreed on the linux part. Been running Linux since about 2000 with a brief break from 2006-2008 for OSX. And while I love OSX I got real sick of my computers costing more than cars every year, so I've been back on linux since. :)
Good to know it does indeed require Xcode. I kind of figured that but it was worth a test. I use that permissions thing on my release builds all the time to make sure my distribution package is working and running independently of the Qt installed on my system. So I just permission out my Qt directory and run my app, if it tries to load something that isn't contained in my dist then it fails with permission probs. ;)