summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt29
1 files changed, 24 insertions, 5 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b379a8f..2d40b05 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -22,13 +22,18 @@ if ((PICO_PLATFORM STREQUAL "host") AND (NOT PICO_NO_GC_SECTIONS))
add_link_options("LINKER:--gc-sections")
endif()
+# Use modern C...
+set(CMAKE_C_STANDARD 23)
+# ... but with some misfeatures disabled.
+add_compile_options(-Werror=vla)
+
+# Have the compiler help detect mistakes.
add_compile_options(-Wall -Wextra -Wswitch-enum -Werror)
string(TOUPPER "${CMAKE_BUILD_TYPE}" _upper_cmake_build_type)
string(REPLACE " " ";" _build_type_flags "${CMAKE_C_FLAGS_${_upper_cmake_build_type}}")
if ("-DNDEBUG" IN_LIST _build_type_flags)
add_compile_options(-Wno-unused-variable -Wno-unused-parameter -Wno-unused-but-set-variable)
- target_compile_definitions(pico_printf INTERFACE PICO_PRINTF_ALWAYS_INCLUDED=1)
endif()
function(_suppress_tinyusb_warnings)
@@ -39,6 +44,11 @@ function(_suppress_tinyusb_warnings)
COMPILE_OPTIONS "-Wno-switch-enum")
endfunction()
+if (PICO_PLATFORM STREQUAL "host")
+ add_compile_options(--coverage)
+ add_link_options(--coverage)
+endif()
+
function(target_embed_sources arg_compile_target arg_link_target arg_hdrname)
set(embed_objs)
foreach(embed_src IN LISTS ARGN)
@@ -80,7 +90,16 @@ function(add_stack_analysis arg_outfile arg_objlib_target)
OUTPUT "${arg_outfile}"
COMMAND "${CMAKE_SOURCE_DIR}/build-aux/stack.c.gen" "${PICO_PLATFORM}" "${CMAKE_SOURCE_DIR}" "$<TARGET_OBJECTS:${arg_objlib_target}>" >"${arg_outfile}"
COMMAND_EXPAND_LISTS
- DEPENDS "$<TARGET_OBJECTS:${arg_objlib_target}>" "${CMAKE_SOURCE_DIR}/build-aux/stack.c.gen"
+ DEPENDS "$<TARGET_OBJECTS:${arg_objlib_target}>"
+ "${CMAKE_SOURCE_DIR}/build-aux/stack.c.gen"
+ "${CMAKE_SOURCE_DIR}/build-aux/measurestack/__init__.py"
+ "${CMAKE_SOURCE_DIR}/build-aux/measurestack/analyze.py"
+ "${CMAKE_SOURCE_DIR}/build-aux/measurestack/app_main.py"
+ "${CMAKE_SOURCE_DIR}/build-aux/measurestack/app_output.py"
+ "${CMAKE_SOURCE_DIR}/build-aux/measurestack/app_plugins.py"
+ "${CMAKE_SOURCE_DIR}/build-aux/measurestack/test_analyze.py"
+ "${CMAKE_SOURCE_DIR}/build-aux/measurestack/util.py"
+ "${CMAKE_SOURCE_DIR}/build-aux/measurestack/vcg.py"
COMMENT "Calculating ${arg_objlib_target} required stack sizes"
)
endfunction()
@@ -101,7 +120,7 @@ function(add_lib_test arg_libname arg_testname)
target_include_directories("${arg_testname}" PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/tests)
add_test(
NAME "${arg_libname}/${arg_testname}"
- COMMAND valgrind --error-exitcode=2 "./${arg_testname}"
+ COMMAND "${CMAKE_SOURCE_DIR}/build-aux/valgrind" "./${arg_testname}"
)
endif()
endfunction()
@@ -136,7 +155,6 @@ function(apply_matrix _m_arg_action _m_arg_matrix)
endfunction()
add_subdirectory(libmisc)
-add_subdirectory(libobj)
add_subdirectory(libcr)
add_subdirectory(libcr_ipc)
add_subdirectory(libhw_generic)
@@ -146,4 +164,5 @@ add_subdirectory(libusb)
add_subdirectory(lib9p)
add_subdirectory(lib9p_util)
-add_subdirectory(cmd/sbc_harness)
+add_subdirectory(flashimg/cpu_main)
+add_subdirectory(flashimg/cpu_hdmi)