# SPDX-License-Identifier: GPL-3.0-or-later# This file is only used for development (netdata in Clion)# It can build netdata, but you are on your own...cmake_minimum_required(VERSION3.1.0)project(netdataCCXX)find_package(ThreadsREQUIRED)find_package(PkgConfigREQUIRED)# default is "Debug"#set(CMAKE_BUILD_TYPE "Release")# set this to see the compilation commands# set(CMAKE_VERBOSE_MAKEFILE 1)# -----------------------------------------------------------------------------# Set compilation options according to build typeIF("${CMAKE_BUILD_TYPE}"MATCHES"Debug")message(STATUS"building for: debugging")## unfortunately these produce errors#include(CheckCXXCompilerFlag)#CHECK_CXX_COMPILER_FLAG("-Wformat-signedness" CXX_FORMAT_SIGNEDNESS)#CHECK_CXX_COMPILER_FLAG("-Werror=format-security" CXX_FORMAT_SECURITY)#CHECK_CXX_COMPILER_FLAG("-fstack-protector-all" CXX_STACK_PROTECTOR)set(CXX_FORMAT_SIGNEDNESS"-Wformat-signedness")set(CXX_FORMAT_SECURITY"-Werror=format-security")set(CXX_STACK_PROTECTOR"-fstack-protector-all")set(CXX_FLAGS_DEBUG"-O0")set(CMAKE_C_STANDARD99)set(CMAKE_C_FLAGS"${CMAKE_C_FLAGS} -O1 -ggdb -Wall -Wextra -DNETDATA_INTERNAL_CHECKS=1 -DNETDATA_VERIFY_LOCKS=1 ${CXX_FORMAT_SIGNEDNESS} ${CXX_FORMAT_SECURITY} ${CXX_STACK_PROTECTOR} ${CXX_FLAGS_DEBUG}")ELSE()message(STATUS"building for: release")cmake_policy(SETCMP0069"NEW")include(CheckIPOSupported)check_ipo_supported(RESULTipo_supportedOUTPUTerror)IF(${ipo_supported})message(STATUS"link time optimization: supported")set(CMAKE_INTERPROCEDURAL_OPTIMIZATIONTRUE)ELSE()message(STATUS"link time optimization: not supported")ENDIF()ENDIF()# -----------------------------------------------------------------------------# O/S Detection# these are defined in common.h tooSET(LINUXFalse)SET(FREEBSDFalse)SET(MACOSFalse)