Is it possible to have multiple KDS projects referencing the same source code?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Is it possible to have multiple KDS projects referencing the same source code?

671 Views
etidemand
Contributor II

I would like to generate multiple binary outputs from the same source directory. These binaries will be different from each other via the use of #ifdef switching during compiletime. The way I have done this with other IDEs is to have multiple IDE projects which selectively reference and configure a common source tree. Is there a way to accomplish the same thing with KDS?

 

Thanks!

 

-Erik Tidemand

Labels (1)
0 Kudos
5 Replies

526 Views
etidemand
Contributor II

Thanks for the input! I'll try these things out!

-Erik

0 Kudos

526 Views
BlackNight
NXP Employee
NXP Employee

Hi Erik,

In Eclipse (KDS is Eclipse based) you can use link to files and folders (see https://mcuoneclipse.com/2014/08/15/link-to-files-and-folders-in-eclipse/ ). That way you can have multiple projects sharing the same sources.

From a linked folder, you can exclude files from a build too, see https://mcuoneclipse.com/2014/07/22/exclude-source-files-from-build-in-eclipse/

Additionally, you can use the concept of 'build configurations', e.g. see Help - Eclipse Platform

I hope this helps,

Erich

0 Kudos

526 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello Erik,

In KDS, you also can use #ifdef ...

And when you use it , is there some thing error ?

If yes, you can show us .

Hope it helps

Alice

0 Kudos

526 Views
etidemand
Contributor II

Hi Alice,

I have been able to successfully use #ifdef, so I know that feature is working well.

My question is at a higher level. I'd like to build different project binaries out of a common source tree. With other IDEs I have accomplished this through the use of multiple IDE projects that can be compiled separate from one another. All of these projects referenced the same source code. The source code itself was prepared with #ifdefs in order to correctly handle which project was building it.

An example would be building a bootloader image and a MainApp image out of a common source tree. Both the bootloader and MainApp would be able to use a UART driver or a FLASH driver that had been written in the common source tree. The MainApp could also use a display driver, and the bootloader could completely ignore the display driver in this system. This allows me to create customized project binaries for each configuration I require, building only the modules in my codebase each configuration requires. Does this example make sense?

As KDS uses a directory based project as opposed to what an IDE like Keil or IAR does, with an explicit file/set of files comprising the project, I am wondering what the best way to achieve the same goal would be.

Thanks for the response!

-Erik

0 Kudos

526 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello Erik,

-If you want many projects use same driver , you can build the drivers to one lib, then add it.

have you install the KSDK , if yes, the stye of it is like this ,you can chek . All of the demos no matter

on KDS IAR or KEIL , all use the one lib..

- If you only want many projects use the same .c file , you can use the "Link to file in the file system"

pastedImage_0.png

Hope it can helps

Alice

0 Kudos