File tree Expand file tree Collapse file tree 5 files changed +7
-12
lines changed
Expand file tree Collapse file tree 5 files changed +7
-12
lines changed Original file line number Diff line number Diff line change 1-
21project (prometheus-cpp-lite)
32cmake_minimum_required (VERSION 3.2)
43
54option (PROMETHEUS_BUILD_EXAMPLES "Build with examples" OFF )
65
7- if ( WIN32 )
6+ set ( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR} /bin )
87
9- # This properties specifies the directories into which targets files should be built
10- set (EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR} /bin) # Set old executable location variable
11- set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR} /bin) # Set new executable location variable. Then it can be read from RUNTIME_OUTPUT_DIRECTORY variable.
8+ if (WIN32 )
129
1310 # it prevent create Debug/ and Release folders in Visual Studio
1411 foreach ( OUTPUTCONFIG ${CMAKE_CONFIGURATION_TYPES} )
@@ -22,10 +19,6 @@ else() # not WIN32
2219
2320 set (INSTALL_PATH_BIN "bin/" )
2421
25- set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Werror" )
26- set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O0 -ggdb3" )
27- set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O2" )
28-
2922endif ()
3023
3124add_subdirectory ("./core" )
Original file line number Diff line number Diff line change 1-
21project (prometheus-cpp-lite-core)
32cmake_minimum_required (VERSION 3.2)
43
54file (GLOB_RECURSE PROMETHEUS_CPP_LITE_HEADERS *.h)
65
6+ # it is header only target
7+
78add_library (${PROJECT_NAME} INTERFACE )
89target_sources (${PROJECT_NAME} INTERFACE ${PROMETHEUS_CPP_LITE_HEADERS} )
910target_include_directories (${PROJECT_NAME} INTERFACE ${CMAKE_CURRENT_SOURCE_DIR} /include )
@@ -12,6 +13,7 @@ target_link_libraries (${PROJECT_NAME} INTERFACE http-client-lite)
1213
1314set (${PROJECT_NAME} _INCLUDE ${CMAKE_CURRENT_SOURCE_DIR} /include PARENT_SCOPE)
1415
16+ # it need for save_to_file_t
1517if (NOT WIN32 )
1618 find_package (Threads)
1719 target_link_libraries (${PROJECT_NAME} INTERFACE ${CMAKE_THREAD_LIBS_INIT} )
Original file line number Diff line number Diff line change @@ -21,6 +21,6 @@ int main() {
2121 if (random_value & 8 ) metric4++;
2222 }
2323
24- return 0 ;
24+ // return 0;
2525
2626}
Original file line number Diff line number Diff line change 1-
21project (prometheus-cpp-simpleapi)
32cmake_minimum_required (VERSION 3.2)
43
Original file line number Diff line number Diff line change @@ -109,6 +109,7 @@ namespace prometheus {
109109 void operator -- () { metric_->Decrement (); }
110110 void operator -- (int ) { metric_->Decrement (); }
111111 void operator -= (typename Metric::Value val) { metric_->Decrement (val); }
112+ void operator = (typename Metric::Value val) { metric_->Set (val); }
112113
113114 int64_t value () const { return metric_->Get (); }
114115
You can’t perform that action at this time.
0 commit comments