Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
more code review
  • Loading branch information
ypujante committed Feb 6, 2024
commit ea4ea494c19ac2437ffeefd4f851397f0747aaf6
2 changes: 1 addition & 1 deletion test/test_other.py
Original file line number Diff line number Diff line change
Expand Up @@ -2372,7 +2372,7 @@ def test_sdl2_ttf(self):
def test_contrib_ports(self):
# Verify that contrib ports can be used (using the only contrib port available ATM, but can be replaced
# with a different contrib port when there is another one
self.emcc(test_file('other/test_contrib_ports.cpp'), ['--use-port=contrib.glfw3?disableWarning=true'], output_filename='a.out.js')
self.emcc(test_file('other/test_contrib_ports.cpp'), ['--use-port=contrib.glfw3'])

def test_link_memcpy(self):
# memcpy can show up *after* optimizations, so after our opportunity to link in libc, so it must be special-cased
Expand Down
4 changes: 3 additions & 1 deletion tools/ports/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,9 @@ def add_deps(node):

def handle_use_port_arg(settings, arg):
args = arg.split('?', 1)
name, options = args[0], args[1] if len(args) == 2 else None
name, options = args[0], None
if len(args) == 2:
options = args[1]
if name not in ports_by_name:
utils.exit_with_error(f'Invalid port name: {name} used with --use-port')
ports_needed.add(name)
Expand Down
5 changes: 2 additions & 3 deletions tools/ports/sdl2_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
# found in the LICENSE file.

import os
import re
from typing import Dict, Set

TAG = 'release-2.6.0'
Expand All @@ -17,7 +16,7 @@
}

OPTIONS = {
'formats': 'A comma separated list of formats (ex: png,jpg)'
'formats': 'A comma separated list of formats (ex: --use-port=sdl2_image?formats=png,jpg)'
}

# user options (from --use-port)
Expand Down Expand Up @@ -92,7 +91,7 @@ def process_dependencies(settings):
def handle_options(options):
# options has been parsed from a query string
for fmts in options['formats']:
opts['formats'].update({format.lower() for format in re.findall(r'\b\w+\b', fmts)})
opts['formats'].update({format.lower().strip() for format in fmts.split(',')})


def show():
Expand Down