Skip to content

Conversation

Copy link

Copilot AI commented Nov 6, 2025

The ninja build was failing because -fno-rtti and -fno-exceptions flags were applied to C files, generating warnings treated as errors.

Changes

Modified src/base.cmake to apply C++-specific compiler flags only to C++ sources using CMake generator expressions:

# Before
target_compile_options(microlite INTERFACE
    -fno-rtti
    -fno-exceptions
)

# After
target_compile_options(microlite INTERFACE
    $<$<COMPILE_LANGUAGE:CXX>:-fno-rtti>
    $<$<COMPILE_LANGUAGE:CXX>:-fno-exceptions>
)

This prevents the compiler from issuing command-line option '-fno-rtti' is valid for C++/D/ObjC++ but not for C warnings when building C source files.

Original prompt

Read the crash log for my recent workflow: https://github.com/MATTYGILO/tflite-micropython-esp/actions/runs/19149308514/job/54735114043. Then please fix the error and repush so the workflow runs again:

cc1: warning: command-line option '-fno-rtti' is valid for C++/D/ObjC++ but not for C
ninja: build stopped: subcommand failed.
ninja failed with exit code 1, output of the command is in the /home/runner/work/tflite-micropython-esp/tflite-micropython-esp/boards/MICROLITE_S3_SPIRAM_OCTAL/build/log/idf_py_stderr_output_5852 and /home/runner/work/tflite-micropython-esp/tflite-micropython-esp/boards/MICROLITE_S3_SPIRAM_OCTAL/build/log/idf_py_stdout_output_5852
Build complete for board MICROLITE_S3_SPIRAM_OCTAL
Build complete


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: MATTYGILO <34808802+MATTYGILO@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix ninja build error for MICROLITE_S3_SPIRAM_OCTAL Fix -fno-rtti flag applied to C files causing build failure Nov 6, 2025
Copilot AI requested a review from MATTYGILO November 6, 2025 20:58
Copilot finished work on behalf of MATTYGILO November 6, 2025 20:58
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