Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Development => Topic started by: shenc on February 02, 2017, 05:15:40 pm

Title: compile multiple files from different location into one folder
Post by: shenc on February 02, 2017, 05:15:40 pm
I have a project with multiple files from different locations.  I add them to this project.  I want to build those object files into one folder called ./obj and link them.
Say I have those files in folders

/home/me/A1/A2/a2.cpp
/home/me/A1/A3/a3.cpp

/home/me/B1/B2/b2.cpp
/home/me/B1/B3/b3.cpp

CB project in
/home/me/prj/ab.cbp

I want all objects build into folder  (define objects output dir:  obj/  in project properties)
/home/me/prj/obj

By default, CB build those source files and output them to

./obj/A1/A2/a2.o
./obj/A1/A3/a3.o
./obj/B1/B2/b2.o
./obj/B1/B2/b3.o

This is not I wanted.  Since ./obj do not have those folder tree .
Any suggestion?
Thanks

Title: Re: compile multiple files from different location into one folder
Post by: oBFusCATed on February 02, 2017, 09:54:42 pm
Why do you care? C::B does this to prevent multiple files from different folders that are named the same to generate the same object file and thus prevents hard to debug issues.
Title: Re: compile multiple files from different location into one folder
Post by: shenc on February 03, 2017, 08:23:00 pm
Because other team member needs this.  Anyway, I find the solution.  In advance setting use flat option.

Title: Re: compile multiple files from different location into one folder
Post by: oBFusCATed on February 03, 2017, 08:30:26 pm
Why would they need this? I'm curious.