Changeset 92ebdac


Ignore:
Timestamp:
Dec 28, 2023, 12:30:09 PM (11 months ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
master
Children:
eed0199
Parents:
2f2b52a
git-author:
Paul Brossier <piem@piem.org> (12/28/23 11:51:58)
git-committer:
Paul Brossier <piem@piem.org> (12/28/23 12:30:09)
Message:

[waf] run xcode-select to find path in wscript (see gh-337)

Thanks to @dnadoba for that trick

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wscript

    r2f2b52a r92ebdac  
    1212
    1313import sys
     14import subprocess
    1415
    1516APPNAME = 'aubio'
     
    260261    if target_platform in [ 'ios', 'iosimulator' ]:
    261262        MINSDKVER="6.1"
     263        xcodeslct_output = subprocess.check_output (['xcode-select', '--print-path'])
     264        XCODEPATH = xcodeslct_output.decode(sys.stdout.encoding).strip()
     265        if target_platform == 'ios':
     266            SDKNAME = "iPhoneOS"
     267        elif target_platform == 'iosimulator':
     268            SDKNAME = "iPhoneSimulator"
     269        else:
     270            raise ctx.errors.ConfigurationError ("Error: unknown target platform '"
     271                + target_platform + "'")
     272        DEVROOT = "%(XCODEPATH)s/Platforms/%(SDKNAME)s.platform/Developer" % locals()
     273        SDKROOT = "%(DEVROOT)s/SDKs/%(SDKNAME)s.sdk" % locals()
    262274        ctx.env.CFLAGS += ['-std=c99']
    263275        if (ctx.options.enable_apple_audio != False):
     
    265277            #ctx.env.FRAMEWORK += ['CoreFoundation', 'AudioToolbox']
    266278        if target_platform == 'ios':
    267             DEVROOT = "/Applications/Xcode.app/Contents"
    268             DEVROOT += "/Developer/Platforms/iPhoneOS.platform/Developer"
    269             SDKROOT = "%(DEVROOT)s/SDKs/iPhoneOS.sdk" % locals()
    270279            ctx.env.CFLAGS += [ '-fembed-bitcode' ]
    271280            ctx.env.CFLAGS += [ '-arch', 'arm64' ]
     
    278287            ctx.env.LINKFLAGS += [ '-miphoneos-version-min=' + MINSDKVER ]
    279288        else:
    280             DEVROOT = "/Applications/Xcode.app/Contents"
    281             DEVROOT += "/Developer/Platforms/iPhoneSimulator.platform/Developer"
    282             SDKROOT = "%(DEVROOT)s/SDKs/iPhoneSimulator.sdk" % locals()
    283289            ctx.env.CFLAGS += [ '-arch', 'x86_64' ]
    284290            ctx.env.LINKFLAGS += ['-arch', 'x86_64']
Note: See TracChangeset for help on using the changeset viewer.