Exclude file from build

Sysprogs forums Forums VisualGDB Exclude file from build

Tagged: , ,

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #29310
    DUrbano
    Participant

    Hi,

    I’m using VisualGDB v5.5 with mbedOS 6.3 on Visual Studio Community 2017; in the last versions, it was really simple exclude a file from compilation, by clicking with right mouse button on file and selected the issue “EXCLUDE FROM BUILD”. With this version, I don’t find no more this option and I’d like to know how realize this exclusion. Please, could you help me to find a solution?

    Regards

    #29361
    support
    Keymaster

    Hi,

    Please try selecting the file in Solution Explorer and pressing the Delete button (or selecting “Remove” from the context menu). Visual Studio will ask whether you want to remove the file from project, or physically delete it. Selecting “Remove” will automatically add the file to the .mbedignore file. Selecting “Delete” will physically delete it from the disk.

    #29366
    DUrbano
    Participant

    I tried as you told me but the .mbedignore file is created on the same level of mbed6.3 local repository (but NOT inside this folder), so when I compile the solution, this file is not seen and the problem remains. I use, on my PC, the “D:\” directory for my local mbed6.3 repository and for my projects:

    D:\
    |
    |---mbed6.3 (local repo)
    |---visualGDB projects folder
    |---.mbedignore file (file created with the above procedure)

    Regards

    • This reply was modified 3 years, 6 months ago by support. Reason: formatting
    #29370
    support
    Keymaster

    Hi,

    Normally, VisualGDB will try to use the .mbedignore file inside the project directory. If this is not the case, your project layout might be different from what VisualGDB normally expects.

    Please try reproducing the problem on a clean project created from scratch (you don’t need to re-clone the shared mbed repository), and share the exact steps we could follow on our side to reproduce it, including full paths of all projects and files you used on your side.

    #29381
    DUrbano
    Participant

    In the attached file there is a simply blinking led project, developed for NUCLEO F411-RE platform; I’d like to change the clock configuration; for this reason I used:

    1. HSE_VALUE=16000000 to redefine clock xtal value;
    2. USE_PLL_HSE_XTAL|USE_PLL_HSI for use the external crystal.

    and I have added my system_clock.c file to set the new clock value. I’d like to exclude from build the default system_clock.c file found in:

    targets\TARGET_STM\TARGET_STM32F4\TARGET_STM32F411xE\TARGET_NUCLEO_F411RE\system_clock.c

    in mbed 6.3 repository. Please, could you help me?

     

    Attachments:
    You must be logged in to view attached files.
    #29387
    support
    Keymaster

    Thanks for your clarification. Indeed, due to a bug in VisualGDB, excluding a file from mbed-os itself would create a .mbedignore file in the root folder, rather than in the folder containing the excluded file.

    We have fixed this behavior in the following build: VisualGDB-5.5.102.3871.msi

    That said, we do not advise modifying the contents of the mbed repository itself, as any changes you make will be discarded next time you check out the repository. A better way to customize the mbed port would be to create a custom target as shown in this tutorial.

    #29398
    DUrbano
    Participant

    Ok, all it’s clear…thank you so much for your precious support.

    Regards

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.