From: 박종현/동작제어Lab(SR)/Staff Engineer/삼성전자 Date: Tue, 3 Jul 2018 02:01:09 +0000 (+0900) Subject: Introduce 'ENABLE_STRICT_BUILD' option (#462) X-Git-Tag: nncc_backup~2519 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cf2b42246cf8d6b59dc5c986b099eff63c73d647;p=platform%2Fcore%2Fml%2Fnnfw.git Introduce 'ENABLE_STRICT_BUILD' option (#462) * Introduce 'ENABLE_STRICT_BUILD' option This commit introduces 'ENABLE_STRICR_BUILD' option which allows us to detect compiler warnings as error. Signed-off-by: Jonghyun Park * Fix a typo (wraning -> warning) --- diff --git a/CMakeLists.txt b/CMakeLists.txt index b76a50f..94eb03b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -49,10 +49,17 @@ endif(${ENABLE_COVERAGE} AND NOT ${ENABLE_TEST}) option(ENABLE_EXAMPLE_BUILD "Build examples" ON) option(ENABLE_CONTRIB_BUILD "Build incubating projects under contrib/" ON) +option(ENABLE_STRICT_BUILD "Treat warning as error" OFF) ### ### Target ### +add_library(nncc_common INTERFACE) +if(ENABLE_STRICT_BUILD) + # TODO Remove -Wno-reoder + target_compile_options(nncc_common INTERFACE -Werror -Wall -Wextra -Wno-reorder) +endif(ENABLE_STRICT_BUILD) + add_library(nncc_coverage INTERFACE) if(ENABLE_COVERAGE) target_compile_options(nncc_coverage INTERFACE -g -O0 -fprofile-arcs -ftest-coverage) @@ -64,6 +71,7 @@ endif(ENABLE_COVERAGE) ### function(add_nncc_library) add_library(${ARGV}) + target_link_libraries(${ARGV0} PRIVATE nncc_common) target_link_libraries(${ARGV0} PUBLIC nncc_coverage) endfunction(add_nncc_library)