Code::Blocks Forums

User forums => General (but related to Code::Blocks) => Topic started by: mandrav on September 22, 2007, 02:14:16 pm

Title: Support for adding custom files to the build system
Post by: mandrav 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 (http://wiki.codeblocks.org/index.php?title=Adding_support_for_non_C/C%2B%2B_files_to_the_build_system).

Hopefully this should make your life easier when working on projects that will benefit from this functionality :).
Title: Re: Support for adding custom files to the build system
Post by: XayC 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
Title: Re: Support for adding custom files to the build system
Post by: mandrav 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.
Title: Re: Support for adding custom files to the build system
Post by: XayC 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
Title: Re: Support for adding custom files to the build system
Post by: Biplab 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.
Title: Re: Support for adding custom files to the build system
Post by: TDragon 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.
Title: Re: Support for adding custom files to the build system
Post by: XayC on September 22, 2007, 04:55:31 pm
Thanks Biplab, it's compiling now :D

Regards, XayC
Title: Re: Support for adding custom files to the build system
Post by: TDragon 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.
Title: Re: Support for adding custom files to the build system
Post by: darthdespotism 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]
Title: Re: Support for adding custom files to the build system
Post by: Jan van den Borst 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]
Title: Re: Support for adding custom files to the build system
Post by: mandrav 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
Title: Re: Support for adding custom files to the build system
Post by: darthdespotism on September 23, 2007, 10:39:29 am
Should have already made this  :(

Thank you for reminding me