cancel
Showing results for 
Search instead for 
Did you mean: 

Exclude from compiling one or more source file "for ever"

zioMorgan
Associate II

Hi all, I've a question.

I created a new project and there I linked externally some user made modules with the command Import (Right click kn project name, then choose import, add the wanted modules and linked them into the project).

I try to compile and everything was ok.

Now my question: I need to exclude some files from compiling process, both in debug and release mode. I was able to exclude them by the command "Resource Configuration" but when I delete and import again the modules, and link them again to the project, I see that the compiling filters has been restored to default values meanwhile I need to keep the filters on everytime.

 

There is a way to achieve this?

1 REPLY 1
Ghofrane GSOURI
ST Employee

Hello @zioMorgan 

First let me thank you for posting.

Try to follow  these steps  , you can manage file exclusions more effectively in STM32CubeIDE:

  • Create a Custom Build Configuration:
    • Set up a specific build configuration that excludes certain files. This way, you can switch between configurations without having to re-exclude files each time.
    • Check this post 
  • Use Project Properties:
    • Go to Project Properties > C/C++ General > Paths and Symbols > Source Location.
    • Here, you can manage file filters more effectively and ensure that your excluded files are noted for future reference

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.