0

I'm trying to build a XCode workspace with xcodebuild 9.4.1.

Here is my command line:

xcodebuild -workspace ios/VAPoc.xcworkspace \
           -scheme VAPoc \
           -configuration 'Release' \
           -sdk iphoneos

Sadly it fails using header search paths specified in the XCode GUI.

I have to put them again on the command line for the build to succeed:

xcodebuild -workspace ios/VAPoc.xcworkspace \
           -scheme VAPoc \
           -configuration 'Release' \
           -sdk iphoneos \
           USER_HEADER_SEARCH_PATHS="$(inherited) /Library/Java/JavaVirtualMachines/jdk1.8.0_181.jdk/Contents/Home/include /Library/Java/JavaVirtualMachines/jdk1.8.0_181.jdk/Contents/Home/include/darwin/"

Building in XCode works like a charm...

I'm hoping someone could explain this to me.

It seems that I have to specify absolute paths here, and that I can't use environment variables? Am I right?

I have a workaround on my Mac but the problem is that my app will be built by AppCenter in the cloud and AFAIK I've no way to set build settings for xcodebuild in this environment. For now I think I'll need the header paths to be used from the xcodeproj file(s).

Thanks in advance.

  • I haven’t tried it but would it make sense to use standard environment variables (predefined by Apple) that represent the path with respect to your project ? – user1046037 Jul 30 '18 at 00:43
  • I've tried CPLUS_INCLUDE_PATH but it gets reset during the build... –  Jul 30 '18 at 06:27
  • If there was some environment variable to get your JVM path it might help. Or a way for you to build the path from your JVM path – user1046037 Jul 30 '18 at 06:39

0 Answers0