Skip to content

Include sketch directory to include search path  #354

Closed
@luni64

Description

@luni64

When doing libraries with project scope settings I usually do something like

config.h:

#pragma once

#if __has_include("userConfig.h")
    #include "userConfig.h"
#else
    #include "defaultConfig.h"
#endif

If the user want's to override the default settings he can copy defaultConfig.h to the sketch folder and rename it to userConfig.h. Settings will then be read from userConfig.h which works perfectly with platformIO and makefile builds.

However, looks like the Arduino builder doesn't include the sketch folder in the search path for include files, so this pattern doesn't work with the Arduino IDE.

Proposal: Include the sketch folder in the search path

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions