Document #:

ISO/IEC/JTC1/SC22/WG21/P3335R1

Date:

2024-09-16

Audience:

SG15

Authors:

René Ferdinand Rivera Morell

Reply-to:

grafikrobot@gmail.com

Copyright:

Copyright 2024 René Ferdinand Rivera Morell, Creative Commons Attribution 4.0 International License (CC BY 4.0)

1. Abstract

Specify a minimal set of core structured options [1] for C++ compiler front ends.

2. Revision History

2.1. Revision 1 (September 2024)

Per feedback from telecon discussion: remove debug option, remove safe optimization value, avoid file names as keys, use only singly-typed values.

2.2. Revision 0 (July 2024)

Initial text.

3. Motivation

Tools in the C++ ecosystem have dealt with using a myriad of different options to invoke C++ compiler front ends for decades. Although we have found ways to manage the variety it is advantageous to agree on a common language to reduce the growing complexities that the variety creates.

Having a standard common set of structured options allows for:

  • Reuse of implementation by tools that interface with compiler front ends.

  • Wider adoption of tools that use, as consumers or producers, the common options.

  • Lowers the barriers for unexperienced users as they have less to learn.

  • Can be a basis for other standards to form a common configuration vocabulary.

4. Scope

This proposal aims to specify a set of C++ compiler frontend structured options [1] sufficient to build common C++ use cases. This includes specifying both the names and semantics of the structured options.

This does not aim to standardize compiler frontend command line arguments. Although vendors are free to adopt the names and semantics specified if they wish. And we encourage such adoption.

5. Design

The approach for the names and semantics of the options follows these goals:

  • Prefer widely used terms in current tools, not just C++ compiler front ends.

  • Use widely understood semantics.

  • Improve the structure of the data.

5.1. File References

In various places the options need to refer to file names and paths. And in some of those instances it’s also possible to want to specify one or more attributes to the file. For example when indicating the language for a source file. We looked at various ways to achieve an arrangement to make that specification both optional and future proof. After discussions a simple JSON object with one required name key and string value for the path was chosen:

{
  "name": "file.ext"
}

Other fields are possible depending in the context of the file reference. For example to specify the language of a source file:

{
  "name": "main.cpp",
  "language": "c++"
}
Previously we had proposed using a multi-stage scheme to simplify the human editing of file references that allowed: a single string, an object with string, or an object with objects. Discussions pointed out difficulties in such dynamic parsing of values by some JSON parsers.

5.2. Lists

All lists are strictly JSON array values.

Previously we had proposed using a multi-stage scheme to simplify the human editing of lists that allowed lists with a single value to be abbreviated by the single value. Discussions pointed out difficulties in such dynamic parsing of values by some JSON parsers.

5.3. Examples

Below are some examples that show a traditional command line invocation and the corresponding structured options specification. The examples are meant to be informational only to illustrate how the structured options could work. As such they may include options that are not proposed in this document. The example command line invocations may also contain some options that are not present in the structured options. I.e. they are not meant to be a one-to-one correspondence. Generally the examples where generated by running a real build system and collecting the command lines it invokes.

5.3.1. Hello World

This is the classic simplest C++ program with the twist that we want to allow full debugging when running it.

"g++" -O0 -fno-inline -Wall -g -static "hello.cpp" -o "hello"
"cl" "hello.cpp" /Fehello -TP /EHs /GR /Z7 /Od /Ob0 /W3 /Op /MLd /DEBUG
  /subsystem:console

Those invocations can be represented as a somewhat more meaningful structured options. This specification is formulated to be a single cross-vendor object by using a vendor specific section to represent options that only msvc understands. And that other tools could ignore.

{
  "source": [{ "name": "hello.cpp" }],
  "output": [
    {
      "name": "hello",
      "kind": "exec"
    }
  ],
  "optimization": {
    "compile": "off",
    "inline": false
  },
  "warnings": {
    "enable": "all"
  },
  "runtime": {
    "multithread": false,
    "debug": true,
    "static": true
  },
  "vendor": {
    "msvc": {
      "subsystem": "console"
    }
  }
}

A single invocation that does everything is not particularly common, except as basic textbook examples. Here we see the more common case of compiling to produce an object file for the TU. Then linking to get the final executable.

"g++" --fPIC -O0 -fno-inline -Wall -g -c -o "hello.o" "hello.cpp"
"g++" -g "hello.o" -o "hello"

The compile only equivalent structured options:

{
  "source": [{ "name": "hello.cpp" }],
  "output": [{ "name": "hello.o", "kind": "object" }],
  "optimization": {
    "compile": "off",
    "inline": false
  },
  "warnings": {
    "enable": "all"
  },
  "runtime": {
    "multithread": false,
    "debug": true,
    "static": true
  }
}

Followed by the structured options to accomplish the link:

{
  "source": [{ "name": "hello.o" }],
  "output": [
    {
      "name": "hello",
      "kind": "exec"
    }
  ]
}

5.3.3. Many Sources

This is a single command B2 uses to bootstrap its engine on Linux with GCC, and Windows with MSVC. This is a variation on a simple basic invocation that builds many files with some extra options.

g++ -x c++ -std=c++11 -pthread -O2 -s -DNDEBUG bindjam.cpp builtins.cpp
  class.cpp command.cpp compile.cpp constants.cpp cwd.cpp debug.cpp
  debugger.cpp events.cpp execcmd.cpp execnt.cpp execunix.cpp filent.cpp
  filesys.cpp fileunix.cpp frames.cpp function.cpp glob.cpp hash.cpp
  hcache.cpp hdrmacro.cpp headers.cpp jam_strings.cpp jam.cpp jamgram.cpp
  lists.cpp make.cpp make1.cpp md5.cpp mem.cpp modules.cpp native.cpp
  option.cpp output.cpp parse.cpp pathnt.cpp pathsys.cpp pathunix.cpp
  regexp.cpp rules.cpp scan.cpp search.cpp startup.cpp tasks.cpp
  timestamp.cpp value.cpp variable.cpp w32_getreg.cpp mod_command_db.cpp
  mod_db.cpp mod_jam_builtin.cpp mod_jam_class.cpp mod_jam_errors.cpp
  mod_jam_modules.cpp mod_order.cpp mod_path.cpp mod_property_set.cpp
  mod_regex.cpp mod_sequence.cpp mod_set.cpp mod_string.cpp mod_summary.cpp
  mod_sysinfo.cpp mod_version.cpp -o b2

Other than many more files this example doesn’t differ much from the Hello World example.

{
  "source": [
    { "name": "bindjam.cpp" },
    { "name": "builtins.cpp" },
    { "name": "class.cpp" },
    { "name": "command.cpp" },
    { "name": "compile.cpp" },
    { "name": "constants.cpp" },
    { "name": "cwd.cpp" },
    { "name": "debug.cpp" },
    { "name": "debugger.cpp" },
    { "name": "events.cpp" },
    { "name": "execcmd.cpp" },
    { "name": "execnt.cpp" },
    { "name": "execunix.cpp" },
    { "name": "filent.cpp" },
    { "name": "filesys.cpp" },
    { "name": "fileunix.cpp" },
    { "name": "frames.cpp" },
    { "name": "function.cpp" },
    { "name": "glob.cpp" },
    { "name": "hash.cpp" },
    { "name": "hcache.cpp" },
    { "name": "hdrmacro.cpp" },
    { "name": "headers.cpp" },
    { "name": "jam_strings.cpp" },
    { "name": "jam.cpp" },
    { "name": "jamgram.cpp" },
    { "name": "lists.cpp" },
    { "name": "make.cpp" },
    { "name": "make1.cpp" },
    { "name": "md5.cpp" },
    { "name": "mem.cpp" },
    { "name": "modules.cpp" },
    { "name": "native.cpp" },
    { "name": "option.cpp" },
    { "name": "output.cpp" },
    { "name": "parse.cpp" },
    { "name": "pathnt.cpp" },
    { "name": "pathsys.cpp" },
    { "name": "pathunix.cpp" },
    { "name": "regexp.cpp" },
    { "name": "rules.cpp" },
    { "name": "scan.cpp" },
    { "name": "search.cpp" },
    { "name": "startup.cpp" },
    { "name": "tasks.cpp" },
    { "name": "timestamp.cpp" },
    { "name": "value.cpp" },
    { "name": "variable.cpp" },
    { "name": "w32_getreg.cpp" },
    { "name": "mod_command_db.cpp" },
    { "name": "mod_db.cpp" },
    { "name": "mod_jam_builtin.cpp" },
    { "name": "mod_jam_class.cpp" },
    { "name": "mod_jam_errors.cpp" },
    { "name": "mod_jam_modules.cpp" },
    { "name": "mod_order.cpp" },
    { "name": "mod_path.cpp" },
    { "name": "mod_property_set.cpp" },
    { "name": "mod_regex.cpp" },
    { "name": "mod_sequence.cpp" },
    { "name": "mod_set.cpp" },
    { "name": "mod_string.cpp" },
    { "name": "mod_summary.cpp" },
    { "name": "mod_sysinfo.cpp" },
    { "name": "mod_version.cpp" }
  ],
  "output": [{ "name": "b2", "kind": "exec" }],
  "define": [{ "name": "NDEBUG" }],
  "language": {
    "name": "c++",
    "standard": "11"
  },
  "optimization": {
    "compile": "minimal",
    "link": true,
    "msvc.global_data": true
  },
  "runtime": {
    "multithread": true,
    "debug": false,
    "static": true
  }
}
"cl" /nologo /MP /MT /TP /Feb2 /wd4996 /wd4675 /O2 /GL /EHsc /Zc:wchar_t /Gw
  -DNDEBUG  bindjam.cpp builtins.cpp class.cpp command.cpp compile.cpp
  constants.cpp cwd.cpp debug.cpp debugger.cpp events.cpp execcmd.cpp
  execnt.cpp execunix.cpp filent.cpp filesys.cpp fileunix.cpp frames.cpp
  function.cpp glob.cpp hash.cpp hcache.cpp hdrmacro.cpp headers.cpp jam.cpp
  jamgram.cpp lists.cpp make.cpp make1.cpp md5.cpp mem.cpp modules.cpp
  native.cpp option.cpp output.cpp parse.cpp pathnt.cpp pathsys.cpp
  pathunix.cpp regexp.cpp rules.cpp scan.cpp search.cpp jam_strings.cpp
  startup.cpp tasks.cpp timestamp.cpp value.cpp variable.cpp w32_getreg.cpp
  mod_command_db.cpp mod_db.cpp mod_jam_builtin.cpp mod_jam_class.cpp
  mod_jam_errors.cpp mod_jam_modules.cpp mod_order.cpp mod_path.cpp
  mod_property_set.cpp mod_regex.cpp mod_sequence.cpp mod_set.cpp
  mod_string.cpp mod_summary.cpp mod_sysinfo.cpp mod_version.cpp
  /link kernel32.lib advapi32.lib user32.lib
  /MANIFEST:EMBED /MANIFESTINPUT:b2.exe.manifest

The msvc equivalent has the addition of listing some system libraries and the special Windows embedded manifest for the executable.

{
  "source": [
    { "name": "bindjam.cpp" },
    { "name": "builtins.cpp" },
    { "name": "class.cpp" },
    { "name": "command.cpp" },
    { "name": "compile.cpp" },
    { "name": "constants.cpp" },
    { "name": "cwd.cpp" },
    { "name": "debug.cpp" },
    { "name": "debugger.cpp" },
    { "name": "events.cpp" },
    { "name": "execcmd.cpp" },
    { "name": "execnt.cpp" },
    { "name": "execunix.cpp" },
    { "name": "filent.cpp" },
    { "name": "filesys.cpp" },
    { "name": "fileunix.cpp" },
    { "name": "frames.cpp" },
    { "name": "function.cpp" },
    { "name": "glob.cpp" },
    { "name": "hash.cpp" },
    { "name": "hcache.cpp" },
    { "name": "hdrmacro.cpp" },
    { "name": "headers.cpp" },
    { "name": "jam_strings.cpp" },
    { "name": "jam.cpp" },
    { "name": "jamgram.cpp" },
    { "name": "lists.cpp" },
    { "name": "make.cpp" },
    { "name": "make1.cpp" },
    { "name": "md5.cpp" },
    { "name": "mem.cpp" },
    { "name": "modules.cpp" },
    { "name": "native.cpp" },
    { "name": "option.cpp" },
    { "name": "output.cpp" },
    { "name": "parse.cpp" },
    { "name": "pathnt.cpp" },
    { "name": "pathsys.cpp" },
    { "name": "pathunix.cpp" },
    { "name": "regexp.cpp" },
    { "name": "rules.cpp" },
    { "name": "scan.cpp" },
    { "name": "search.cpp" },
    { "name": "startup.cpp" },
    { "name": "tasks.cpp" },
    { "name": "timestamp.cpp" },
    { "name": "value.cpp" },
    { "name": "variable.cpp" },
    { "name": "w32_getreg.cpp" },
    { "name": "mod_command_db.cpp" },
    { "name": "mod_db.cpp" },
    { "name": "mod_jam_builtin.cpp" },
    { "name": "mod_jam_class.cpp" },
    { "name": "mod_jam_errors.cpp" },
    { "name": "mod_jam_modules.cpp" },
    { "name": "mod_order.cpp" },
    { "name": "mod_path.cpp" },
    { "name": "mod_property_set.cpp" },
    { "name": "mod_regex.cpp" },
    { "name": "mod_sequence.cpp" },
    { "name": "mod_set.cpp" },
    { "name": "mod_string.cpp" },
    { "name": "mod_summary.cpp" },
    { "name": "mod_sysinfo.cpp" },
    { "name": "mod_version.cpp" },
    { "name": "kernel32.lib" },
    { "name": "advapi32.lib" },
    { "name": "user32.lib" }
  ],
  "output": [{ "name": "b2", "kind": "exec" }],
  "define": [{ "name": "NDEBUG" }],
  "language": {
    "name": "c++",
    "standard": "11"
  },
  "optimization": {
    "compile": "minimal",
    "link": true,
    "msvc.global_data": true
  },
  "runtime": {
    "multithread": true,
    "debug": false,
    "static": true
  },
  "vendor": {
    "msvc": {
      "manifest": {
        "source": "b2.exe.manifest",
        "embed": true
      }
    }
  }
}

5.4. Options

In the tables below compiler drivers or front ends we list the un-prefixed option name. And for build systems we list any abstraction for the option. But importantly, we don’t list if the build system only allows for specifying the raw option. As it doesn’t add any more information than what is given for the compiler driver information.

The options specified below show first how the concept is specified in two kinds of tools, compiler driver/front-ends and build systems. This is a small, but hopefully representative, sampling of syntax and semantics. The tools considered are: MSVC, [2] GCC, [3] CMake, [4] B2 [5]

And subsequently show the chosen key, value, and semantics of the option. The schema for the value is explained in the value if it’s brief. But otherwise defined in the semantics of each. As mentioned previously there can be multiple value types for an option. Each of those is outlined to the extent that the specific option allows (currently). The explanations of the options are not exhaustively precise. That is left for future wording.

5.4.1. Source

Tool Name Semantics

MSVC

file

A file specified as a regular argument is added as a source to process.

GCC

file

A file specified as a regular argument is added as a source to process.

CMake

file

A file specified as an argument to a target is added as a source to process.

B2

file

A file specified as an argument to a target is added as a source to process.

Key

Use std.source or shortened source.

Value

An array of Source Object values.

Semantics

Adds the sources given to the set of files to process.

Merge Semantics

The sources in this specification are appended to any existing sources.

5.4.1.1. Source Object

A source is specified as an object it consist of at minimum a name field specifying the file name of the source. Other fields are optional. And, if possible, the tool can inspect the source (or name) to determine values for unspecified fields.

name

The required file name of the source.

language

An optional Language that the source contains.

kind

An optional value that indicates the kind of Output that generated the file.

Examples

{
  "source": [
    {
      "name": "main.cpp",
      "language": "c++"
    }
  ]
}
{
  "source": [
    {
      "name": "main.cpp"
    },
    {
      "name": "utils.cpp"
    },
    {
      "name": "algo.cpp"
    },
    {
      "name": "api.i",
      "language": "c"
    }
  ]
}

5.4.2. Output

Tool Name Semantics

MSVC

FA, Fa, Fd, Fe, Fi, Fm, Fo, Fp, FR

Set the name of the generated output. The option specifies the kind of output generated as: FA, Fa (assembly); Fd (debug); Fe (executable); Fi (preprocessed); Fm (mapfile); Fo (object); Fp (pch); FR (browser)

GCC

o, along with c, S, and E

Sets the file to output with (o). And with the related options controls the kind of output to generate: c (compile → object), S (compile → assembly), E (preprocessed).

CMake

add_executable, add_library

Defines a target for an executable or library.

B2

exe, obj, lib

Defines a target of the given type: exe (executable), obj (object), lib (static or dynamic library).

Key

Use std.output or shortened output.

Value

An array of Output Object values.

Semantics

Specifies the output file, or files, to generate when processing the sources.

Merge Semantics

The outputs in this specification are appended to any existing outputs.

5.4.2.1. Output Object

A single output specifies an object consisting at minimum of the name and kind fields. Other fields are optional. And, if possible, the tool can infer the other fields as needed.

name

The required file name of the output.

kind

The kind of output. The kind of output also indicates the type of operation the tool will do. Possible kinds of outputs:

exec

Links the compiled sources into an executable file.

object

Compiles the sources into a linkable object file.

dynamic_lib

Links the compiled sources into a dynamically loadable library.

archive_lib

Collects the compiled sources into an archive library of object files.

Examples

{
  "output": [{ "name": "a.out", "kind": "exec" }]
}

5.4.3. Include Directories

Tool Name Semantics

MSVC

I, INCLUDE env var

Adds the directory to the include search list.

GCC

I

Adds the directory to the include search list.

CMake

include_directories() or INCLUDE_DIRECTORIES

Adds the directories to the include search list.

B2

include

Adds the directory, order unspecified, to the include search list.

Key

Use std.include_dirs or shortened include_dirs.

Value

An array of string-s. Each string is a pathname of which interpretation is up to the application.

Semantics

Adds the listed pathnames to the end of the include directories of the application. It is up to the application to interpret how the composed list of directories is used. But it commonly interpreted as #include preprocessor directives to look for files in the order of the include directories list.

Merge Semantics

The directories in this specification are appended to any existing directories.

Examples

{
  "include_dirs": ["/opt/boost_config/include", "/opt/openssl/include"]
}

5.4.4. Library Directories

Tool Name Semantics

MSVC

/link /LIBPATH:dir or LIB env var

Adds to the list of directories to search for link libs. The LIBPATH paths are searched before the LIB paths.

GCC

L

CMake

link_directories(AFTER/BEFORE …​)

Adds to the list of directories which will be used by the linker to search for libraries. Specifying AFTER or BEFORE will append or prepend the given directories to the existing list of directories.

B2

library-path

Adds to the list of directories which will be used by the linker to search for libraries.

Key

Use std.library_dirs or shortened library_dirs.

Value

An array of string-s. Each string is a pathname of which interpretation is up to the application.

Semantics

Adds the listed pathnames to the end of the library search directories of the application. It is up to the application to interpret how the composed list of directories is used.

Merge Semantics

The directories in this specification are appended to any existing directories.

Examples

{
  "library_dirs": ["/opt/boost_config/lib", "/opt/openssl/lib"]
}

5.4.5. Define Preprocessor Symbols

Tool Name Semantics

MSVC

D

Defines a preprocessor symbol to a value overriding any previous definition. If no value is given 1 is used as the value.

GCC

D

Defines a preprocessor symbol to a value overriding any previous definition. If no value is given 1 is used as the value.

CMake

add_compile_definitions, target_compile_definitions, COMPILE_DEFINITIONS

Defines a preprocessor symbol to a value overriding any previous definition. If no value is given no value is used and the value is up to the compiler.

B2

define

Defines a preprocessor symbol to a value overriding any previous definition. If no value is given no value is used and the value is up to the compiler.

Key

Use std.define or shortened define.

Value

An array of Preprocessor Symbol values.

Semantics

For each symbol a language preprocessor will define the symbol to the value.

Merge Semantics

The definitions in this specification either: add to existing set of definitions when the symbol doesn’t exist, or replace the definitions when the symbol already exists.

5.4.5.1. Preprocessor Symbol

A preprocessor symbol specifies a name and value. The value defined by the preprocessor is converted as follows based on the type of JSON value given:

  • JSON number is converted to a string and pasted.

  • JSON string is used directly.

  • JSON boolean is converted as true1 and false0.

  • JSON null converts to nothing, and hence the default implementation value should be used.

Examples

{
  "define": [
    { "name": "BOOST_ALL_NO_LIB", "value": 1 },
    { "name": "_WIN32_WINNT", "value": "0x0600" },
    { "name": "_GNU_SOURCE", "value": true },
    { "name": "U_USING_ICU_NAMESPACE", "value": false },
    { "name": "NOMINMAX", "value": null }
  ]
}

5.4.6. Undefine Preprocessor Symbols

Tool Name Semantics

MSVC

U

Undefines the given preprocessor symbol.

GCC

U

Undefines the given preprocessor symbol.

CMake

N/A

B2

undef

Undefines the given preprocessor symbol.

Key

Use std.undef or shortened undef.

Value

The option would be either a single string or an array of string-s. Each string is a symbol to undefine.

Semantics

For each string in the value "undefines" the preprocessor symbol. The option is evaluated after the define option.

Merge Semantics

The undefs in this specification either: add to existing set of undefs when the symbol doesn’t exist, or replace the undefs when the symbol already exists.

{
  "undef": ["NDEBUG"]
}

5.4.7. Language

Tool Name Semantics

MSVC

Tc, TC, Tp, TP

Specified a source file is a C (Tc or TC) or C++ (Tp or TP) file. Otherwise the file extension is used.

GCC

x language

Specified source files are the given language. Otherwise the file extension is used.

CMake

set_property(SOURCE language …​)

Specified source files are the given language. Otherwise the file extension is used.

B2

[ cast _ language : …​ ]

Specified source files are the given language. Otherwise the file extension is used.

Key

Use std.language or shortened language.

Value

The option value is a single string indicating the name of a language. The set of values is open. But at minimum c++ and c must be recognized. Other values could be: assembly, objective-c, objective-c++, fortran, go, d, ada.

Semantics

The given language sets the one to use for sources that do not otherwise specify one. The tool should indicate an error for languages it doesn’t recognize.

{
  "language": "c++"
}
Merge Semantics

The language in this specification replaces an existing language specification.

5.4.8. Optimization

Tool Name Semantics

MSVC

Od, O1, O2, Os, Ot, Ox, and more

Disables (Od) or enables (the rest) code generation optimizations.

GCC

O0, O1, O2, O3, Os, Og, Oz, and more

Disables (O0) or enables (the rest) code generation optimizations.

CMake

DCMAKE_BUILD_TYPE=Release

Generates build description that may enable optimizations.

B2

<optimization>off, <optimization>minimal, <optimization>speed, <optimization>space, <optimization>debug

Disables (off) or enables (the rest) code generation optimizations for the targets it’s applied to.

Key

Use std.optimization or shortened optimization.

Value

An Optimization Object.

Semantics

The level of optimization is applied to all the sources being processed.

Merge Semantics

The fields in the object value replace existing optimization fields. For a single string value the equivalent object for that value is merged.

Examples

{
  "optimization": { "compile": "minimal" }
}
5.4.8.1. Optimization Object

An optimization object can have the following fields:

If the value is an object it can have the following fields, and semantics:

compile

The set of values for compile is fixed, but tools are free to ignore or use equivalent for the various values. Which optimizations the tool performs for each value is up to the tool. The only required semantic is for off that must disable all optimizations. Possible values:

  • off - Disable optimizations.

  • minimal - Optimizations that may improve speed and space.

  • speed - Prefer speed over space optimizations.

  • space - Prefer smaller binaries over speed optimizations.

  • debug - Optimize such that debugging capabilities are preserved.

link

A boolean value that when true enables link time (whole program) optimizations. When false, or not present, disables link time optimizations.

5.4.9. Vendor

We recognize that std options will never be sufficient, or practical, to delineate all possible functionality. To accommodate the flexibility needed over time to support all build capabilities we need to allow for tools to define their own options outside of the standard. While it is possible for tools to use scoped keys to specify their own options, that method may be harder to manage for some environments. To allow for easier destructuring we introduce a vendor option.

Key

Use std.vendor or shortened vendor.

Value

The option contains a single object with tool defined keys and values. The names of the keys, or the type of the values, or the semantics are not specified here. And it is up to the tool creators to coordinate on unique keys.

Semantics

The value in the vendor specific fields is interpreted per the tool requirements. Any number of vendor keys+values is allowed. Tools are not restricted in what they support. Either of their own keys+values. Or the Keys+values of other vendor tools. This allows from some level of interchange for tools that need to support some understanding of what other tools specify. For example static analyzers that often need to digest sources across different vendors.

Merge Semantics

The semantics are up to the vendor to specify for the individual options they define. Above that, if a vendor key in this specification is not present in the existing specification it is added. Otherwise, for a key in the vendor object in this specification is not present in the existing specification it is added.

Examples

{
  "optimization": {
    "compile": "safe",
    "link": true,
    "vendor": {
      "msvc": {
        "global_data": true
      }
    }
  },
  "vendor": {
    "msvc": {
      "manifest": {
        "source": "b2.exe.manifest",
        "embed": true
      },
      "subsystem": "console"
    }
  }
}

6. License

This work is licensed under the Creative Commons Attribution 4.0 International License. To view a copy of this license, visit http://creativecommons.org/licenses/by/4.0/ or send a letter to Creative Commons, PO Box 1866, Mountain View, CA 94042, USA.


1. P3051; Structured Response Files(https://wg21.link/P3051)
2. MSVC, Compiler options listed by category (https://learn.microsoft.com/en-us/cpp/build/reference/compiler-options-listed-by-category)
3. GCC Command Options (https://gcc.gnu.org/onlinedocs/gcc-14.1.0/gcc/Invoking-GCC.html)
4. CMake Reference Documentation (https://cmake.org/cmake/help/latest/index.html)
5. B2 User Manual (https://www.bfgroup.xyz/b2/manual/release/index.html)