summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt11
-rw-r--r--src/drivers/CMakeLists.txt1
-rw-r--r--src/main/CMakeLists.txt1
3 files changed, 12 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 93dc6e89..eaf575af 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -4,6 +4,7 @@ cmake_minimum_required(VERSION 3.8)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
+# ESP-ADF clobbers EXTRA_COMPONENT_DIRS, so include it first.
include($ENV{ADF_PATH}/CMakeLists.txt)
# Build only the subset of components that we actually depend on.
@@ -14,7 +15,15 @@ list(APPEND EXTRA_COMPONENT_DIRS "lib/result")
list(APPEND EXTRA_COMPONENT_DIRS "lib/lvgl")
# Project components
-list(APPEND EXTRA_COMPONENT_DIRS "src/")
+list(APPEND EXTRA_COMPONENT_DIRS "src")
+
+# Additional warnings used when compiling our components.
+# Unable to be used due to issues in ESP-IDF includes are: -Wpedantic
+# -Wuseless-cast -Wconversion -Wold-style-cast -Wsign-conversion -Wcast-align
+set(EXTRA_WARNINGS "-Wshadow" "-Wnon-virtual-dtor" "-Wunused"
+ "-Woverloaded-virtual" "-Wmisleading-indentation" "-Wduplicated-cond"
+ "-Wduplicated-branches" "-Wlogical-op" "-Wnull-dereference"
+ "-Wdouble-promotion" "-Wformat=2" "-Wimplicit-fallthrough")
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
project(gay-ipod-fw)
diff --git a/src/drivers/CMakeLists.txt b/src/drivers/CMakeLists.txt
index b9682050..f57fbc2e 100644
--- a/src/drivers/CMakeLists.txt
+++ b/src/drivers/CMakeLists.txt
@@ -3,3 +3,4 @@ idf_component_register(
"playback.cpp" "display.cpp" "display-init.cpp"
INCLUDE_DIRS "include"
REQUIRES "esp_adc_cal" "fatfs" "audio_pipeline" "audio_stream" "result" "lvgl")
+target_compile_options(${COMPONENT_LIB} PRIVATE ${EXTRA_WARNINGS})
diff --git a/src/main/CMakeLists.txt b/src/main/CMakeLists.txt
index b744a447..210abed1 100644
--- a/src/main/CMakeLists.txt
+++ b/src/main/CMakeLists.txt
@@ -1,3 +1,4 @@
idf_component_register(
SRCS "main.cpp"
REQUIRES "drivers")
+target_compile_options(${COMPONENT_LIB} PRIVATE ${EXTRA_WARNINGS})