Sign in Join
Wiki copytemporary

pas2js.cfg

Locations

You can see where pas2js searches for its cfg file and what it finds using the command line parameter -vt.

On Unix (Linux, MacOS, BSD) pas2js searches

On Windows the compiler searches:

You can disable the search for the default config file using the parameter -n.

You can pass additional config files using the @ parameter. For example:

text
pas2js -n @/etc/pas2js.cfg

This will skip the default config file and parse /etc/pas2js.cfg.

Structure

Macros

You can see the supported macros running pas2js -h

Examples

Here is a typical pas2js.cfg file:

pascal
#
# Minimal config file for pas2js compiler
#
# -d is the same as #DEFINE
# -u is the same as #UNDEF
#
# Write always a nice logo ;)
-l
pascal
# Display Warnings, Notes and Hints
-vwnh
# If you don't want so much verbosity use
#-vw
pascal
# Allow C-operators
-Sc
pascal
#IFDEF FPC_SUBTARGET_NAMESPACED
-Fu$CfgDir/../../packages/*/*/namespaced
-Fi$CfgDir/../../packages/*/*/src
#else
-Fu$CfgDir/../../packages/*/*/src
#endif
pascal
# path to rtl.js
-Fu../../compiler/utils/pas2js/dist/
pascal
#IFDEF nodejs
-Jirtl.js
#ENDIF
pascal
# Put all generated JavaScript into one file
-Jc
pascal
# end.

Creating pas2js.cfg

When you built via make, it creates a pas2js.cfg in bin/$(TargetCPU)-$(TargetOS)/.

There is a tool to create a basic pas2js.cfg: tools/createconfig/createconfig


From the Free Pascal wiki, page "pas2js.cfg", as it stood on 2024-02-27 after a change by Mattias2, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's Licensing page. If you have concerns about this material, message the admin.

Revision 2, last changed by WikiArchive .

Edited on wiki.freepascal.org by 2 people, 2019–2024

From the official wiki's backup of 26 May 2024: who edited this page there, and when. Edits made there after that date were not recorded, and the earlier versions are not shown here; the main page says why.

WhenWhoWhat changed
Mattias2Created page
Mattias2Structure
Mattias2Macros
Mattias2Examples
Mattias2Structure
Mattias2Locations
Mattias2Structure
Mattias2Structure
Mattias2Structure
Mattias2Locations
SkalogryzExamples (minor)
Mattias2Locations
Mattias2Examples
Mattias2Examples
Mattias2Examples

Talk about this page

Nobody has opened a bench for this page yet. Sign in to open one.