Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: Calexus on December 09, 2011, 09:57:53 am

Title: Build file
Post by: Calexus on December 09, 2011, 09:57:53 am
In the manager window/tab whatever it's called if you right click a file in the file tree you can "Build file". As I'm remembering it this is supposed to build only that file, right? i never use it, but thats how I'm remembering it was made for. Anyways I does not work in osx snow leopard. Only thing that appears to be happening is  the following output in the Build Log:  make: *** empty string invalid as file name.  Stop.

I don't have access to a windows/linux machine at my office at the moment so I cant say if it woks under those systems.

C::B rev. 7456 built in late September so I guess this might be kind of old news.
Title: Re: Build file
Post by: zabzonk on December 09, 2011, 10:21:29 am
Does it work if the file has been changed? If the build system thinks it is up-to-date, it won't build it - a bit of a misfeature, IMHO.
Title: Re: Build file
Post by: Calexus on December 09, 2011, 10:28:49 am
No no difference if the file has been changed.
Title: Re: Build file
Post by: oBFusCATed on December 09, 2011, 10:31:16 am
Is this a Makefile project or normal project?
Because here it works for normal projects.
If you're using Makefile your make file should support compiling single files and I guess your doesn't.

Enable full logging to see what is the actual command executed.
Title: Re: Build file
Post by: Calexus on December 09, 2011, 11:28:56 am
Enabling full logging didn't do anything but I think you are right. This is a custom makfile generated by cmake and even though my cmake is pretty weak it doesn't appear to  contain a "single file" target. Thanks a bunch! I would probably never have thought about that myself, at least not this week :/

Guess I have to track down who ever wrote this cmake mess, or maybe it's a great opportunity to learn some cmake...

Thanks for the help.
Title: Re: Build file
Post by: Jenna on December 09, 2011, 11:44:36 am
I just tested it on linux with a cmake project.
Here is a possible solution/workaround:
Open the projects "Build options", swicth to the "make commands" (or something like this) tab, and remove the doublequotes around the $file-variable for the compile-single-file make-command.
Title: Re: Build file
Post by: Calexus on December 09, 2011, 12:48:54 pm
Thanks jens but it didn't work, it did build but but it built all changed files. Like a normal build. I simply have to learn a bit of cmake if I want to be able to build a single file in this project.