Поделиться через


Compiler Options (F#)

This topic describes compiler command-line options for the F# compiler, fsc.exe. The compilation environment can also be controlled by setting the project properties.

Compiler Options Listed Alphabetically

The following table shows compiler options listed alphabetically. Some of the F# compiler options are similar to the C# compiler options. If that is the case, a link to the C# compiler options topic is given.

Compiler Option

Description

-a <output-filename>

Used to generate a library and specify its filename. This option is a short form of --target:library <filename>.

--baseaddress:<string>

Used to specify the base address of the library to be built.

This compiler option is equivalent to the C# compiler option of the same name. For more information, see /baseaddress (C# Compiler Options).

--codepage:<int>

Used to specify the codepage used to read source files.

This compiler option is equivalent to the C# compiler option of the same name. For more information, see /codepage (C# Compiler Options).

--crossoptimize[+|-]

Enable or disable cross-module optimizations.

--delaysign[+|-]

Used to delay-sign the assembly using only the public portion of the strong name key

This compiler option is equivalent to the C# compiler option of the same name. For more information, see /delaysign (C# Compiler Options).

--checked[+|-]

Used to enable or disable generation of overflow checks.

This compiler option is equivalent to the C# compiler option of the same name. For more information, see /checked (C# Compiler Options).

--debug[+|-]

-g[+|-]

--debug:[full|pdbonly]

-g: [full|pdbonly]

Used to enable or disable the generation of debug information, or to specify the type of debug information to generate. The default is full, which allows attaching to a running program. Choose pdbonly to get limited debugging information stored in a pdb (program database) file.

This compiler option is equivalent to the C# compiler option of the same name. For more information, see

/debug (C# Compiler Options).

--define:<string>

-d:<string>

Used to define a symbol for use in conditional compilation.

--doc:<xmldoc-filename>

Used to instruct the compiler generate XML documentation comments to the file specified. For more information, see XML Documentation (F#).

This compiler option is equivalent to the C# compiler option of the same name. For more information, see /doc (C# Compiler Options).

--fullpaths

Used to instruct the compiler to generate fully qualified paths.

This compiler option is equivalent to the C# compiler option of the same name. For more information, see /fullpaths (C# Compiler Options).

--help

-?

Used to display usage information, including a brief description of all the compiler options.

--keycontainer:<string>

Used to specify a strong name key container.

--keyfile:<filename>

Used to specify the name of a public key file to use to sign the generated assembly.

--lib:<folder-name>

-I:<folder-name>

Used to specify a directory to be searched for assemblies that are referenced.

This compiler option is equivalent to the C# compiler option of the same name. For more information, see /lib (C# Compiler Options)

--linkresource:<resource-info>

Used to link a specified resource to the assembly. The format of resource-info is filename[,name[,public|private]]

Linking a single resource with this option is an alternative to embedded an entire resource file with the --resource option.

This compiler option is equivalent to the C# compiler option of the same name. For more information, see /linkresource (C# Compiler Options).

--mlcompatibility

Used to ignore warnings that appear when you use features that are designed for compatibility with other versions of ML.

--noframework

Used to disable the default reference to the .NET Framework assembly.

--nointerfacedata

Used to instruct the compiler to omit the resource it normally adds to an assembly that includes F#-specific metadata.

--nologo

Don't show the banner text when launching the compiler.

--nooptimizationdata

Used to instruct the compiler to only include optimization essential for implementing inlined constructs. Inhibits cross-module inlining but improves binary compatibility.

--nowin32manifest

Used to instruct the compiler to omit the default Win32 manifest.

--nowarn:<int-list>

Disable specific warnings listed by number. Separate each warning number by a comma. You can discover the warning number for any warning from the compilation output.

This compiler option is equivalent to the C# compiler option of the same name. For more information, see /nowarn (C# Compiler Options).

--optimize[+|-] [<string-list>]

-O[+|-] [<string-list>]

Used to enable or disable optimizations. Some optimization options can be disabled or enabled selectively by listing them. These are: nojitoptimize, nojittracking, nolocaloptimize, nocrossoptimize, notailcalls.

--out:<output-filename>

-o:<output-filename>

Used to specify the name of the compiled assembly or module.

This compiler option is equivalent to the C# compiler option of the same name. For more information, see /out (C# Compiler Options).

--pdb:<pdb-filename>

Name the output debug PDB (program database) file. This option only applies when --debug is also enabled.

This compiler option is equivalent to the C# compiler option of the same name. For more information, see /pdb (C# Compiler Options).

--platform:<platform-name>

Used to specify that the generated code will only run on the specified platform (x86, Itanium, or x64), or, if the platform-name anycpu is chosen, specifies that the generated code can run on any platform.

This compiler option is equivalent to the C# compiler option of the same name. For more information, see /platform (C# Compiler Options).

--reference:<assembly-filename>

-r <assembly-filename>

Used to make code from an F# or .NET assembly available to the code being compiled.

This compiler option is equivalent to the C# compiler option of the same name. For more information, see /reference (C# Compiler Options).

--resource:<resource-filename>

Used to embed a managed resource file into the generated assembly.

This compiler option is equivalent to the C# compiler option of the same name. For more information, see /resource (C# Compiler Options).

--sig:<signature-filename>

Used to generate a signature file based on the generated assembly. For more information about signature files, see Signatures (F#).

--simpleresolution

Used to specify that assembly references should be resolved using directory-based Mono rules rather than MSBuild resolution. The default is to use MSBuild resolution except when running under Mono.

--standalone

Specifies to statically link the F# library and all referenced DLLs that the code being compiled depends on into the assembly being generated.

--staticlink:<assembly-name>

Used to statically link the given assembly and all referenced DLLs that depend on this assembly. Use the assembly name, not the DLL name.

--tailcalls[+|-]

Enable or disable the use of the tail IL instruction, which causes the stack frame to be reused for tail recursive functions. This option is enabled by default.

--target:[exe | winexe | library | module ] <output-filename>

Used to specify the type and file name of the generated compiled code.

  • exe means a console application

  • winexe means a Windows application, which differs from the console application in that it does not have standard input/output streams (stdin, stdout, and stderr) defined

  • library is an assembly without an entry point

  • module is a .NET module (.netmodule), which can later be combined with other modules into an assembly

  • This compiler option is equivalent to the C# compiler option of the same name. For more information, see /target (C# Compiler Options).

--times

Display timing information for compilation.

--utf8output

Used to enable printing compiler output in the UTF-8 encoding.

--warn:<warning-level>

Set a warning level (0 to 4). Each warning is given a level based on its severity. Level 4 gives more, but less severe, warnings, than level 0.

This compiler option is equivalent to the C# compiler option of the same name. For more information, see /warn (C# Compiler Options).

--warnaserror[+|-] [<int-list>]

Used to enable or disable the option to report warnings as errors. You can provide specific warning numbers to be disabled or enabled.

This compiler option is equivalent to the C# compiler option of the same name. For more information, see /warnaserror (C# Compiler Options).

--win32res:resource-filename

Used to add a Win32 resource file to the compilation.

This compiler option is equivalent to the C# compiler option of the same name. For more information, see /win32res (C# Compiler Options).

Title

Description

F# Interactive Options

Describes command-line options supported by the F# interpreter, fsi.exe.

Projects, User Interface Elements

Describes the UI for projects, including project property pages that provide build options.