@@ -24,7 +24,18 @@ if (CMAKE_HOST_SYSTEM_NAME MATCHES "Darwin")
2424 OUTPUT_STRIP_TRAILING_WHITESPACE
2525 )
2626 if (BREW_BISON EQUAL 0 AND EXISTS "${BREW_BISON_PREFIX} " )
27- message (STATUS "Found Bison keg installed by Homebrew at ${BREW_BISON_PREFIX} " )
27+ message (STATUS "include <ctype.h>
28+ #include <errno.h>
29+ #include <math.h>
30+ #include <stdarg.h>
31+ #include <stdint.h>
32+
33+ #include <cmetrics/cmetrics.h>
34+ #include <cmetrics/cmt_gauge.h>
35+ #include <cmetrics/cmt_untyped.h>
36+ #include <cmetrics/cmt_histogram.h>
37+ #include <cmetrics/cmt_summary.h>
38+ #include <cmetrics/cmt_counter.h>Found Bison keg installed by Homebrew at ${BREW_BISON_PREFIX} " )
2839 set (BISON_EXECUTABLE "${BREW_BISON_PREFIX} /bin/bison" )
2940 endif ()
3041
@@ -68,11 +79,11 @@ else()
6879endif ()
6980
7081# Configuration options
71- option (CMT_DEV "Enable development mode" No )
72- option (CMT_DEBUG "Enable debug mode" No )
73- option (CMT_TESTS "Enable unit testing" No )
82+ option (CMT_DEV "Enable development mode" No )
83+ option (CMT_DEBUG "Enable debug mode" No )
84+ option (CMT_TESTS "Enable unit testing" No )
7485option (CMT_INSTALL_TARGETS "Enable subdirectory library installations" Yes )
75- option (CMT_ENABLE_PROMETHEUS_DECODER "Enable prometheus decoder" Yes )
86+ option (CMT_PROMETHEUS_TEXT_DECODER "Enable prometheus text format decoder (requires Flex/Bison)" Yes )
7687
7788if (CMT_DEV)
7889 set (CMT_TESTS Yes )
@@ -155,7 +166,7 @@ check_c_source_compiles("
155166 return 0;
156167 }" CMT_HAVE_MSGPACK)
157168
158- if (CMT_ENABLE_PROMETHEUS_DECODER )
169+ if (CMT_PROMETHEUS_TEXT_DECODER )
159170 # Flex and Bison: check if the variables has not been defined before by
160171 # a parent project to avoid conflicts.
161172 if (NOT FLEX_FOUND)
@@ -167,7 +178,8 @@ if(CMT_ENABLE_PROMETHEUS_DECODER)
167178 endif ()
168179
169180 if (FLEX_FOUND AND BISON_FOUND)
170- set (CMT_BUILD_PROMETHEUS_DECODER 1)
181+ set (CMT_BUILD_PROMETHEUS_TEXT_DECODER 1)
182+ CMT_DEFINITION(CMT_HAVE_PROMETHEUS_TEXT_DECODER)
171183 endif ()
172184endif ()
173185
0 commit comments