修改编译问题。并将开源snprintf与MESA_log编译到一起。
This commit is contained in:
@@ -36,11 +36,16 @@ include_directories(${PROJECT_SOURCE_DIR}/inc/)
|
||||
add_subdirectory(zlog)
|
||||
|
||||
# Shared Library Output
|
||||
add_library(${lib_name}_shared SHARED src/MESA_handle_logger.c)
|
||||
add_library(${lib_name}_shared SHARED src/MESA_handle_logger.c src/MESA_shm_ring_queue.c src/portable_snprintf/snprintf.c)
|
||||
target_link_libraries(${lib_name}_shared zlog_static)
|
||||
set_target_properties(${lib_name}_shared PROPERTIES LINK_FLAGS
|
||||
"-Wl,--version-script=${PROJECT_SOURCE_DIR}/src/version.map")
|
||||
target_link_libraries(${lib_name}_shared pthread)
|
||||
target_compile_options(${lib_name}_shared PRIVATE -DHAVE_SNPRINTF -DPREFER_PORTABLE_SNPRINTF -DSNPRINTF_LONGLONG_SUPPORT)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if(DEFINED MESA_SHARED_INSTALL_DIR)
|
||||
set_target_properties(${lib_name}_shared PROPERTIES OUTPUT_NAME ${lib_name} LIBRARY_OUTPUT_DIRECTORY ${MESA_SHARED_INSTALL_DIR})
|
||||
@@ -52,9 +57,10 @@ set_target_properties(${lib_name}_shared PROPERTIES VERSION ${LIB_MAJOR_VERSION}
|
||||
set_target_properties(${lib_name}_shared PROPERTIES SOVERSION ${LIB_MAJOR_VERSION})
|
||||
|
||||
# static Library Output
|
||||
add_library(${lib_name}_static STATIC src/MESA_handle_logger.c)
|
||||
add_library(${lib_name}_static STATIC src/MESA_handle_logger.c src/MESA_shm_ring_queue.c src/portable_snprintf/snprintf.c)
|
||||
target_link_libraries(${lib_name}_static zlog_static)
|
||||
set_target_properties(${lib_name}_static PROPERTIES OUTPUT_NAME ${lib_name})
|
||||
target_compile_options(${lib_name}_static PRIVATE -DHAVE_SNPRINTF -DPREFER_PORTABLE_SNPRINTF -DSNPRINTF_LONGLONG_SUPPORT)
|
||||
|
||||
set(CMAKE_INSTALL_PREFIX /opt/MESA)
|
||||
|
||||
@@ -67,6 +73,10 @@ install(FILES conf/MESA_handle_logger.conf DESTINATION /usr/lib/tmpfiles.d/ COMP
|
||||
|
||||
|
||||
add_executable(${lib_name}_demo demo/test_handle_logger.c)
|
||||
target_link_libraries(${lib_name}_demo pthread ${lib_name}_shared)
|
||||
target_link_libraries(${lib_name}_demo pthread ${lib_name}_static)
|
||||
|
||||
|
||||
add_executable(${lib_name}_consumer shm_consumer/MESA_shm_consumer.c)
|
||||
target_link_libraries(${lib_name}_consumer ${lib_name}_static)
|
||||
|
||||
include(Package)
|
||||
|
||||
Reference in New Issue
Block a user