Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 13 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ endif()
# Set the project name
set(CMAKE_PROJECT_NAME Cerberus-2.0)

# NER Include toolchain file

# Enable compile command to ease indexing with e.g. clangd
set(CMAKE_EXPORT_COMPILE_COMMANDS TRUE)

Expand Down Expand Up @@ -58,6 +56,18 @@ enable_language(C ASM)
# Create an executable object type
add_executable(${CMAKE_PROJECT_NAME})

# NER Compiler options
target_compile_options(${CMAKE_PROJECT_NAME} PRIVATE
-Wno-unused-parameter
-Werror=double-promotion # do not allow passing to a function that will cast to double
-fsingle-precision-constant # when using constants, make them floats
-Werror=undef # do not allow undefined macros
-fno-common # do not allow duplicate global variables
-Wformat # check the types going to printf
-Wshadow # prevent redefinition of unsassigned global vars
-fanalyzer # GCC static analysis
)

# Add STM32CubeMX generated sources
add_subdirectory(cmake/stm32cubemx)

Expand Down Expand Up @@ -180,14 +190,9 @@ target_compile_definitions(${CMAKE_PROJECT_NAME} PRIVATE
# Add user defined symbols
)

# Compiler options
target_compile_options(${CMAKE_PROJECT_NAME} PRIVATE
-Wno-unused-parameter # u_TODO - this doesn't seem to be working
)

# Add linked libraries
target_link_libraries(${CMAKE_PROJECT_NAME}
stm32cubemx

# Add user defined libraries
)
)
Loading
Loading