Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[question] Model JSON 中如何标注互斥的编译器选项? #263

Open
MingcongBai opened this issue Jun 14, 2023 · 1 comment
Open

Comments

@MingcongBai
Copy link
Contributor

What you want to do

正在扩充 MIPS MTI GCC 类型项目的编译器选项。

Describe the problem

目前 在 mips.mti.gcc.model.json 中登记了一些额外的 MIPS MTI GCC 选项 ,但其中 -mmips16-mmicromips 两个选项是互斥的。目前在其他 Model 中没有观察到有可以标记两个选项互斥的功能。

Expected behavior

可标注 -mmips16-mmicromips 选项互斥。

@github0null
Copy link
Owner

因为 UI 里没有实现这样的逻辑(不支持一个选中后另一个变灰),因此没有互斥功能

简单的做法是,将两个选项合并为一个,使用 enum 来提供组合后的选项,并提供默认值

"<名称>": {
            "type": "selectable",
            "command": {
                "mips16": "-mips16 -mno-micromips",
                "micromips": "-mmicromips -mno-mips16",
                "false": "<默认值>"
            },
            "group": [
                "c",
                "cpp",
                "asm",
                "linker"
            ],
            "location": "first"
        },

MingcongBai pushed a commit to mips-studio/eide that referenced this issue Jun 16, 2023
- FIXME: -mmips16 and -mmicromips are mutually exclusive, but current model
implementation does not allow mutually exclusive conditions. [1]
- FIXME: -G option requires a numeric value, but current model implementation
does not allow this type. [2]

Ref [1]: github0null#263
Ref [2]: github0null#264
MingcongBai pushed a commit to mips-studio/eide that referenced this issue Jun 16, 2023
- FIXME: -mmips16 and -mmicromips are mutually exclusive, but current model
implementation does not allow mutually exclusive conditions. [1]
- FIXME: -G option requires a numeric value, but current model implementation
does not allow this type. [2]

Ref [1]: github0null#263
Ref [2]: github0null#264
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants