]> granicus.if.org Git - icinga2/blob - lib/config/CMakeLists.txt
Merge pull request #6999 from Icinga/bugfix/compiler-warnings
[icinga2] / lib / config / CMakeLists.txt
1 # Icinga 2 | (c) 2012 Icinga GmbH | GPLv2+
2
3 find_package(BISON 2.3.0 REQUIRED)
4 find_package(FLEX 2.5.31 REQUIRED)
5
6 bison_target(config_parser config_parser.yy ${CMAKE_CURRENT_BINARY_DIR}/config_parser.cc)
7 set_property(SOURCE ${CMAKE_CURRENT_BINARY_DIR}/config_parser.cc PROPERTY EXCLUDE_UNITY_BUILD TRUE)
8
9 flex_target(config_lexer config_lexer.ll ${CMAKE_CURRENT_BINARY_DIR}/config_lexer.cc)
10 set_property(SOURCE ${CMAKE_CURRENT_BINARY_DIR}/config_lexer.cc PROPERTY EXCLUDE_UNITY_BUILD TRUE)
11
12 if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
13   set_property(SOURCE ${CMAKE_CURRENT_BINARY_DIR}/config_parser.cc PROPERTY COMPILE_FLAGS "-Wno-deprecated-register -Wno-parentheses-equality -Wno-unused-function")
14   set_property(SOURCE ${CMAKE_CURRENT_BINARY_DIR}/config_lexer.cc PROPERTY COMPILE_FLAGS "-Wno-deprecated-register -Wno-null-conversion")
15 endif()
16
17 add_flex_bison_dependency(config_lexer config_parser)
18
19 include_directories(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
20
21 set(config_SOURCES
22   i2-config.hpp
23   activationcontext.cpp activationcontext.hpp
24   applyrule.cpp applyrule.hpp
25   configcompiler.cpp configcompiler.hpp
26   configcompilercontext.cpp configcompilercontext.hpp
27   configfragment.hpp
28   configitem.cpp configitem.hpp
29   configitembuilder.cpp configitembuilder.hpp
30   expression.cpp expression.hpp
31   objectrule.cpp objectrule.hpp
32   vmops.hpp
33   ${FLEX_config_lexer_OUTPUTS} ${BISON_config_parser_OUTPUTS}
34 )
35
36 if(ICINGA2_UNITY_BUILD)
37   mkunity_target(config config config_SOURCES)
38 endif()
39
40 add_library(config OBJECT ${config_SOURCES})
41
42 add_dependencies(config base)
43
44 set_target_properties (
45   config PROPERTIES
46   FOLDER Lib
47 )