diff --git a/.gitignore b/.gitignore index 662698db..018eb466 100644 --- a/.gitignore +++ b/.gitignore @@ -19,5 +19,4 @@ hdl/quartus/work/* fx3_firmware/make/toolchain.mk fx3_firmware/elf2img -linux/apps/bin/* - +host/build/* diff --git a/host/CMakeLists.txt b/host/CMakeLists.txt index bfb4e5da..dd643c1a 100644 --- a/host/CMakeLists.txt +++ b/host/CMakeLists.txt @@ -28,13 +28,46 @@ set(BLADERF_COMMON_INCLUDE_DIR ${CMAKE_CURRENT_LIST_DIR}/../common) # Compiler configuration ################################################################################ -if("${CMAKE_CC_COMPILER_ID}" STREQUAL "GNU" OR - "${CMAKE_CC_COMPILER_ID}" STREQUAL "Clang" ) - ADD_DEFINITIONS(-Wall) - ADD_DEFINITIONS(-Wextra) - ADD_DEFINITIONS(-Wno-unused-parameter) +############################### +# GCC +############################### +option(ENABLE_GDB_EXTENTIONS + "When performing a debug build with GCC, this will enable -ggdb instead of -g" + OFF) + +if("${CMAKE_BUILD_TYPE}" STREQUAL "Debug" AND + "${CMAKE_C_COMPILER_ID}" STREQUAL "GNU") + + # Personal preference - as much debug info as possible with GDB + if(${ENABLE_GDB_EXTENTIONS}) + string(REGEX REPLACE "^-g$" "-ggdb3" CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG}") + endif(${ENABLE_GDB_EXTENTIONS}) + endif() +############################### +# GCC and Clang +############################### +if("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU" OR + "${CMAKE_C_COMPILER_ID}" STREQUAL "Clang") + + # Prefer more warnings, enforce C89 so folks developing in Linux can keep + # an eye on stuff that will likely cause portability issues + add_definitions(-Wall) + add_definitions(-Wextra) +# TODO Re-enable these +# add_definitions(-pedantic) +# add_definitions(-std=c89) + add_definitions(-Wno-unused-parameter) + + if("${CMAKE_BUILD_TYPE}" STREQUAL "Debug") + add_definitions(-DDEBUG=1) + add_definitions(-O0) + endif("${CMAKE_BUILD_TYPE}" STREQUAL "Debug") + +endif("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU" OR + "${CMAKE_C_COMPILER_ID}" STREQUAL "Clang") + ################################################################################ # Process subdirectories diff --git a/host/libraries/TODO b/host/libraries/TODO deleted file mode 100644 index f38452c8..00000000 --- a/host/libraries/TODO +++ /dev/null @@ -1,5 +0,0 @@ -Grep around for "TODO" and "FIXME" markers in this directory for a full listing. - -- Finish base impl -- Doxygen descriptions -- Copyright text in files