2019-12-14 05:20:17 +00:00
|
|
|
cmake_minimum_required(VERSION 3.0)
|
|
|
|
project(profiler-client C)
|
|
|
|
|
2021-07-24 00:25:42 +00:00
|
|
|
get_filename_component(PROJECT_TOP "${PROJECT_SOURCE_DIR}/../.." ABSOLUTE)
|
|
|
|
list(APPEND CMAKE_MODULE_PATH "${PROJECT_TOP}/cmake/" "${PROJECT_SOURCE_DIR}/cmake/")
|
2019-12-14 05:20:17 +00:00
|
|
|
|
|
|
|
include(GNUInstallDirs)
|
|
|
|
include(CheckCCompilerFlag)
|
|
|
|
include(FeatureSummary)
|
|
|
|
|
2021-07-24 00:25:42 +00:00
|
|
|
include(OptimizeForNative) # option(OPTIMIZE_FOR_NATIVE)
|
2019-12-14 05:20:17 +00:00
|
|
|
|
|
|
|
add_compile_options(
|
|
|
|
"-Wall"
|
|
|
|
"-Werror"
|
|
|
|
"-Wfatal-errors"
|
|
|
|
"-ffast-math"
|
|
|
|
"-fdata-sections"
|
|
|
|
"-ffunction-sections"
|
|
|
|
"$<$<CONFIG:DEBUG>:-O0;-g3;-ggdb>"
|
|
|
|
)
|
|
|
|
|
|
|
|
set(EXE_FLAGS "-Wl,--gc-sections")
|
|
|
|
set(CMAKE_C_STANDARD 11)
|
|
|
|
|
|
|
|
execute_process(
|
|
|
|
COMMAND cat ../../VERSION
|
|
|
|
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
|
|
|
|
OUTPUT_VARIABLE BUILD_VERSION
|
|
|
|
OUTPUT_STRIP_TRAILING_WHITESPACE
|
|
|
|
)
|
|
|
|
|
|
|
|
add_definitions(-D BUILD_VERSION='"${BUILD_VERSION}"')
|
|
|
|
|
|
|
|
include_directories(
|
|
|
|
${PROJECT_SOURCE_DIR}/include
|
|
|
|
${CMAKE_BINARY_DIR}/include
|
|
|
|
)
|
|
|
|
|
|
|
|
link_libraries(
|
|
|
|
rt
|
|
|
|
m
|
|
|
|
)
|
|
|
|
|
|
|
|
set(SOURCES
|
|
|
|
src/main.c
|
|
|
|
)
|
|
|
|
|
2020-05-19 01:37:44 +00:00
|
|
|
add_subdirectory("${PROJECT_TOP}/common" "${CMAKE_BINARY_DIR}/common")
|
|
|
|
add_subdirectory("${PROJECT_TOP}/repos/LGMP/lgmp" "${CMAKE_BINARY_DIR}/lgmp" )
|
2019-12-14 05:20:17 +00:00
|
|
|
|
|
|
|
add_executable(profiler-client ${SOURCES})
|
|
|
|
target_compile_options(profiler-client PUBLIC ${PKGCONFIG_CFLAGS_OTHER})
|
|
|
|
target_link_libraries(profiler-client
|
|
|
|
${EXE_FLAGS}
|
|
|
|
lg_common
|
2020-01-10 06:22:40 +00:00
|
|
|
lgmp
|
2019-12-14 05:20:17 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
feature_summary(WHAT ENABLED_FEATURES DISABLED_FEATURES)
|