tomlau10 / gcc-make-run

Compile-run C/C++ source code and execute Makefile in Atom.
https://atom.io/packages/gcc-make-run
MIT License
24 stars 10 forks source link

Compiler Selection #39

Closed werling closed 5 months ago

werling commented 6 years ago

Create Plug-in! But there is one small issue: I'd like to choose a different compiler, but the program always compiles with default c++ and gcc. What im doing wrong? Also adding the compiler variables CXX and CC has no impact.

/Edit: Ok it only doesn't work if I select a Makefile. There it always uses the default compiler.

werling commented 6 years ago

Ok I see the problem. The library I'd like to compile uses in the Makefile the variables CXX and CC for the compiler selection. Is there a way in gcc-make-run to add make flags? I don't see it in the settings. There is a variable in the code, but it only can be set to -B if unconditional build is activated.

    mkFlags = if @shouldUncondBuild() then '-B' else ''

    # make
cmd = "\"#{mk}\" #{mkFlags} -f \"#{info.base}\""
werling commented 6 years ago

Ok I changed it by myself. I also added a checkbox to disable automatic execution of the build. I can provide the changed file, if somebody is interested. Its especially useful for cross building image

tomlau10 commented 5 months ago

It's a bit late, but I don't quite understand your issue.

In the setting page there is two options namely gcc Compiler and g++ Compiler where you can choose another compiler.

Also I don't think disable automatic execution of the build matches the idea of this extension because it aims to compile/make and run, not just compile. 😂