Reply
Posts: 30
Registered: ‎05-23-2017
Accepted Solution

How to save common source code in Simplicity Studio workspace ?

I'm having trouble figuring out how to set up directories for source code in my Simplicity Studio workspace.  I want to have multiple projects, in their own directories, such as

 

C:\SiliconLabs\v4_workspace\proj1\
C:\SiliconLabs\v4_workspace\proj2\
C:\SiliconLabs\v4_workspace\proj3\

 

with their own private source files (.c & .h files) in

 

C:\SiliconLabs\v4_workspace\proj1\src
C:\SiliconLabs\v4_workspace\proj2\src
C:\SiliconLabs\v4_workspace\proj3\src

 

and common source files (.c & .h files) in a common directory at

 

C:\SiliconLabs\v4_workspace\common_src\

 

I have proj1, proj2, proj3 all set up and working, and now want to add .c and .h files common to all.

 

How would I do this ?

Posts: 2,079
Registered: ‎10-14-2014

Re: How to save common source code in Simplicity Studio workspace ?

I think you could try to drag that folder (common source) to you project. then you could see the dialog showed up. you could choose "Link to files and folders".

Then you could add the folder to the include directory through properties->c/c++ build->settings->GND ARM C Compiler->include

My views are my own and do not necessarily represent the views of Silicon Labs

WeiguoLu
Posts: 448
Registered: ‎01-18-2004

Re: How to save common source code in Simplicity Studio workspace ?


dxpwny wrote:

I'm having trouble figuring out how to set up directories for source code in my Simplicity Studio workspace.  I want to have multiple projects, in their own directories, such as

 

C:\SiliconLabs\v4_workspace\proj1\
C:\SiliconLabs\v4_workspace\proj2\
C:\SiliconLabs\v4_workspace\proj3\

 

with their own private source files (.c & .h files) in

 

C:\SiliconLabs\v4_workspace\proj1\src
C:\SiliconLabs\v4_workspace\proj2\src
C:\SiliconLabs\v4_workspace\proj3\src

 

and common source files (.c & .h files) in a common directory at

 

C:\SiliconLabs\v4_workspace\common_src\

 

I have proj1, proj2, proj3 all set up and working, and now want to add .c and .h files common to all.

 

How would I do this ?


I would use a proper source-code control system which knows how to pull common code into a project. For example, the Subversion externals property does just this. When you check out the project, it pulls in the "common" code if you attach the externals property to your project source folder.

Posts: 30
Registered: ‎05-23-2017

Re: How to save common source code in Simplicity Studio workspace ?

I think there is a miss-understanding of what I am looking for.   I have multiple ongoing projects that would use this common source code.    There is no source control - it's all under my control, and no one else is involved, nor will be involved.   There is no need to check out any files, or check in any files, they already exist - and are where I want them.  

 

I want the software to stay in a directory structure as I mentioned.   There is no need for source control.   I do not need to pull any code from anywhere, I do not need to push code to anywhere.   It exists in those directories and stays there forever.  

 

I could compile from command line before getting Simplicity Studio.  Simplicity studio/Keil tools will not accept this however.  

 

Posts: 30
Registered: ‎05-23-2017

Re: How to save common source code in Simplicity Studio workspace ?

I will try this - asap, and let you know how I make out.  Thank you for your help !

Posts: 30
Registered: ‎05-23-2017

Re: How to save common source code in Simplicity Studio workspace ?

Delu's suggestion accomplishes exactly what I was hoping for.   Thanks to all who responded !!!