Author Topic: Support for adding custom files to the build system  (Read 5975 times)

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Support for adding custom files to the build system
« on: September 22, 2007, 02:14:16 pm »
Efforts have been made last week to add a way for the build system to support custom, non-C/C++ files. And the fruits of our labor can finally see the light of day :).

This feature has just been committed so you either have to update your working copy and compile (if using sources) or wait for the next nightly (if using binaries).

Still, everyone can read some basic info on this and how it works already by reading the relevant wiki article: Adding support for non C/C++ files to the build system.

Hopefully this should make your life easier when working on projects that will benefit from this functionality :).
Be patient!
This bug will be fixed soon...

Offline XayC

  • Multiple posting newcomer
  • *
  • Posts: 94
Re: Support for adding custom files to the build system
« Reply #1 on: September 22, 2007, 03:31:00 pm »
Seems that a change you made in src/include/compiler.h broke building. Revision 4485
Code
CompilerBuildMethod buildMethod; // cbmDirect
This line has been removed, but in the file: plugins/compilergcc/compilerBCC.cpp buildMethod it's still required.

Regards, XayC
« Last Edit: September 22, 2007, 03:35:46 pm by XayC »

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: Support for adding custom files to the build system
« Reply #2 on: September 22, 2007, 03:35:06 pm »
Seems that a change you made in /src/include/compiler.h broke building.
Code
CompilerBuildMethod buildMethod; // cbmDirect
This line has been removed, but in the file: plugins/compilergcc/compilerBCC.cpp buildMethod it's still required.

Regards, XayC



Code
mandrav@amd64:~/codeblocks/trunk$ find . -name "*.cpp" | xargs grep CompilerBuildMethod
mandrav@amd64:~/codeblocks/trunk$

I guess you should update your copy and make sure you haven't modified any files yourself.
Be patient!
This bug will be fixed soon...

Offline XayC

  • Multiple posting newcomer
  • *
  • Posts: 94
Re: Support for adding custom files to the build system
« Reply #3 on: September 22, 2007, 04:04:33 pm »
I guess of course you compiled Code::Blocks before submitting changes to the svn so it may look very strange that it's not compiling, but my updated working dir is not.

To make sure it's not a problem on my machine, I did this directly on the websvn (revision 4485):

The error when i try to compile:
Code
src\plugins\compilergcc\compilerBCC.cpp:47: error: 'struct CompilerSwitches' has no member named 'buildMethod'


Regards, Xayc

Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: Support for adding custom files to the build system
« Reply #4 on: September 22, 2007, 04:49:43 pm »
Please download revision 4486. I've fixed the errors. Mandrav missed them as they were not compiled on Linux and thus he didn't receive any errors.
Be a part of the solution, not a part of the problem.

Offline TDragon

  • Lives here!
  • ****
  • Posts: 943
    • TDM-GCC
Re: Support for adding custom files to the build system
« Reply #5 on: September 22, 2007, 04:52:51 pm »
This is really excellent! I have a project which, interestingly enough, uses Flex and Lemon to generate C sources; custom build commands almost work the way they should but not quite (for some reason the Flex command is always run regardless of whether the source file has changed). This should clear that up. Much appreciated.
https://jmeubank.github.io/tdm-gcc/ - TDM-GCC compiler suite for Windows (GCC 9.2.0 2020-03-08, 32/64-bit, no extra DLLs)

Offline XayC

  • Multiple posting newcomer
  • *
  • Posts: 94
Re: Support for adding custom files to the build system
« Reply #6 on: September 22, 2007, 04:55:31 pm »
Thanks Biplab, it's compiling now :D

Regards, XayC

Offline TDragon

  • Lives here!
  • ****
  • Posts: 943
    • TDM-GCC
Re: Support for adding custom files to the build system
« Reply #7 on: September 22, 2007, 06:01:00 pm »
Almost what I need but not quite... :P
Flex is stupid about backslashes, so I can't use $file in the command line macro; and $file_basename is out since my sources are in a subfolder relative to the project file and that would only generate files in the same folder as the project file.

This isn't C::B's fault, though -- and it works fine for the Lemon sources. Nice work.
https://jmeubank.github.io/tdm-gcc/ - TDM-GCC compiler suite for Windows (GCC 9.2.0 2020-03-08, 32/64-bit, no extra DLLs)

Offline darthdespotism

  • Almost regular
  • **
  • Posts: 163
    • Coder's Nemesis
Re: Support for adding custom files to the build system
« Reply #8 on: September 22, 2007, 06:36:41 pm »
Don't know if it's related to this new feature (nice thing as I want to use flex & bison very soon in a project) but codeblocks crashes on Gnu/Linux (Ubuntu 7.04) when trying to access the advanced options. Removing ~/.codeblocks did not solve anything

Revision is 4486

Installed packages:

../libcodeblocks0_1.0svn{rev}_i386.deb
../codeblocks_1.0svn{rev}_i386.deb
../libwxsmithlib0_1.0svn{rev}_i386.deb
../codeblocks-contrib_1.0svn{rev}_i386.deb

Crash-Log is attached

EDIT://
Seems to be a more general issue. Codeblocks also crashes on opening a project. May be some problem with the Compiler-Plugin as C::B always promts the compiler-selection on startup. I submitted it as a bug, hope this is the right action

[attachment deleted by admin]
« Last Edit: September 22, 2007, 10:53:10 pm by darthdespotism »

Offline Jan van den Borst

  • Multiple posting newcomer
  • *
  • Posts: 99
Re: Support for adding custom files to the build system
« Reply #9 on: September 22, 2007, 08:51:08 pm »
On my Vista C::B compiles fine with the new advance dialog . However the advance dialog needs some rework as the dropdown boxes are too small. (See screenshot)

Jan

[attachment deleted by admin]

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: Support for adding custom files to the build system
« Reply #10 on: September 23, 2007, 12:07:42 am »
... but codeblocks crashes on Gnu/Linux (Ubuntu 7.04) when trying to access the advanced options. Removing ~/.codeblocks did not solve anything
...
Seems to be a more general issue. Codeblocks also crashes on opening a project. May be some problem with the Compiler-Plugin as C::B always promts the compiler-selection on startup. I submitted it as a bug, hope this is the right action

Code
make clean && make
Be patient!
This bug will be fixed soon...

Offline darthdespotism

  • Almost regular
  • **
  • Posts: 163
    • Coder's Nemesis
Re: Support for adding custom files to the build system
« Reply #11 on: September 23, 2007, 10:39:29 am »
Should have already made this  :(

Thank you for reminding me