Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Build targets and configurations.(Understanding build targets and configurations.)
icon5.gif  Build targets and configurations. [message #1752920] Mon, 30 January 2017 17:13 Go to next message
Hakan Bayindir is currently offline Hakan BayindirFriend
Messages: 11
Registered: January 2017
Location: Ankara, Turkey
Junior Member

Hello everyone,

I have been using Eclipse for a long time for relatively simple C/C++ projects, however I'm building a complex C++ application and my build configurations are started to diverge for different platforms that I target.

First, about the project:
- Makefiles are managed by Eclipse. I don't hand code them.
- My code targets two platforms. macOS and GNU/Linux.
- It can be built with both clang/llvm and g++

However, I need to pass different linker options per OS.

What I want to do is relatively easy:
- I want to be able to create different targets for different operating systems, for some building profiles (debug, test, release, etc.)

What is the best way to move forward? I can see that Eclipse has some features directly targeted for use case, but I was unable to find resources to understand it completely.

Thanks in advance.
Re: Build targets and configurations. [message #1753032 is a reply to message #1752920] Wed, 01 February 2017 09:47 Go to previous messageGo to next message
Alex Freidin is currently offline Alex FreidinFriend
Messages: 29
Registered: July 2009
Junior Member
You can create several build configurations based on the standard Debug/Release, e.g. Linux Release, MacOS Debug, etc.
Re: Build targets and configurations. [message #1753041 is a reply to message #1753032] Wed, 01 February 2017 10:38 Go to previous messageGo to next message
Hakan Bayindir is currently offline Hakan BayindirFriend
Messages: 11
Registered: January 2017
Location: Ankara, Turkey
Junior Member

Thanks. Sure I can, but what are targets for in that case and how to utilize them?
Re: Build targets and configurations. [message #1753064 is a reply to message #1753041] Wed, 01 February 2017 14:07 Go to previous messageGo to next message
Alex Freidin is currently offline Alex FreidinFriend
Messages: 29
Registered: July 2009
Junior Member
What do you mean by target? Make target? Every build configuration having an external builder generates a makefile with "all" target.
Create a build configuration per OS and per build profile (debug/release/etc) using "Manage Configurations...". You'll end up with a folder per configuration with its makefile and a set of objects and binaries.
Re: Build targets and configurations. [message #1753109 is a reply to message #1753064] Wed, 01 February 2017 21:22 Go to previous message
Hakan Bayindir is currently offline Hakan BayindirFriend
Messages: 11
Registered: January 2017
Location: Ankara, Turkey
Junior Member

Thanks for your answer. I'll define different build configurations for different platforms and build types.

Yes, I tried to ask about make targets in my previous post, because I'm using a test framework inside my code, and want to build the test binary for a configuration. I want to be able to call make test, rather than make all, in my Linux/Release configuration.

In my code, test binary is a different binary which is created from a different main(), becuase the library I use is working that way.

Again thanks a lot for your answers and in advance,

Hakan
Previous Topic:Qt Hello World project won't compile or index on Neon
Next Topic:Gdb remote debugging error: Can't fine source file at ...
Goto Forum:
  


Current Time: Fri Jan 28 03:31:39 GMT 2022

Powered by FUDForum. Page generated in 0.02118 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top