Author Topic: Compiler Plugin: Plan to add compiler for MSys2  (Read 20529 times)

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Compiler Plugin: Plan to add compiler for MSys2
« on: October 23, 2016, 05:34:18 pm »
I am planning to add a Compiler toolchain settings for the MSys2's GCC Compiler.

The planned name is "msys2-gcc". This is one of the things that will be hard to changed; so, I need to confirm the name is OK?
The planned title is "MSys2 GCC".

I plan to add an variable expansion of "$(TARGET_COMPILER_PREFIX)". http://wiki.codeblocks.org/index.php/Variable_expansion

I, also, plan to add variable expansion of "$(TARGET_WORKING_DIR)".

Both of the above variable expansions are going to use forward slashes instead of backslashes.

On my computer, "$(TARGET_COMPILER_DIR)" is "C:\Apps32\MSys2\mingw32\".
While the "$(TARGET_COMPILER_PREFIX)" will be "C:/Apps32/MSys2/mingw32". Notice the last slash is missing.

Tim S.

C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Compiler Plugin: Plan to add compiler for MSys2
« Reply #1 on: October 23, 2016, 07:45:50 pm »
What is different with this compiler that it needs a separate entry?
Can't it be made as a copy of the original gcc compiler?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: Compiler Plugin: Plan to add compiler for MSys2
« Reply #2 on: October 23, 2016, 09:28:53 pm »
What is different with this compiler that it needs a separate entry?
Can't it be made as a copy of the original gcc compiler?

No; but, it might be able to be a copy of the CygWin compiler.
I am just planning on copying the three CygWin compiler files (cpp, h, and xml).
I could instead just edit the three CygWin files instead of copying them.

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: Compiler Plugin: Plan to add compiler for MSys2
« Reply #3 on: October 23, 2016, 09:37:25 pm »
Ah, I think you mean I should try to create two xml files; instead of doing it the way the Cygwin compiler did it.

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Compiler Plugin: Plan to add compiler for MSys2
« Reply #4 on: October 23, 2016, 11:28:38 pm »
No, I mean exactly: why do we need to have this as a separate compiler in the list of compilers?
Isn't this just another gcc compiler? So a user will set it up just by adjusting the toolchain paths for a gcc compiler.
If we need to improve autodetection for it we should do so and not add another compiler in the already very long list of compilers most users have no idea what to do with!

Probably we should modify this dialog to make users add compilers in the list and not stick them by default there... but this is a bit more complex task...
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: Compiler Plugin: Plan to add compiler for MSys2
« Reply #5 on: October 23, 2016, 11:51:34 pm »
OK, I now understand what you mean; so, I will just work on adding the two macros that I seem to need using the MSys2's GCC.

And, I will work on directions to edit the existing "GCC" or "CYGWIN" compiler to use the MSys2's GCC; the changes are NOT that great; so, I can see NOT having the compiler installed by default by the CB Dev installer.

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: Compiler Plugin: Plan to add compiler for MSys2
« Reply #6 on: October 24, 2016, 12:01:17 am »
Probably we should modify this dialog to make users add compilers in the list and not stick them by default there... but this is a bit more complex task...

This does sound like the best newbie friendly way to solve the compiler list being so wrong long.

Any, ideas on the short list of compiler to have installed?
These two "null" and "gcc" are needed in the list; but, what others should default to being checked.
And, what is the name to be used to name this list? I feel compiler list is misleading.
CB Toolchain list?

Tim S.


C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Compiler Plugin: Plan to add compiler for MSys2
« Reply #7 on: October 24, 2016, 12:23:22 am »
Any, ideas on the short list of compiler to have installed?
These two "null" and "gcc" are needed in the list; but, what others should default to being checked.
The list should be empty if the autodetector hasn't found a compiler.

And, what is the name to be used to name this list? I feel compiler list is misleading.
Why do you think it should be a list? It should be in a new dialog hidden behind an Add button in just below the selected compiler combo box we have now.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: Compiler Plugin: Plan to add compiler for MSys2
« Reply #8 on: October 24, 2016, 12:41:17 am »
Any, ideas on the short list of compiler to have installed?
These two "null" and "gcc" are needed in the list; but, what others should default to being checked.
The list should be empty if the autodetector hasn't found a compiler.

And, what is the name to be used to name this list? I feel compiler list is misleading.
Why do you think it should be a list? It should be in a new dialog hidden behind an Add button in just below the selected compiler combo box we have now.

Ah, you thinking a runtime GUI option, I was thinking Windows Installer option to select which ones to install.
But, your method would be better.

Tim S.

C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Compiler Plugin: Plan to add compiler for MSys2
« Reply #9 on: October 24, 2016, 01:12:57 am »
Of course it will be a GUI option. We don't want to bundle more than one compiler in the installer.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: Compiler Plugin: Plan to add compiler for MSys2
« Reply #10 on: October 24, 2016, 01:14:55 am »
How about another check box on the "Global Compiler Setting" "Other Settings" ?
Right above or below the "Enable non-platform compilers".

Tim S.

C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: Compiler Plugin: Plan to add compiler for MSys2
« Reply #11 on: October 24, 2016, 01:25:18 am »
How about another check box on the "Global Compiler Setting" "Other Settings" ?
Right above or below the "Enable non-platform compilers".

Tim S.

I would like a option to disable auto compiler detection and this sounds like a good place to add this, also.

I will see how hard it is to add this feature(s).

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: Compiler Plugin: Plan to add compiler for MSys2
« Reply #12 on: October 24, 2016, 01:37:43 am »
How about another check box on the "Global Compiler Setting" "Other Settings" ?
Right above or below the "Enable non-platform compilers".

Tim S.

I have thought about it and I think the new options should go with the "Enable non-platform compilers"; but, it seems that the location of "Enable non-platform compilers" might be in the wrong place.

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: Compiler Plugin: Plan to add compiler for MSys2
« Reply #13 on: October 24, 2016, 02:16:31 am »
Looks like check box needed could be called
Show only Detected or user-defined Compilers.

Problem seems to be that the information is NOT currently saved.
I am thinking adding two bools to the Compiler class.
one is set to true if compiler is detected.
The second set to true if compiler is user-defined.

Tim S.
 
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Compiler Plugin: Plan to add compiler for MSys2
« Reply #14 on: October 24, 2016, 03:12:22 am »
Why do you want to introduce this complexity instead of just adding a field if the compiler is enabled? You'll have to add such field anyway. And then add the simple dialog where the user can select the needed compilers. And lastly add some logic to show this dialog if C::B detects if the user has old config.

Is the default GCC compiler user-defined using your logic? Will it be removed from everybody's list of compilers if this change is added to C::B?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]