{
    "title": "Any Gcc Options",
    "$schema": "http://json-schema.org/draft-04/schema#",
    "type": "object",
    "definitions": {
        "FLAGS": {
            "markdownDescription": "Options",
            "description.zh-cn": "选项",
            "size": "huge",
            "type": "string",
            "default": ""
        }
    },
    "properties": {
        "beforeBuildTasks": {
            "markdownDescription": "List of commands to execute before build",
            "description.zh-cn": "构建前要执行的命令列表",
            "type": "array",
            "default": [
                {
                    "name": "clean",
                    "command": "del /Q \"${OutDir}\\*.*\""
                }
            ],
            "items": {
                "type": "object",
                "required": [
                    "name",
                    "command"
                ],
                "properties": {
                    "name": {
                        "markdownDescription": "A readable name for display",
                        "description.zh-cn": "用于显示的可读名称",
                        "type": "string"
                    },
                    "command": {
                        "markdownDescription": "Shell command line",
                        "description.zh-cn": "Shell 命令行",
                        "type": "string"
                    },
                    "disable": {
                        "markdownDescription": "Disable this command",
                        "description.zh-cn": "禁用此命令",
                        "type": "boolean",
                        "enum": [
                            true,
                            false
                        ]
                    },
                    "abortAfterFailed": {
                        "markdownDescription": "Whether to skip subsequent commands if this command failed",
                        "description.zh-cn": "是否在此命令失败时，跳过后续的命令",
                        "type": "boolean",
                        "enum": [
                            true,
                            false
                        ]
                    },
                    "stopBuildAfterFailed": {
                        "markdownDescription": "Whether to stop compiling directly when this command failed",
                        "description.zh-cn": "是否在此命令失败时，直接停止编译",
                        "type": "boolean",
                        "enum": [
                            true,
                            false
                        ]
                    }
                }
            }
        },
        "afterBuildTasks": {
            "markdownDescription": "List of commands to execute after build",
            "description.zh-cn": "构建结束后要执行的命令列表",
            "type": "array",
            "default": [
                {
                    "name": "clean",
                    "command": "del \"${OutDir}\\*._*\""
                }
            ],
            "items": {
                "type": "object",
                "required": [
                    "name",
                    "command"
                ],
                "properties": {
                    "name": {
                        "markdownDescription": "A readable name for display",
                        "description.zh-cn": "用于显示的可读名称",
                        "type": "string"
                    },
                    "command": {
                        "markdownDescription": "Shell command line",
                        "description.zh-cn": "Shell 命令行",
                        "type": "string"
                    },
                    "disable": {
                        "markdownDescription": "Disable this command",
                        "description.zh-cn": "禁用此命令",
                        "type": "boolean",
                        "enum": [
                            true,
                            false
                        ]
                    },
                    "abortAfterFailed": {
                        "markdownDescription": "Whether to skip subsequent commands if this command failed",
                        "description.zh-cn": "是否在此命令失败时，跳过后续的命令",
                        "type": "boolean",
                        "enum": [
                            true,
                            false
                        ]
                    }
                }
            }
        },
        "global": {
            "markdownDescription": "Global Options",
            "description.zh-cn": "全局选项",
            "type": "object",
            "properties": {
                "output-debug-info": {
                    "markdownDescription": "Output debug information",
                    "description.zh-cn": "输出调试信息",
                    "type": "string",
                    "default": "disable",
                    "enum": [
                        "disable",
                        "enable",
                        "dwarf-2",
                        "dwarf-3",
                        "dwarf-4",
                        "dwarf-5"
                    ],
                    "enumDescriptions": [
                        "disable",
                        "enable",
                        "enable with dwarf-2",
                        "enable with dwarf-3",
                        "enable with dwarf-4",
                        "enable with dwarf-5"
                    ]
                },
                "callgraph-info": {
                    "markdownDescription": "Enable callgraph information (-fcallgraph-info)",
                    "description.zh-cn": "生成调用图信息(-fcallgraph-info)",
                    "type": "boolean"
                },
                "stack-usage": {
                    "markdownDescription": "Enable stack usage information (-fstack-usage)",
                    "description.zh-cn": "生成堆栈统计信息(-fstack-usage)",
                    "type": "boolean"
                },
                "misc-control": {
                    "markdownDescription": "Global Options",
                    "description.zh-cn": "编译器全局选项",
                    "$ref": "#/definitions/FLAGS",
                    "default": ""
                }
            }
        },
        "c/cpp-compiler": {
            "markdownDescription": "C/C++ Compiler Options",
            "description.zh-cn": "C/C++ 编译器选项",
            "type": "object",
            "properties": {
                "language-c": {
                    "markdownDescription": "C Standard",
                    "description.zh-cn": "C 标准",
                    "type": "string",
                    "default": "",
                    "enum": [
                        "c89",
                        "c90",
                        "c99",
                        "c11",
                        "c17",
                        "c23",
                        "gnu89",
                        "gnu90",
                        "gnu99",
                        "gnu11",
                        "gnu17",
                        "gnu23"
                    ]
                },
                "language-cpp": {
                    "markdownDescription": "C++ Standard",
                    "description.zh-cn": "C++ 标准",
                    "type": "string",
                    "default": "",
                    "enum": [
                        "c++98",
                        "gnu++98",
                        "c++11",
                        "gnu++11",
                        "c++14",
                        "gnu++14",
                        "c++17",
                        "gnu++17",
                        "c++20",
                        "gnu++20",
                        "c++23",
                        "gnu++23"
                    ]
                },
                "optimization": {
                    "markdownDescription": "Optimization Level",
                    "description.zh-cn": "代码优化级别",
                    "type": "string",
                    "default": "level-0",
                    "enum": [
                        "level-0",
                        "level-1",
                        "level-2",
                        "level-3",
                        "level-size",
                        "level-size-Oz",
                        "level-fast",
                        "level-debug"
                    ],
                    "enumDescriptions": [
                        "-O0(None)",
                        "-O1",
                        "-O2(Faster)",
                        "-O3(Fastest)",
                        "-Os(Fastest, Smallest)",
                        "-Oz(Aggressive Size Optimize)",
                        "-Ofast(Aggressive Speed Optimize)",
                        "-Og(Keep Debug Info)"
                    ]
                },
                "optimization-lto": {
                    "markdownDescription": "Link-time Optimization (-flto)",
                    "description.zh-cn": "链接时优化 (-flto)",
                    "type": "boolean"
                },
                "one-elf-section-per-function": {
                    "markdownDescription": "Function Sections (-ffunction-sections)",
                    "type": "boolean"
                },
                "one-elf-section-per-data": {
                    "markdownDescription": "Data Sections (-fdata-sections)",
                    "type": "boolean"
                },
                "signed-char": {
                    "markdownDescription": "Signed Char (-fsigned-char)",
                    "description.zh-cn": "Signed Char (-fsigned-char)",
                    "type": "boolean"
                },
                "no-rtti": {
                    "markdownDescription": "Not use RTTI (-fno-rtti)",
                    "description.zh-cn": "禁用运行时类型信息 (-fno-rtti)",
                    "type": "boolean"
                },
                "no-exceptions": {
                    "markdownDescription": "Not use exceptions (-fno-exceptions)",
                    "description.zh-cn": "禁用异常处理 (-fno-exceptions)",
                    "type": "boolean"
                },
                "warnings": {
                    "markdownDescription": "Warning Level",
                    "description.zh-cn": "警告等级",
                    "type": "string",
                    "default": "unspecified",
                    "enum": [
                        "unspecified",
                        "no-warnings",
                        "all-warnings",
                        "more-strict-warnings"
                    ],
                    "enumDescriptions": [
                        "unspecified",
                        "no warnings",
                        "all warnings",
                        "all warnings (strict)"
                    ]
                },
                "turn-Warning-into-errors": {
                    "markdownDescription": "Turn warnings into errors",
                    "description.zh-cn": "将警告转化为错误",
                    "type": "boolean"
                },
                "C_FLAGS": {
                    "markdownDescription": "C Compiler Options",
                    "description.zh-cn": "C 编译器选项",
                    "$ref": "#/definitions/FLAGS",
                    "default": ""
                },
                "CXX_FLAGS": {
                    "markdownDescription": "C++ Compiler Options",
                    "description.zh-cn": "C++ 编译器选项",
                    "$ref": "#/definitions/FLAGS",
                    "default": ""
                }
            }
        },
        "asm-compiler": {
            "markdownDescription": "Assembler Options",
            "description.zh-cn": "汇编器选项",
            "type": "object",
            "properties": {
                "defines": {
                    "readable_name": "Preprocessor Definitions",
                    "readable_name.zh-cn": "预处理器定义",
                    "markdownDescription": "Preprocessor Definitions",
                    "description.zh-cn": "预处理器定义",
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                },
                "ASM_FLAGS": {
                    "markdownDescription": "Assembler Options",
                    "description.zh-cn": "汇编器选项",
                    "$ref": "#/definitions/FLAGS",
                    "default": "-c -x assembler"
                }
            }
        },
        "linker": {
            "markdownDescription": "Linker Options",
            "description.zh-cn": "链接器选项",
            "type": "object",
            "properties": {
                "linker-type": {
                    "type": "string",
                    "default": "gcc",
                    "description": "Linker Type",
                    "description.zh-cn": "链接器类型",
                    "enum": [
                        "gcc",
                        "g++",
                        "ld"
                    ]
                },
                "output-format": {
                    "type": "string",
                    "default": "elf",
                    "description": "Output Format",
                    "description.zh-cn": "输出格式",
                    "enum": [
                        "elf",
                        "lib"
                    ],
                    "enumDescriptions": [
                        "ELF",
                        "LIB"
                    ]
                },
                "$disableOutputTask": {
                    "type": "boolean",
                    "markdownDescription": "Don't Output Hex/Bin/S19 Files",
                    "description.zh-cn": "不生成 Hex/Bin/S19 等二进制文件",
                    "enum": [
                        true,
                        false
                    ]
                },
                "$outputTaskExcludes": {
                    "type": "array",
                    "markdownDescription": "Don't Output Specific Binary Files",
                    "description.zh-cn": "不生成指定的二进制文件",
                    "default": [],
                    "items": {
                        "type": "string",
                        "default": ".bin",
                        "enum": [
                            ".bin",
                            ".hex"
                        ],
                        "enumDescriptions": [
                            "*.bin file",
                            "*.hex file"
                        ]
                    }
                },
                "remove-unused-input-sections": {
                    "markdownDescription": "Remove Unused Input Sections (-Wl,--gc-sections)",
                    "type": "boolean"
                },
                "use-linker-plugin": {
                    "markdownDescription": "Enable the linker plugin during LTO (-fuse-linker-plugin)",
                    "type": "boolean"
                },
                "print-mem-usage": {
                    "markdownDescription": "Print Memory Usage For Each Section (-Wl,--print-memory-usage)",
                    "type": "boolean"
                },
                "elf-suffix": {
                    "type": "string",
                    "size": "small",
                    "readable_name": "Executable Suffix",
                    "readable_name.zh-cn": "可执行文件后缀",
                    "description": ".elf (default)",
                    "description.zh-cn": ".elf (default)",
                    "default": ".elf"
                },
                "LD_FLAGS": {
                    "readable_name": "Linker Options",
                    "readable_name.zh-cn": "链接器选项",
                    "markdownDescription": "Use '-Wl[,option]...' pass options to the linker",
                    "description.zh-cn": "使用 '-Wl[,option]...' 传递链接器选项",
                    "$ref": "#/definitions/FLAGS",
                    "default": ""
                },
                "LIB_FLAGS": {
                    "readable_name": "Lib Options",
                    "readable_name.zh-cn": "链接库",
                    "markdownDescription": "Lib Flags, like: -lxxx",
                    "description.zh-cn": "链接库，例如：-lxxx",
                    "$ref": "#/definitions/FLAGS",
                    "default": ""
                },
                "object-order": {
                    "type": "array",
                    "readable_name": "Object Order",
                    "readable_name.zh-cn": "Object Order",
                    "markdownDescription": "Object Order (used to determine the order in which object files are linked)",
                    "description.zh-cn": "Object Order（用于决定某些 obj 文件的链接顺序）",
                    "default": [],
                    "items": {
                        "type": "object",
                        "properties": {
                            "pattern": {
                                "type": "string",
                                "readable_name": "Pattern",
                                "description": "A glob pattern (https://github.com/dazinator/DotNet.Glob) to match a object (*.o) file",
                                "default": "**/your/pattern/for/object/file/path/*.o"
                            },
                            "order": {
                                "type": "number",
                                "readable_name": "Order",
                                "description": "An integer number (The smaller the value, the higher the priority)",
                                "default": 0
                            }
                        }
                    }
                }
            }
        }
    }
}