Search in sources :

Example 1 with Toolchain

use of com.jetbrains.cidr.cpp.toolchains.CPPToolchains.Toolchain in project intellij by bazelbuild.

the class ToolchainUtils method setDefaultDebuggerPath.

public static void setDefaultDebuggerPath(String debuggerPath) {
    ApplicationManager.getApplication().runWriteAction(() -> {
        CPPToolchains cppToolchains = CPPToolchains.getInstance();
        Toolchain toolchain = cppToolchains.getDefaultToolchain();
        if (toolchain != null) {
            cppToolchains.beginUpdate();
            toolchain.setDebuggerKind(DebuggerKind.CUSTOM_GDB);
            toolchain.setCustomGDBExecutablePath(debuggerPath);
            cppToolchains.endUpdate();
            return;
        }
        Toolchain newToolchain = createDefaultToolchain();
        newToolchain.setDebuggerKind(DebuggerKind.CUSTOM_GDB);
        newToolchain.setCustomGDBExecutablePath(debuggerPath);
        cppToolchains.beginUpdate();
        cppToolchains.addToolchain(newToolchain);
        cppToolchains.endUpdate();
    });
}
Also used : Toolchain(com.jetbrains.cidr.cpp.toolchains.CPPToolchains.Toolchain) CPPToolchains(com.jetbrains.cidr.cpp.toolchains.CPPToolchains)

Example 2 with Toolchain

use of com.jetbrains.cidr.cpp.toolchains.CPPToolchains.Toolchain in project intellij by bazelbuild.

the class ToolchainUtils method createDefaultToolchain.

private static Toolchain createDefaultToolchain() {
    Toolchain toolchain = new Toolchain(CPPToolchains.OSType.getCurrent());
    toolchain.setName(Toolchain.DEFAULT);
    return toolchain;
}
Also used : Toolchain(com.jetbrains.cidr.cpp.toolchains.CPPToolchains.Toolchain)

Aggregations

Toolchain (com.jetbrains.cidr.cpp.toolchains.CPPToolchains.Toolchain)2 CPPToolchains (com.jetbrains.cidr.cpp.toolchains.CPPToolchains)1