Skip to content

Commit

Permalink
#5: Use -O3 for non-Debug builds
Browse files Browse the repository at this point in the history
  • Loading branch information
tlercher committed Jul 22, 2022
1 parent 15b4332 commit 4e17f36
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,13 @@ project(ice9-bluetooth C)

set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/Modules" ${CMAKE_MODULE_PATH})

set(CMAKE_C_FLAGS "-Wall -g -O0 -fsanitize=address")
set(CMAKE_EXE_LINKER_FLAGS "-fsanitize=address")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-common -Wall -Wextra -Wno-unused-parameter -std=c99 -Werror=implicit-function-declaration")

set(CMAKE_C_FLAGS_DEBUG "-ggdb3 -g3 -O0 -fsanitize=address")
set(CMAKE_C_FLAGS_MINSIZEREL "-Os -fsanitize=address")
set(CMAKE_C_FLAGS_RELWITHDEBINFO "-O3 -ggdb3 -g3")
set(CMAKE_C_FLAGS_RELEASE "-O3")
set(CMAKE_EXE_LINKER_FLAGS_DEBUG "-fsanitize=address")

# Installation directory
set(EXTCAP_PATH "$ENV{HOME}/.config/wireshark/extcap")
Expand All @@ -26,6 +31,12 @@ add_custom_command(
DEPENDS help.txt
)

# Build RelWithDebInfo by default so builds are fast out of the box
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING
"Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel." FORCE)
endif(NOT CMAKE_BUILD_TYPE)

include_directories(${PROJECT_SOURCE_DIR})
include_directories(${HACKRF_INCLUDE_DIR})
include_directories(${BLADERF_INCLUDE_DIR})
Expand Down

0 comments on commit 4e17f36

Please sign in to comment.