File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22_test.cpp
33a.out
44.buildme
5+ build /
Original file line number Diff line number Diff line change 1+ cmake_minimum_required (VERSION 3.12 )
2+
3+ set (CMAKE_CXX_STANDARD 11)
4+
5+ project ("Thread Sorter" )
6+
7+ # configuring compiler cross platform
8+ if (CMAKE_HOST_WIN32 )
9+ include (config-win32.cmake )
10+
11+ elseif (CMAKE_HOST_UNIX )
12+ include (config-unix.cmake )
13+
14+ else ()
15+ message (FATAL_ERROR "Unknown platform." )
16+
17+ endif ()
18+
19+ aux_source_directory ("${PROJECT_SOURCE_DIR} /src" PROJECT_SOURCE_FILES )
20+ add_library (lzxthreadsorter SHARED ${PROJECT_SOURCE_FILES} )
21+
22+ add_subdirectory ("snippet" )
Original file line number Diff line number Diff line change 1- # thread-pool-sort
1+ # thread-sorter
22
33一个线程池应用,可实现对海量数据排序。
44
Original file line number Diff line number Diff line change 1+ message ("-- Building on Linux ..." )
2+
3+ # configure compiler gcc with Ccache
4+ set (CMAKE_C_COMPILER "gcc" )
5+ set (CMAKE_CXX_COMPILER "g++" )
6+
7+ message ("-- Using C Compiler: ${CMAKE_C_COMPILER} (${CMAKE_C_COMPILER_VERSION} )" )
8+ message ("-- Using C++ Compiler: ${CMAKE_CXX_COMPILER} (${CMAKE_CXX_COMPILER_VERSION} )" )
Original file line number Diff line number Diff line change 1+ message ("-- Building on Win32 ..." )
2+
3+ message ("-- Using C Compiler: ${CMAKE_C_COMPILER} (${CMAKE_C_COMPILER_VERSION} )" )
4+ message ("-- Using C++ Compiler: ${CMAKE_CXX_COMPILER} (${CMAKE_CXX_COMPILER_VERSION} )" )
5+
6+ # using warning options W2
7+ option (SUPRESS_W3_WARNINGS "Configure warning level to /W2" ON )
8+ if (SUPRESS_W3_WARNINGS)
9+ add_compile_options ("/W2" )
10+ endif ()
11+
12+ # configure compiler MSVC with Ccache
13+ # please use MSVC to satisfy Ccache, not other compilers
14+ add_compile_options ("/Z7" )
15+
16+ find_program (CCACHE_EXECUTABLE ccache )
17+ if (CCACHE_EXECUTABLE)
18+ message ("-- Ccache executable found at: ${CCACHE_EXECUTABLE} " )
19+ file (COPY "${CCACHE_EXECUTABLE} " DESTINATION "${PROJECT_BINARY_DIR} " )
20+ file (RENAME "${PROJECT_BINARY_DIR} /ccache.exe" "${PROJECT_BINARY_DIR} /cl.exe" )
21+ set (CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "$<$<CONFIG :Debug ,RelWithDebInfo >:Embedded >" )
22+ set (CMAKE_VS_GLOBALS
23+ "CLToolExe=cl.exe"
24+ "CLToolPath=${PROJECT_BINARY_DIR} "
25+ "TrackFileAccess=false"
26+ "UseMultiToolTask=true"
27+ "DebugInformationFormat=OldStyle"
28+ )
29+
30+ else ()
31+ message ("-- CCache not found." )
32+
33+ endif ()
Original file line number Diff line number Diff line change 1+ # Collect snippets marked as being built
2+
3+ file (GLOB ITEMS RELATIVE ${CMAKE_CURRENT_LIST_DIR} ${CMAKE_CURRENT_LIST_DIR} /* )
4+ set (SUB_DIRS "" )
5+ foreach (ITEM ${ITEMS} )
6+ if (
7+ IS_DIRECTORY ${CMAKE_CURRENT_LIST_DIR} /${ITEM}
8+ AND EXISTS ${CMAKE_CURRENT_LIST_DIR} /${ITEM} /CMakeLists.txt
9+ AND EXISTS ${CMAKE_CURRENT_LIST_DIR} /${ITEM} /.buildme
10+ )
11+ list (APPEND SUB_DIRS ${ITEM} )
12+
13+ endif ()
14+
15+ endforeach ()
16+
17+ # Run add_subdirectory() for each
18+
19+ foreach (SUB_DIR ${SUB_DIRS} )
20+ message ("-- [LarkSDK] Building snippet: ${SUB_DIR} " )
21+ add_subdirectory (${SUB_DIR} )
22+
23+ endforeach ()
24+
25+ message ("-- Done configuring snippets" )
Original file line number Diff line number Diff line change 1+ add_executable (TemporaryTest main.cpp )
2+ target_link_libraries (TemporaryTest lzxthreadsorter )
Original file line number Diff line number Diff line change 1+ #include < iostream>
2+
3+
4+ int main ()
5+ {
6+ std::cout << __cplusplus << std::endl;
7+
8+
9+ return 0 ;
10+ }
Original file line number Diff line number Diff line change 1+ /* *
2+ * @file lthreadpool.cpp
3+ * @author DavidingPlus (davidingplus@qq.com)
4+ * @brief 线程池类源文件。
5+ * @date 2024-10-21
6+ *
7+ * Copyright (c) 2024 电子科技大学 刘治学
8+ *
9+ */
10+
11+ #include " lthreadpool.h"
Original file line number Diff line number Diff line change 1+ /**
2+ * @file lthreadpool.h
3+ * @author DavidingPlus (davidingplus@qq.com)
4+ * @brief 线程池类头文件。
5+ * @date 2024-10-21
6+ *
7+ * Copyright (c) 2024 电子科技大学 刘治学
8+ *
9+ */
10+
11+ #ifndef _LTHREADPOOL_H_
12+ #define _LTHREADPOOL_H_
13+
14+
15+ #endif
You can’t perform that action at this time.
0 commit comments