Fix cmake
This commit is contained in:
parent
e5b7dfceff
commit
afbcb53152
|
@ -5,24 +5,14 @@ project("fixmydownloads" VERSION 0.0.1)
|
|||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin)
|
||||
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/CMake" ${CMAKE_MODULE_PATH})
|
||||
|
||||
# Code Coverage Configuration
|
||||
add_library(coverage_config INTERFACE)
|
||||
# Set C compiler options
|
||||
if (NOT CODE_COVERAGE)
|
||||
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -g")
|
||||
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -O3")
|
||||
endif(NOT CODE_COVERAGE)
|
||||
|
||||
option(CODE_COVERAGE "Enable coverage reporting" OFF)
|
||||
if(CODE_COVERAGE)
|
||||
# Add required flags (GCC & LLVM/Clang)
|
||||
target_compile_options(coverage_config INTERFACE
|
||||
-O0 # no optimization
|
||||
-g # generate debug info
|
||||
--coverage # sets all required flags
|
||||
)
|
||||
target_link_libraries(coverage_config INTERFACE --coverage)
|
||||
endif(CODE_COVERAGE)
|
||||
|
||||
add_subdirectory(src)
|
||||
|
||||
enable_testing()
|
||||
add_subdirectory(tests)
|
||||
add_executable(fixmydl main.c)
|
||||
target_compile_options(fixmydl PUBLIC -Wall -Werror -Wno-unused-function -pedantic)
|
||||
|
||||
install(TARGETS fixmydl
|
||||
RUNTIME DESTINATION bin
|
||||
|
|
|
@ -1,4 +0,0 @@
|
|||
coverage:
|
||||
precision: 2
|
||||
round: nearest
|
||||
range: "90...100"
|
|
@ -1,10 +0,0 @@
|
|||
# Set C compiler options
|
||||
if (NOT CODE_COVERAGE)
|
||||
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -g")
|
||||
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -O3")
|
||||
endif(NOT CODE_COVERAGE)
|
||||
|
||||
add_executable(fixmydl main.c)
|
||||
target_compile_options(fixmydl PUBLIC -Wall -Werror -Wno-unused-function -pedantic)
|
||||
|
||||
target_link_libraries(fixmydl PUBLIC coverage_config)
|
Loading…
Reference in New Issue