Skip to content

Commit 0f1275d

Browse files
committed
Use -sFOO rather than -s FOO=1 in documentation. NFC
Followup to #16025
1 parent 3acd086 commit 0f1275d

File tree

20 files changed

+154
-157
lines changed

20 files changed

+154
-157
lines changed

docs/emcc.txt

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -87,26 +87,25 @@ Options that are modified or new in *emcc* are listed below:
8787

8888
For more tips on optimizing your code, see Optimizing Code.
8989

90-
"-s OPTION[=VALUE]"
90+
"-sOPTION[=VALUE]"
9191
[different OPTIONs affect at different stages, most at link time]
9292
Emscripten build options. For the available options, see
9393
src/settings.js.
9494

9595
Note:
9696

97-
You can prefix boolean options with "NO_" to reverse them. For
98-
example, "-s EXIT_RUNTIME=1" is the same as "-s
99-
NO_EXIT_RUNTIME=0".
97+
If no value is specifed it will default to "1".
10098

10199
Note:
102100

103-
If no value is specifed it will default to "1".
101+
You can prefix boolean options with "NO_" to reverse them. For
102+
example, "-sEXIT_RUNTIME=0" is the same as "-sNO_EXIT_RUNTIME".
104103

105104
Note:
106105

107106
Lists can be specified as comma separated strings:
108107

109-
-s EXPORTED_FUNCTIONS=foo,bar
108+
-sEXPORTED_FUNCTIONS=foo,bar
110109

111110
Note:
112111

@@ -115,24 +114,24 @@ Options that are modified or new in *emcc* are listed below:
115114
and with or without brackets around the list. For example, all
116115
the following are equivalent:
117116

118-
-s EXPORTED_FUNCTIONS="foo","bar"
119-
-s EXPORTED_FUNCTIONS=["foo","bar"]
120-
-s EXPORTED_FUNCTIONS=[foo,bar]
117+
-sEXPORTED_FUNCTIONS="foo","bar"
118+
-sEXPORTED_FUNCTIONS=["foo","bar"]
119+
-sEXPORTED_FUNCTIONS=[foo,bar]
121120

122121
Note:
123122

124123
For lists that include brackets or quote, you need quotation
125124
marks (") around the list in most shells (to avoid errors being
126125
raised). Two examples are shown below:
127126

128-
-s EXPORTED_FUNCTIONS="['liblib.so']"
129-
-s "EXPORTED_FUNCTIONS=['liblib.so']"
127+
-sEXPORTED_FUNCTIONS="['liblib.so']"
128+
-s"EXPORTED_FUNCTIONS=['liblib.so']"
130129

131130
You can also specify that the value of an option will be read from
132131
a file. For example, the following will set "EXPORTED_FUNCTIONS"
133132
based on the contents of the file at **path/to/file**.
134133

135-
-s EXPORTED_FUNCTIONS=@/path/to/file
134+
-sEXPORTED_FUNCTIONS=@/path/to/file
136135

137136
Note:
138137

@@ -144,8 +143,9 @@ Options that are modified or new in *emcc* are listed below:
144143

145144
Note:
146145

147-
Options can be specified as a single argument without a space
148-
between the "-s" and option name. e.g. "-sFOO=1".
146+
Options can be specified as a single argument with or without a
147+
space between the "-s" and option name. e.g. "-sFOO" or "-s
148+
FOO".
149149

150150
"-g"
151151
[compile+link] Preserve debug information.
@@ -163,7 +163,7 @@ Options that are modified or new in *emcc* are listed below:
163163
"FILENAME" if provided, otherwise the same as the wasm file but
164164
with suffix ".debug.wasm". While the main file contains no debug
165165
info, it does contain a URL to where the debug file is, so that
166-
devtools can find it. You can use "-s SEPARATE_DWARF_URL=URL" to
166+
devtools can find it. You can use "-sSEPARATE_DWARF_URL=URL" to
167167
customize that location (this is useful if you want to host it on a
168168
different server, for example).
169169

@@ -211,7 +211,7 @@ Options that are modified or new in *emcc* are listed below:
211211

212212
Note:
213213

214-
When used with "-s WASM=2", two symbol files are created.
214+
When used with "-sWASM=2", two symbol files are created.
215215
"[name].js.symbols" (with WASM symbols) and
216216
"[name].wasm.js.symbols" (with ASM.js symbols)
217217

@@ -235,7 +235,7 @@ Options that are modified or new in *emcc* are listed below:
235235

236236
Note:
237237

238-
* Consider using "-s MODULARIZE=1" when using closure, as it
238+
* Consider using "-sMODULARIZE" when using closure, as it
239239
minifies globals to names that might conflict with others in
240240
the global scope. "MODULARIZE" puts all the output into a
241241
function (see "src/settings.js").
@@ -536,7 +536,7 @@ Options that are modified or new in *emcc* are listed below:
536536
"--threadprofiler"
537537
[link] Embeds a thread activity profiler onto the generated page.
538538
Use this to profile the application usage of pthreads when
539-
targeting multithreaded builds (-s USE_PTHREADS=1/2).
539+
targeting multithreaded builds (-sUSE_PTHREADS=1/2).
540540

541541
"--em-config <path>"
542542
[general] Specifies the location of the **.emscripten**

site/source/docs/api_reference/Filesystem-API.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ Including File System Support
3838

3939
Emscripten decides whether to include file system support automatically. Many programs don't need files, and file system support is not negligible in size, so Emscripten avoids including it when it doesn't see a reason to. That means that if your C/C++ code does not access files, then the ``FS`` object and other file system APIs will not be included in the output. And, on the other hand, if your C/C++ code does use files, then file system support will be automatically included. So normally things will "just work" and you don't need to think about this at all.
4040

41-
However, if your C/C++ code doesn't use files, but you want to use them from JavaScript, then you can build with ``-s FORCE_FILESYSTEM=1``, which will make the compiler include file system support even though it doesn't see it being used.
41+
However, if your C/C++ code doesn't use files, but you want to use them from JavaScript, then you can build with ``-sFORCE_FILESYSTEM``, which will make the compiler include file system support even though it doesn't see it being used.
4242

43-
On the other hand, if you want to **not** include any filesystem support code (which may be included even due to printf or iostreams, due to how musl and libc++ are structured), you can build with ``-s FILESYSTEM=0``. Very simple stdout support will be included if necessary in such a case, enough for printf and such to work, but no filesystem code will be added, which can save a significant amount of code size.
43+
On the other hand, if you want to **not** include any filesystem support code (which may be included even due to printf or iostreams, due to how musl and libc++ are structured), you can build with ``-sFILESYSTEM=0``. Very simple stdout support will be included if necessary in such a case, enough for printf and such to work, but no filesystem code will be added, which can save a significant amount of code size.
4444

4545

4646
.. _filesystem-api-persist-data:

site/source/docs/api_reference/emscripten.h.rst

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ Functions
270270

271271
.. c:function:: void emscripten_run_script(const char *script)
272272
273-
Interface to the underlying JavaScript engine. This function will ``eval()`` the given script. Note: If ``-s DYNAMIC_EXECUTION=0`` is set, this function will not be available.
273+
Interface to the underlying JavaScript engine. This function will ``eval()`` the given script. Note: If ``-sDYNAMIC_EXECUTION=0`` is set, this function will not be available.
274274
275275
This function can be called from a pthread, and it is executed in the scope of the Web Worker that is hosting the pthread. To evaluate a function in the scope of the main runtime thread, see the function emscripten_sync_run_in_main_runtime_thread().
276276
@@ -281,7 +281,7 @@ Functions
281281
282282
.. c:function:: int emscripten_run_script_int(const char *script)
283283
284-
Interface to the underlying JavaScript engine. This function will ``eval()`` the given script. Note: If ``-s DYNAMIC_EXECUTION=0`` is set, this function will not be available.
284+
Interface to the underlying JavaScript engine. This function will ``eval()`` the given script. Note: If ``-sDYNAMIC_EXECUTION=0`` is set, this function will not be available.
285285
286286
This function can be called from a pthread, and it is executed in the scope of the Web Worker that is hosting the pthread. To evaluate a function in the scope of the main runtime thread, see the function emscripten_sync_run_in_main_runtime_thread().
287287
@@ -293,7 +293,7 @@ Functions
293293
294294
.. c:function:: char *emscripten_run_script_string(const char *script)
295295
296-
Interface to the underlying JavaScript engine. This function will ``eval()`` the given script. Note that this overload uses a single buffer shared between calls. Note: If ``-s DYNAMIC_EXECUTION=0`` is set, this function will not be available.
296+
Interface to the underlying JavaScript engine. This function will ``eval()`` the given script. Note that this overload uses a single buffer shared between calls. Note: If ``-sDYNAMIC_EXECUTION=0`` is set, this function will not be available.
297297
298298
This function can be called from a pthread, and it is executed in the scope of the Web Worker that is hosting the pthread. To evaluate a function in the scope of the main runtime thread, see the function emscripten_sync_run_in_main_runtime_thread().
299299
@@ -481,7 +481,7 @@ Functions
481481
482482
The difference is that ``emscripten_force_exit`` will shut down the runtime even if you previously called :c:func:`emscripten_exit_with_live_runtime` or otherwise kept the runtime alive. In other words, this method gives you the option to completely shut down the runtime after it was kept alive beyond the completion of ``main()``.
483483
484-
Note that if ``EXIT_RUNTIME`` is not set (which is the case by default) then the runtime cannot be shut down, as we do not include the code to do so. Build with ``-s EXIT_RUNTIME=1`` if you want to be able to exit the runtime.
484+
Note that if ``EXIT_RUNTIME`` is not set (which is the case by default) then the runtime cannot be shut down, as we do not include the code to do so. Build with ``-sEXIT_RUNTIME`` if you want to be able to exit the runtime.
485485
486486
:param int status: The same as for the *libc* function `exit() <http://linux.die.net/man/3/exit>`_.
487487
@@ -1054,7 +1054,7 @@ Functions
10541054
10551055
For this command to work, you must build with the following compiler option (as we do not want to increase the build size with this metadata): ::
10561056
1057-
-s RETAIN_COMPILER_SETTINGS=1
1057+
-sRETAIN_COMPILER_SETTINGS
10581058
10591059
:param name: The compiler setting to return.
10601060
:type name: const char*
@@ -1066,7 +1066,7 @@ Functions
10661066
Returns whether pseudo-synchronous functions can be used.
10671067
10681068
:rtype: int
1069-
:returns: 1 if program was compiled with ASYNCIFY=1, 0 otherwise.
1069+
:returns: 1 if program was compiled with -sASYNCIFY, 0 otherwise.
10701070
10711071
10721072
.. c:function:: void emscripten_debugger()
@@ -1279,7 +1279,7 @@ Typedefs
12791279
Pseudo-synchronous functions
12801280
============================
12811281
1282-
These functions require Asyncify (``-s ASYNCIFY=1``). These functions are asynchronous but appear synchronous in C. See `Asyncify <https://emscripten.org/docs/porting/asyncify.html>`_ for more details.
1282+
These functions require Asyncify (``-sASYNCIFY``). These functions are asynchronous but appear synchronous in C. See `Asyncify <https://emscripten.org/docs/porting/asyncify.html>`_ for more details.
12831283
12841284
Sleeping
12851285
--------
@@ -1412,7 +1412,7 @@ Functions
14121412
including rarely-used functions, in which case the lazy-loading may
14131413
not happen at all.
14141414
1415-
.. note:: This requires building with ``-s ASYNCIFY_LAZY_LOAD_CODE``.
1415+
.. note:: This requires building with ``-sASYNCIFY_LAZY_LOAD_CODE``.
14161416
14171417
ABI functions
14181418
=============

site/source/docs/api_reference/fetch.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ network requests can be run either synchronously or asynchronously as desired.
1212

1313
.. note::
1414

15-
In order to use the Fetch API, you would need to compile your code with ``-s
16-
FETCH=1``.
15+
In order to use the Fetch API, you would need to compile your code with
16+
``-sFETCH``.
1717

1818
Introduction
1919
============
@@ -195,9 +195,9 @@ emscripten_fetch() returns.
195195
- **No flags**: Only asynchronous Fetch operations are available.
196196
- ``--proxy-to-worker``: Synchronous Fetch operations are allowed for fetches
197197
that only do an XHR but do not interact with IndexedDB.
198-
- ``-s USE_PTHREADS=1``: Synchronous Fetch operations are available on
198+
- ``-sUSE_PTHREADS``: Synchronous Fetch operations are available on
199199
pthreads, but not on the main thread.
200-
- ``--proxy-to-worker`` + ``-s USE_PTHREADS=1``: Synchronous Fetch operations
200+
- ``--proxy-to-worker`` + ``-sUSE_PTHREADS``: Synchronous Fetch operations
201201
are available both on the main thread and pthreads.
202202

203203
Waitable Fetches
@@ -242,9 +242,9 @@ issuing thread can perform some other work until the fetch completes.
242242
Waitable fetches are available only in certain build modes:
243243

244244
- **No flags** or ``--proxy-to-worker``: Waitable fetches are not available.
245-
- ``-s USE_PTHREADS=1``: Waitable fetches are available on pthreads, but not
245+
- ``-sUSE_PTHREADS``: Waitable fetches are available on pthreads, but not
246246
on the main thread.
247-
- ``--proxy-to-worker`` + ``-s USE_PTHREADS=1``: Waitable fetches are
247+
- ``--proxy-to-worker`` + ``-sUSE_PTHREADS``: Waitable fetches are
248248
available on all threads.
249249

250250
Tracking Progress

0 commit comments

Comments
 (0)