Author Topic: OS care in build process  (Read 3558 times)

Offline dje

  • Lives here!
  • ****
  • Posts: 683
OS care in build process
« on: August 31, 2007, 05:14:00 pm »
Hi all !

Fed up with synchronising 2 sandboxes on 2 PCs, I split my XP disk into 3 partitions :
- NTFS XP
- ext3 Ubuntu 7.04
- fat32

I put my sandbox and plugin project on the fat32 partition to share it between XP and Ubuntu and avoid plugin file transfers/sandbox synchro.
I built all on Ubuntu => OK

When I try to build on XP, I have this error message:
Code
Linking console executable: build_tools\autorevision\autorevision.exe
.objs\build_tools\autorevision\autorevision.o: In function `Z11WriteOutputRKSsRSsS1_':
autorevision.cpp:(.text+0x3a): undefined reference to `ZNSsC1Ev'
...

As I never built C::B at this place on XP, I was surprised not to compile anything.
Then I realised that both projects build everything at the same location... Am I wrong ?

If not, I'd like the build process to take into account the OS (through a variable ?) to be able to use the same sandbox from diferent OSs.
If nobody disagrees, I'll create a feature request.

Dje

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: OS care in build process
« Reply #1 on: September 01, 2007, 01:25:00 pm »
I deem it a bad idea to build the same code base from two operating systems. This means you have to do a full rebuild (including deleting the precompiled headers) every time, instead of incremental builds.
Failure to do so will most likely break your build, or may cause the application to crash in an irreproducible manner.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline dje

  • Lives here!
  • ****
  • Posts: 683
Re: OS care in build process
« Reply #2 on: September 01, 2007, 04:20:42 pm »
Hi Thomas,

the main idea was to have on one side, the sources shared buy all OSs and on the other side, output files (intermediate + useful binaries) in different directories that depends on OSs, for example
win/.obj or ubuntu/.objs

win, ubuntu and others could be set by a variable.

Dje

Offline JGM

  • Lives here!
  • ****
  • Posts: 518
  • Got to practice :)
Re: OS care in build process
« Reply #3 on: September 01, 2007, 05:08:26 pm »
win/.obj or ubuntu/.objs

What I do is, if i have to projects one for linux and one for windows, I modify the project properties for each and make that changes that you are pointing.

For example:

Code
Project for windows:
 - Object outputs dir: .obj/windows/release[ or debug]
 - Output filename: bin/windows/release[ or debug]/file.exe

Project for linux:
 - Object outputs dir: .obj/linux
 - Output filename: bin/linux/release[ or debug]/file

It work fine for me, just change that properties for each project and build target.