Changeset c1303c6


Ignore:
Timestamp:
Dec 28, 2023, 12:33:26 PM (8 months ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
master
Children:
d100c3d
Parents:
2e3f88f
Message:

[waf] add support for watchos

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wscript

    r2e3f88f rc1303c6  
    242242        ctx.env.LINKFLAGS += [ '-mmacosx-version-min=' + MINSDKVER ]
    243243
    244     if target_platform in [ 'darwin', 'ios', 'iosimulator']:
     244    if target_platform in [ 'darwin', 'ios', 'iosimulator' ]:
    245245        if (ctx.options.enable_apple_audio != False):
    246246            ctx.env.FRAMEWORK += ['CoreFoundation', 'AudioToolbox']
     
    259259                    color = 'YELLOW')
    260260
    261     if target_platform in [ 'ios', 'iosimulator' ]:
     261    if target_platform in [ 'ios', 'iosimulator', 'watchos', 'watchsimulator' ]:
    262262        MINSDKVER="6.1"
    263263        xcodeslct_output = subprocess.check_output (['xcode-select', '--print-path'])
     
    267267        elif target_platform == 'iosimulator':
    268268            SDKNAME = "iPhoneSimulator"
     269        elif target_platform == 'watchos':
     270            SDKNAME = "WatchOS"
     271        elif target_platform == 'watchsimulator':
     272            SDKNAME = "WatchSimulator"
    269273        else:
    270274            raise ctx.errors.ConfigurationError ("Error: unknown target platform '"
     
    273277        SDKROOT = "%(DEVROOT)s/SDKs/%(SDKNAME)s.sdk" % locals()
    274278        ctx.env.CFLAGS += ['-std=c99']
    275         if (ctx.options.enable_apple_audio != False):
     279        if ctx.options.enable_apple_audio != False and target_platform.startswith ('ios'):
    276280            ctx.define('HAVE_AUDIO_UNIT', 1)
    277281            #ctx.env.FRAMEWORK += ['CoreFoundation', 'AudioToolbox']
     
    293297            ctx.env.CFLAGS += [ '-mios-simulator-version-min=' + MINSDKVER ]
    294298            ctx.env.LINKFLAGS += [ '-mios-simulator-version-min=' + MINSDKVER ]
     299        elif target_platform == 'watchos':
     300            ctx.env.CFLAGS += [ '-arch', 'armv7' ]
     301            ctx.env.CFLAGS += [ '-arch', 'armv7s' ]
     302            ctx.env.LINKFLAGS += ['-arch', 'armv7']
     303            ctx.env.LINKFLAGS += ['-arch', 'armv7s']
     304            ctx.env.CFLAGS += [ '-mwatchos-version-min=' + MINSDKVER ]
     305            ctx.env.LINKFLAGS += [ '-mwatchos-version-min=' + MINSDKVER ]
     306        elif target_platform == 'watchsimulator':
     307            ctx.env.CFLAGS += [ '-arch', 'x86_64' ]
     308            ctx.env.CFLAGS += [ '-arch', 'arm64' ]
     309            ctx.env.LINKFLAGS += ['-arch', 'x86_64']
     310            ctx.env.LINKFLAGS += ['-arch', 'arm64']
     311            ctx.env.CFLAGS += [ '-mwatchsimulator-version-min=' + MINSDKVER ]
     312            ctx.env.LINKFLAGS += [ '-mwatchsimulator-version-min=' + MINSDKVER ]
    295313        ctx.env.CFLAGS += [ '-isysroot' , SDKROOT]
    296314        ctx.env.LINKFLAGS += [ '-isysroot' , SDKROOT]
     
    558576
    559577    # add sub directories
    560     if bld.env['DEST_OS'] not in ['ios', 'iosimulator', 'android']:
     578    if bld.env['DEST_OS'] not in ['ios', 'iosimulator', 'watchos', 'watchsimulator', 'android']:
    561579        if bld.env['DEST_OS']=='emscripten' and not bld.options.testcmd:
    562580            bld.options.testcmd = 'node %s'
Note: See TracChangeset for help on using the changeset viewer.