Author Topic: compile multiple files from different location into one folder  (Read 3210 times)

Offline shenc

  • Single posting newcomer
  • *
  • Posts: 6
compile multiple files from different location into one folder
« 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


Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: compile multiple files from different location into one folder
« Reply #1 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.
(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 shenc

  • Single posting newcomer
  • *
  • Posts: 6
Re: compile multiple files from different location into one folder
« Reply #2 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.


Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: compile multiple files from different location into one folder
« Reply #3 on: February 03, 2017, 08:30:26 pm »
Why would they need this? I'm curious.
(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!]