Skip to content

Fix CMake compile definition leakage#687

Merged
stephenhensley merged 1 commit intoelectro-smith:masterfrom
Alloyed:patch-4
Feb 19, 2026
Merged

Fix CMake compile definition leakage#687
stephenhensley merged 1 commit intoelectro-smith:masterfrom
Alloyed:patch-4

Conversation

@Alloyed
Copy link
Copy Markdown
Contributor

@Alloyed Alloyed commented Jan 28, 2026

My CI build was failing, and near as I can tell it's because I declare my targets, then import libdaisy. so the add_compile_definitions doesn't end up applying to my targets. marking it as public like this makes it transitive, so anybody that links to libdaisy also has this compile definition.

from my CI:

[ 92%] Building CXX object calibrate/CMakeFiles/Calibrate.dir/calibrate.cpp.obj
In file included from /home/runner/work/KitsBlips/KitsBlips/sdk/libDaisy/src/daisy.h:78,
                 from /home/runner/work/KitsBlips/KitsBlips/sdk/libDaisy/src/daisy_patch_sm.h:3,
                 from /home/runner/work/KitsBlips/KitsBlips/daisy/calibrate/calibrate.cpp:1:
/home/runner/work/KitsBlips/KitsBlips/sdk/libDaisy/src/util/WavPlayer.h: In member function 'daisy::WavPlayer<workspace_bytes>::Result daisy::WavPlayer<workspace_bytes>::Open(const char*)':
/home/runner/work/KitsBlips/KitsBlips/sdk/libDaisy/src/util/WavPlayer.h:95:16: error: 'FileReader' is not a member of 'daisy'; did you mean 'IReader'?
   95 |         daisy::FileReader reader(&file_);
      |                ^~~~~~~~~~
      |                IReader
/home/runner/work/KitsBlips/KitsBlips/sdk/libDaisy/src/util/WavPlayer.h:97:26: error: 'reader' was not declared in this scope; did you mean 'IReader'?
   97 |         if(!parser.parse(reader))
      |                          ^~~~~~
      |                          IReader
gmake[2]: *** [calibrate/CMakeFiles/Calibrate.dir/build.make:79: calibrate/CMakeFiles/Calibrate.dir/calibrate.cpp.obj] Error 1

@stephenhensley
Copy link
Copy Markdown
Collaborator

Confirmed that I could recreate your issue, and that your fix gets things compiling.

Not directly related, but I did notice that when building the WavParser example (both inside the libDaisy repo, and as a new project outside of the repo) w/ CMAKE_BUILD_TYPE=Release that things didn't work as expected. Building w/ Debug instead worked fine.

Not sure if you ran into anything similar, but something that I'll keep an eye out for (I'm trying to use the CMake build more on newer projects).

Thanks for the contribution!

@stephenhensley stephenhensley merged commit a22d84f into electro-smith:master Feb 19, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants