-
Notifications
You must be signed in to change notification settings - Fork 397
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
speedup CI UT job #1606
speedup CI UT job #1606
Changes from 4 commits
1662648
5b11b0a
7f453c4
20ae021
e9e7621
1ccc757
e2c3f13
8fcc0aa
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,9 +30,17 @@ option(ENABLE_ENTERPRISE "enable enterprise feature") | |
cmake_dependent_option(ENABLE_COMPATIBLE_MODE "Build Logtail in compatible mode (for low version Linux)" OFF "LINUX" OFF) | ||
cmake_dependent_option(ENABLE_STATIC_LINK_CRT "Build Logtail by linking CRT statically" OFF "LINUX" OFF) | ||
option(WITHOUTGDB "Build Logtail without gdb") | ||
option(WITHOUTSPL "Build Logtail and UT without SPL") | ||
option(WITHSPL "Build Logtail and UT with SPL" ON) | ||
option(BUILD_LOGTAIL_UT "Build unit test for Logtail") | ||
|
||
if (BUILD_LOGTAIL_SHARED_LIBRARY AND WITHSPL) | ||
message(FATEL_ERROR, "Generating logtail shared library is not supported to be linked with SPL. WITHSPL should be set OFF.") | ||
return() | ||
endif() | ||
|
||
set(UT_LINK OFF) | ||
set(UT_LINK_NEED_SPL OFF) | ||
alph00 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
if (ENABLE_ENTERPRISE) | ||
message(STATUS "Enable Enterprise Feature.") | ||
add_definitions(-D__ENTERPRISE__) | ||
|
@@ -41,7 +49,7 @@ else () | |
include(${CMAKE_CURRENT_SOURCE_DIR}/options.cmake) | ||
endif () | ||
|
||
if (WITHOUTSPL) | ||
if (NOT WITHSPL) | ||
add_definitions(-D__EXCLUDE_SPL__) | ||
endif() | ||
|
||
|
@@ -92,7 +100,8 @@ endif () | |
include(${CMAKE_CURRENT_SOURCE_DIR}/utils.cmake) | ||
include(${CMAKE_CURRENT_SOURCE_DIR}/dependencies.cmake) | ||
include(${CMAKE_CURRENT_SOURCE_DIR}/links.cmake) | ||
set(SUBDIR_SOURCE_FILES "") | ||
set(SUBDIR_SOURCE_FILES_CORE "") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 这个最终应该叫PLUGIN_SOURCE_FILES,只包括input、processor和flusher目录下的文件 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 已修改为PLUGIN_SOURCE_FILES_CORE |
||
set(SUBDIR_SOURCE_FILES_SPL "") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. SPL_SOURCE_FILES There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 已修改为PLUGIN_SOURCE_FILES_SPL |
||
include(${CMAKE_CURRENT_SOURCE_DIR}/common/common.cmake) | ||
include(${CMAKE_CURRENT_SOURCE_DIR}/common/links.cmake) | ||
include(${CMAKE_CURRENT_SOURCE_DIR}/input/input.cmake) | ||
|
@@ -127,7 +136,7 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR}) | |
include_directories("/opt/logtail_spl/include") | ||
if (LINUX) | ||
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/observer) | ||
if (NOT WITHOUTSPL) | ||
if (WITHSPL) | ||
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/spl) | ||
endif() | ||
endif() | ||
|
@@ -153,7 +162,6 @@ if(MSVC) | |
# remove linux event listener | ||
file(GLOB REMOVE_EVENT_LISTENER_SOURCES event_listener/*_Linux.cpp event_listener/*_Linux.h) | ||
list(REMOVE_ITEM SOURCE_FILES_LIST ${REMOVE_EVENT_LISTENER_SOURCES}) | ||
set(WINDOWS_SOURCE_FILES ${SOURCE_FILES_LIST} ${SUBDIR_SOURCE_FILES}) | ||
elseif(UNIX) | ||
# remove windows event listener | ||
file(GLOB REMOVE_EVENT_LISTENER_SOURCES event_listener/*_Windows.cpp event_listener/*_Windows.h) | ||
|
@@ -162,13 +170,16 @@ elseif(UNIX) | |
# observer | ||
file(GLOB_RECURSE APPEND_OBSERVER_SOURCES observer/*) | ||
list(APPEND SOURCE_FILES_LIST ${APPEND_OBSERVER_SOURCES}) | ||
if (WITHSPL) | ||
set(SRC_FILES ${SUBDIR_SOURCE_FILES_SPL}) | ||
endif() | ||
endif() | ||
set(UNIX_SOURCE_FILES ${SOURCE_FILES_LIST} ${SUBDIR_SOURCE_FILES}) | ||
endif() | ||
set(SRC_FILES ${SRC_FILES} ${SOURCE_FILES_LIST} ${SUBDIR_SOURCE_FILES_CORE}) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. SOURCE_FILES_LIST能换个名字吗?比如CORE_SOURCE_FILES There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 已改为 FRAMEWORK_SOURCE_FILES |
||
|
||
# Generate SPL library. | ||
if (LINUX) | ||
if (NOT WITHOUTSPL) | ||
if (WITHSPL) | ||
add_subdirectory(spl) | ||
endif() | ||
endif() | ||
|
@@ -177,47 +188,35 @@ endif() | |
if (BUILD_LOGTAIL) | ||
if (ENABLE_ENTERPRISE) | ||
if (UNIX) | ||
add_executable(${LOGTAIL_TARGET} enterprise_logtail.cpp ${UNIX_SOURCE_FILES}) | ||
add_executable(${LOGTAIL_TARGET} enterprise_logtail.cpp ${SRC_FILES}) | ||
elseif (MSVC) | ||
add_executable(${LOGTAIL_TARGET} enterprise_logtail_windows.cpp ${WINDOWS_SOURCE_FILES}) | ||
add_executable(${LOGTAIL_TARGET} enterprise_logtail_windows.cpp ${SRC_FILES}) | ||
endif () | ||
else () | ||
if (UNIX) | ||
add_executable(${LOGTAIL_TARGET} logtail.cpp ${UNIX_SOURCE_FILES}) | ||
add_executable(${LOGTAIL_TARGET} logtail.cpp ${SRC_FILES}) | ||
elseif (MSVC) | ||
add_executable(${LOGTAIL_TARGET} logtail_windows.cpp ${WINDOWS_SOURCE_FILES}) | ||
add_executable(${LOGTAIL_TARGET} logtail_windows.cpp ${SRC_FILES}) | ||
endif () | ||
endif() | ||
endif() | ||
|
||
if (BUILD_LOGTAIL_SHARED_LIBRARY) | ||
if (NOT WITHOUTSPL) | ||
message(ERROR, "generating logtail shared library is not supported with SPL.") | ||
else() | ||
if (ENABLE_ENTERPRISE) | ||
if (UNIX) | ||
add_library(${LOGTAIL_TARGET} SHARED enterprise_logtail.cpp ${UNIX_SOURCE_FILES}) | ||
elseif (MSVC) | ||
add_library(${LOGTAIL_TARGET} SHARED enterprise_logtail_windows.cpp ${WINDOWS_SOURCE_FILES}) | ||
endif () | ||
else () | ||
if (UNIX) | ||
add_library(${LOGTAIL_TARGET} SHARED logtail.cpp ${UNIX_SOURCE_FILES}) | ||
elseif (MSVC) | ||
add_library(${LOGTAIL_TARGET} SHARED logtail_windows.cpp ${WINDOWS_SOURCE_FILES}) | ||
endif () | ||
endif() | ||
if (BUILD_LOGTAIL_SHARED_LIBRARY) | ||
if (ENABLE_ENTERPRISE) | ||
if (UNIX) | ||
add_library(${LOGTAIL_TARGET} SHARED enterprise_logtail.cpp ${SRC_FILES}) | ||
elseif (MSVC) | ||
add_library(${LOGTAIL_TARGET} SHARED enterprise_logtail_windows.cpp ${SRC_FILES}) | ||
endif () | ||
else () | ||
if (UNIX) | ||
add_library(${LOGTAIL_TARGET} SHARED logtail.cpp ${SRC_FILES}) | ||
elseif (MSVC) | ||
add_library(${LOGTAIL_TARGET} SHARED logtail_windows.cpp ${SRC_FILES}) | ||
endif () | ||
endif() | ||
endif () | ||
|
||
# Logtail UT. | ||
if (BUILD_LOGTAIL_UT) | ||
message(STATUS "Build unittest.") | ||
include(CTest) | ||
enable_testing() | ||
add_subdirectory(unittest) | ||
endif () | ||
|
||
# Generate independent libraries. | ||
# add_subdirectory(helper) | ||
add_subdirectory(go_pipeline) | ||
|
@@ -226,8 +225,16 @@ add_subdirectory(common) | |
# Link libraries. | ||
if(BUILD_LOGTAIL OR BUILD_LOGTAIL_SHARED_LIBRARY) | ||
input_link(${LOGTAIL_TARGET}) | ||
processor_link(${LOGTAIL_TARGET}) | ||
processor_link(${LOGTAIL_TARGET} ${UT_LINK} ${UT_LINK_NEED_SPL}) | ||
alph00 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
flusher_link(${LOGTAIL_TARGET}) | ||
all_link(${LOGTAIL_TARGET}) | ||
common_link(${LOGTAIL_TARGET}) | ||
endif() | ||
endif() | ||
|
||
# Logtail UT. | ||
if (BUILD_LOGTAIL_UT) | ||
message(STATUS "Build unittest.") | ||
include(CTest) | ||
enable_testing() | ||
add_subdirectory(unittest) | ||
endif () |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BUILD_LOGTAIL_SHARED_LIBRARY 注释说明下应用场景
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
代码注释,不是评论注释。说明下什么场景会用
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已修改