androidandroid-sourceandroid-kernellineageos

How to disable -Werror in building AOSP


How would I disable the -Werror flag or add -Wno-error flag to AOSP/LineageOS? I'm trying to build a kernel for my specific device and it built fine on its own, but once added to the source tree, it doesn't build and throws a lot of errors.

I tried building with brunch a06 but it threw random errors that didn't appear when it was built by itself.


Solution

  • One way is to check the Environment Variables: Sometimes, the build system uses environment variables for flag. You can temporarily disable warnings being treated as errors by running:

    export DISABLE_WERROR=true
    

    This may not work in all cases but can help if AOSP/LineageOS uses such environment variables for configuration.