swiftlyfalling / SQLiteLib

Easily build a custom SQLite static library for use in macOS and iOS frameworks and apps.
MIT License
64 stars 23 forks source link

Can't build: xcodebuild -scheme sqlitelib -sdk iphoneos #17

Closed michaelbaer closed 7 years ago

michaelbaer commented 7 years ago

I try to build sqlitelib library via command line and xcodebuild for iphoneos or iphone simulator.

xcodebuild -scheme sqlitelib -sdk iphoneos

configure: error: cannot run C compiled programs. If you meant to cross compile, use --host'. Seeconfig.log' for more details Command /bin/sh failed with exit code 1

BUILD FAILED

If I set the sdk to macosx than everything works fine.

Build-Environment: MacOSX Sierra 10.12.4 Xcode 8.3.1

swiftlyfalling commented 7 years ago

Try using the -destination parameter instead of the -sdk parameter for command-line xcodebuild of SQLiteLib.

For example (assuming Xcode 8.3+ on macOS 10.12):

To build for macOS, 64-bit, Release mode:

xcodebuild -scheme sqlitelib -destination 'platform=macOS,arch=x86_64' -configuration 'Release'

To build for 'Generic iOS Device', Release mode:

xcodebuild -scheme sqlitelib -destination 'platform=iOS' -configuration 'Release'

To build for a specific iOS Simulator, Release mode (example):

xcodebuild -scheme sqlitelib -destination 'platform=iOS Simulator,name=iPhone 6s,OS=10.3' -configuration 'Release'

(More details on these options can be found here: https://developer.apple.com/legacy/library/documentation/Darwin/Reference/ManPages/man1/xcodebuild.1.html)

michaelbaer commented 7 years ago

Thanks, using -destination parameter instead of -sdk works.

But, to build for 'Generic iOS Device' in Release mode I had to use the following:

xcodebuild -scheme sqlitelib -destination 'generic/platform=iOS' -configuration 'Release'