Skip to content

Commit 8791cd1

Browse files
authored
Merge pull request opencv#26374 from OrkWard:fix-js-build-script
Fix incorrect string format in js build script opencv#26374 I accidentally met this small problem mentioned in opencv#25084 (comment) when play with wasm build. It seems https://github.com/EDVTAZ didn't fix it yet, so I create this tiny pr. Additionally, I remove a redundant argument in `add_argument` call. `'store_true'` already set the default, see https://docs.python.org/3/library/argparse.html#action. ### Pull Request Readiness Checklist See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request - [x] I agree to contribute to the project under Apache 2 License. - [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV - [x] The PR is proposed to the proper branch - [x] There is a reference to the original bug report and related work - [ ] There is accuracy test, performance test and test data in opencv_extra repository, if applicable Patch to opencv_extra has the same branch name. - [ ] The feature is well documented and sample code can be built with the project CMake
1 parent dd08328 commit 8791cd1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

platforms/js/build_js.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,12 +254,12 @@ def build_loader(self):
254254
parser.add_argument('--cmake_option', action='append', help="Append CMake options")
255255
# Use flag --build_flags="-s USE_PTHREADS=0 -Os" for one and more arguments as in the example
256256
parser.add_argument('--build_flags', help="Append Emscripten build options")
257-
parser.add_argument('--build_wasm_intrin_test', default=False, action="store_true", help="Build WASM intrin tests")
257+
parser.add_argument('--build_wasm_intrin_test', action="store_true", help="Build WASM intrin tests")
258258
# Write a path to modify file like argument of this flag
259259
parser.add_argument('--config', help="Specify configuration file with own list of exported into JS functions")
260260
parser.add_argument('--webnn', action="store_true", help="Enable WebNN Backend")
261261

262-
transformed_args = ["--cmake_option=%s".format(arg) if arg[:2] == "-D" else arg for arg in sys.argv[1:]]
262+
transformed_args = ["--cmake_option={}".format(arg) if arg[:2] == "-D" else arg for arg in sys.argv[1:]]
263263
args = parser.parse_args(transformed_args)
264264

265265
log.debug("Args: %s", args)

0 commit comments

Comments
 (0)