This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Tool/software: TI C/C++ Compiler
Hello,
I want my CCS project to be portable, so all my include path begin with ${install_dir}\.....
My Cl6x command works well when I used the --include_path option.
But I would libe to put all my include_path in a cmd file and used the --cmd file option , but then it does'nt work, the compilation failed.
It looks like the ${install_dir} is not interpreted when it is situated in a cmd file.
My use case is that I want to share a list of include path between x project and don't want to fill x times the project properties, include only one file will help me ! and I want my include path to be relative that is the problem.
Maybe someone could help me ? thank you very much in advance for your help.
regards.
Pat
lavenu patrick1 said:But I would libe to put all my include_path in a cmd file and used the --cmd file option , but then it does'nt work, the compilation failed.
Unfortunately, the files read by the compiler/linker (like compiler options file, linker command file) cannot interpret CCS variables. The include_path option in CCS can directly refer to the variable, but the variable cannot be used within a file passed to the compiler shell.
It appears that you may be able to use Eclipse environment variables to achieve this (under CCS menu Window->Preferences->CCS->Environment). Basically create a environment variable with a list of semi-colon separated paths and use the environment variable in the project's compiler include path option. Then only the environment variable needs to be shared with the different projects (and if set at the workspace level, all projects in the workspace should know about it). I haven't tested this extensively and am still looking at whether there are other ways to do this using CCS variables. I will let you know if I can think of other suggestions.
My suggestion was to do something like the following.
- Create an Eclipse environment variable with the list of include paths (the paths here can reference CCS variables). This does mean that all users need to have the same CCS variables also defined in their setup but that can be easily shared using a variables file. All of your compiler include paths can be added here under one environment variable.
- Add the environment variable to the project's compiler include path option, rather than the list of multiple paths.
- During build, each of the paths listed for the environment variable should be passed to the –include_path option.
Also, I believe environment variables can be shared among multiple users using the File->Export->Preferences and File->Import->Preferences menus.
I admit this is not as direct as adding a list of options to a file and passing it to the compiler, however since the options file does not support the use of variables, this is one alternative I can think of.
lavenu patrick1 said:My question is, in my use case, How can I add automatically the eclipse environment variable in my workspace to make the compilation succeed ?
I see a couple of options:
1) Set the environment variable at the project level instead of workspace level (under Project properties->Build->Environment tab). Then the variable will get carried over with the project when you import it into a new workspace using the command line projectImport. The downside is that you would have to set the environment variable within each project, but at least it would only have to be done once.
2) If variable is set at workspace level, it can be exported and imported into a new workspace prior to running command line projectImport and projectBuild. However, I have not found a way to do the export/import by command line. It can be done via CCS GUI using menu File->Export->Preferences, then provide a name for the preferences file, and then import it into the new workspace using menu File->Import->Preferences. Unfortunately this can get tedious if your process ends up creating new workspaces for each new import/build.
lavenu patrick1 said:But when CCS import my macro file in the build variable of the project , it convert INC_PATH_LIST as a Directory and not as a list path and so my compilation failed.My question is how I have to write my INC_PATH_LIST variable in the macros.ini file to make CCS convert it as a List path in the build variable of the project and not as a Directory ?
Unfortunately, list-type variables are currently not supported in macros.ini file. There is an enhancement request we are tracking to add this support in a future release of CCS, but the support is currently not available.