Skip to content

Commit 4abedb8

Browse files
authored
[Docs] Add note about space notation and remove leftovers (#19599)
* Remove -s FOO=BAR in favor of -sFOO=BAR. * Add note why it's preferred. * Remove "is very easy" sentence.
1 parent 9d706c7 commit 4abedb8

File tree

6 files changed

+11
-10
lines changed

6 files changed

+11
-10
lines changed

docs/emcc.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ Options that are modified or new in *emcc* are listed below:
151151

152152
Options can be specified as a single argument with or without a
153153
space between the "-s" and option name. e.g. "-sFOO" or "-s
154-
FOO".
154+
FOO". It's highly recommended you use the notation without space.
155155

156156
"-g"
157157
[compile+link] Preserve debug information.

site/source/docs/compiling/Building-Projects.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
Building Projects
55
=================
66

7-
Building large projects with Emscripten is very easy. Emscripten provides two simple scripts that configure your makefiles to use :ref:`emcc <emccdoc>` as a drop-in replacement for *gcc* — in most cases the rest of your project’s current build system remains unchanged.
7+
Emscripten provides two scripts that configure your makefiles to use :ref:`emcc <emccdoc>` as a drop-in replacement for *gcc* — in most cases the rest of your project’s current build system remains unchanged.
88

99

1010
.. _building-projects-build-system:
@@ -327,7 +327,7 @@ The :ref:`Tutorial` showed how :ref:`emcc <emccdoc>` can be used to compile sing
327327
emcc src1.o src2.o -r -o combined.o
328328

329329
# Combine two object files into library file
330-
emar rcs libfoo.a src1.o src2.o
330+
emar rcs libfoo.a src1.o src2.o
331331

332332

333333
In addition to the capabilities it shares with *gcc*, *emcc* supports options to optimize code, control what debug information is emitted, generate HTML and other output formats, etc. These options are documented in the :ref:`emcc tool reference <emccdoc>` (``emcc --help`` on the command line).

site/source/docs/getting_started/FAQ.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -404,8 +404,8 @@ what you want on the web: even though ``main()`` exited, you may have something
404404
asynchronous happening later that you want to execute.
405405

406406
In some cases, though, you may want a more "commandline" experience, where we do
407-
shut down the runtime when ``main()`` exits. You can build with ``-s
408-
EXIT_RUNTIME``, and then we will call ``atexits`` and so forth. When you build
407+
shut down the runtime when ``main()`` exits. You can build with ``-sEXIT_RUNTIME``,
408+
and then we will call ``atexits`` and so forth. When you build
409409
with ``ASSERTIONS``, you should get a warning when you need this. For example,
410410
if your program prints something without a newline,
411411

@@ -643,7 +643,7 @@ strings, so it accepts ``[a]`` or ``[a,b]`` etc.).
643643

644644

645645
Why do I get a Python ``SyntaxError: invalid syntax`` on ``file=..`` or on a string starting with ``f'..'``?
646-
============================================================================================================
646+
============================================================================================================
647647

648648
Emscripten requires a recent-enough version of Python. An older Python version,
649649
like ``2.*``, will not support the print statement by default, so it will error on

site/source/docs/getting_started/Tutorial.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ execute it. You can run them using :term:`node.js`:
8787
This prints "hello, world!" to the console, as expected.
8888

8989
.. note:: Older node.js versions do not have WebAssembly support yet. In that
90-
case you will see an error message suggesting that you build with ``-s
91-
WASM=0`` to disable WebAssembly, and then emscripten will emit the compiled
90+
case you will see an error message suggesting that you build with
91+
``-sWASM=0`` to disable WebAssembly, and then emscripten will emit the compiled
9292
code as JavaScript. In general, WebAssembly is recommended as it has
9393
widespread browser support and is more efficient both to execute and to
9494
download (and therefore emscripten emits it by default), but sometimes you

site/source/docs/porting/networking.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ complete at the moment, it is likely that you will run into problems out of the
4646
box and need to adapt the code to work within the limitations that this
4747
emulation provides.
4848

49-
This is the default build mode for Emscripten. Use the linker flag ``-s
50-
WEBSOCKET_URL`` or ``Module['websocket']['url']`` to specify the WebSocket URL
49+
This is the default build mode for Emscripten. Use the linker flag
50+
``-sWEBSOCKET_URL`` or ``Module['websocket']['url']`` to specify the WebSocket URL
5151
to connect to, and the linker flag ``-sWEBSOCKET_SUBPROTOCOL`` or
5252
``Module['websocket']['subprotocol']`` to control the connection type
5353
(``'binary'`` or ``'text'``).

site/source/docs/tools_reference/emcc.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ Options that are modified or new in *emcc* are listed below:
137137

138138
.. note:: Options can be specified as a single argument with or without a space
139139
between the ``-s`` and option name. e.g. ``-sFOO`` or ``-s FOO``.
140+
It's `highly recommended <https://emscripten.org/docs/getting_started/FAQ.html#how-do-i-specify-s-options-in-a-cmake-project>`_ you use the notation without space.
140141

141142
.. _emcc-g:
142143

0 commit comments

Comments
 (0)