Cross Compilation [message #182564] |
Fri, 19 January 2007 15:42 ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
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 #182587 is a reply to message #182564] |
Sat, 20 January 2007 12:04 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: asdf.dd.dd
Havn't tried excactly that...
non-optimal solution 1:
ifdef the source files also, that way it will not be redefined
idea 2:
what about making 3 projects in eclipse.
one for win, one for linux, one for the common libs
You would then set a dependency to the common lib in the win and linux
builds.
"Laurent" <laurent.malvert@gmail.com> skrev i en meddelelse
news:86c586c14153eb483d6b536901d8c78b$1@www.eclipse.org...
> 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 #182653 is a reply to message #182587] |
Mon, 22 January 2007 14:15 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: laurent.malvert.gmail.com
Troels Thomsen wrote:
> Havn't tried excactly that...
> non-optimal solution 1:
> ifdef the source files also, that way it will not be redefined
I could try that.
But indeed, that's not optimal at all.
> idea 2:
> what about making 3 projects in eclipse.
> one for win, one for linux, one for the common libs
> You would then set a dependency to the common lib in the win and linux
> builds.
That's what I was suggesting in my post, but I couldn't manage to make
this work correctly.
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03791 seconds