Cross Compilation [message #182564] |
Fri, 19 January 2007 10:42  |
Eclipse User |
|
|
|
Originally posted by: laurent.malvert.gmail.com
Hello everyone,
I'd like to know if anyone has any idea or clue how to do this...
I have a project that is aimed at developing two implementations of a
system for different platforms.
I divied my projet like this:
MyProject
-> src
RootNameSpace/
win/
unix/
common/
-> include
RootNameSpace/
win/
unix/
common/
But of course, when I compile it tries to compile with all the source
files and I get a redefinition of whatever is in win/ because it's also
defined in unix/.
I used compilation variables to be able to tell the compiler which include
to use [1], but it doesn't prevent it of trying to compile both .cpp
implementations.
[1] you now, something like with
<RootNameSpace/common/SubNameSpace/Class.h> containign something like the
following:
# ifdef WIN32
# include <RootNameSpace/win/SubNameSpace/Class.h>
# else
# include <RootNameSpace/unix/SubNameSpace/Class.h>
# endif
I am using a Managed Make project.
I figured I could try to eclude directories from the compilation but I
could not manage to do that.
Or I could try to create 3 separate projects and have
MyProject.win and Myproject.unix to both use the MyProject.common as a
reference.
Is that the way to go ?
how would you do something like that ?
Thank you very much in advance.
|
|
|
|
|
|
Re: Cross Compilation [message #912864 is a reply to message #182564] |
Fri, 14 September 2012 05:54  |
Eclipse User |
|
|
|
I am really sorry for re-invoking this discussion.
Has anybody fixed this issue? Or is there any workaround for this one?
My use case is as explained below.
test.c
#ifdef BIG
#include "big_endian.h"
#else
#include "little_endian.h"
#endif
When I build this file for the first time, it creates a dependency file test.d which contains entry for "big_endian.h" if BIG macro is not defined.
Now if I go to Managed Build Settings and add new macro "BIG" and try to build the project, everything gets built as expected, but dependency file test.d does not get re-generated or update. Due to this, my test.c will still depend of "little_endian.h" as far as a dependency scanning is concerned.
Hence when "big_endian.h" gets updated, my test.c does not get rebuilt.
Can anyone please help me for this issue?
|
|
|
Powered by
FUDForum. Page generated in 0.06521 seconds