Author Topic: build of static lib and 3rd party sources binaries path  (Read 12199 times)

mariocup

  • Guest
Re: build of static lib and 3rd party sources binaries path
« Reply #15 on: September 04, 2007, 03:49:48 pm »
Hi,

I had been able to reproduce the behavior with the static lib wizard of Code::Blocks. The problem is, if the project file .cbp and the sources of the project are on different drives. In the attached file the project static_lib/static_lib.cbp is on e.g C:\temp\static_lib and the source file main.c on a network drive r:\tausch\mario\testx. The output directory in the project file is configured as build\Debug but instead of generating objects in object output dir C:\temp\static_lib\build\Debug they are generated in the source directory r:\tausch\mario\testx.

[attachment deleted by admin]

Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: build of static lib and 3rd party sources binaries path
« Reply #16 on: September 04, 2007, 04:37:06 pm »
I had been able to reproduce the behavior with the static lib wizard of Code::Blocks. The problem is, if the project file .cbp and the sources of the project are on different drives. In the attached file the project static_lib/static_lib.cbp is on e.g C:\temp\static_lib and the source file main.c on a network drive r:\tausch\mario\testx. The output directory in the project file is configured as build\Debug but instead of generating objects in object output dir C:\temp\static_lib\build\Debug they are generated in the source directory r:\tausch\mario\testx.

I wrote this earlier that this behaviour is hard-coded.

IMHO, the fallback code should create the relative path of object file to C:\temp\static_lib\build\Debug\r\tausch\mario\testx.

There is only one, but a nasty, problem. In C::B every plugin handles file path creation/manipulation on it's own. I'm not sure if I make such changes, other parts would function normally or not.

I'll try to fix this issue. :)
« Last Edit: September 04, 2007, 04:39:47 pm by Biplab »
Be a part of the solution, not a part of the problem.

Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: build of static lib and 3rd party sources binaries path
« Reply #17 on: September 04, 2007, 08:10:50 pm »
I've changed the object output creation of source files residing in different drive. Now the object files will be created inside the project's object output directory.

Example:
* Project object output dir: C:\Foo\obj\Debug
* Source: D:\Source\foo.cpp
* Obj file: C:\Foo\obj\Debug\D\Source\foo.o

I made some tests and it works well. It's in revision 4424.

@Mario and Ope,
Can you please test it with your projects to see if it's working well??  :)
Be a part of the solution, not a part of the problem.

mariocup

  • Guest
Re: build of static lib and 3rd party sources binaries path
« Reply #18 on: September 05, 2007, 04:48:31 pm »
Hi Biplab,

I will try it and give you feedback tomorrow. Thx. :D

mariocup

  • Guest
Re: build of static lib and 3rd party sources binaries path
« Reply #19 on: September 06, 2007, 01:11:45 pm »
Hi Biplab,

I have tested svn 4427 and TARGET_OUTPUT_DIR works fine for me. Thx again.

Related to the TARGET_OUTPUT_FILE there is also a strange behaviour we discussed in http://forums.codeblocks.org/index.php/topic,6556.0.html. It seems that codeblocks does not get the TARGET_OUTPUT_FILE correctly if different projects are opened, although the build works for the active target. Even a rebuild of a project will not fix the problem. Is there a workaround for this problem?

Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: build of static lib and 3rd party sources binaries path
« Reply #20 on: September 06, 2007, 02:01:29 pm »
Related to the TARGET_OUTPUT_FILE there is also a strange behaviour we discussed in http://forums.codeblocks.org/index.php/topic,6556.0.html. It seems that codeblocks does not get the TARGET_OUTPUT_FILE correctly if different projects are opened, although the build works for the active target. Even a rebuild of a project will not fix the problem. Is there a workaround for this problem?

I'm aware of this issue and you've submitted a bug-report earlier. I tried to fix that sometimes back. But I couldn't find a proper solution to this problem. I'll try to fix that. :)
Be a part of the solution, not a part of the problem.

ope

  • Guest
Re: build of static lib and 3rd party sources binaries path
« Reply #21 on: September 11, 2007, 08:25:32 am »
Hi,

the build works now!

Thanks,
Olaf