send tasks
This commit is contained in:
@@ -9,6 +9,8 @@ set(CMAKE_C_STANDARD 23)
|
||||
set(CMAKE_C_STANDARD_REQUIRED ON)
|
||||
set(CMAKE_C_EXTENSIONS OFF)
|
||||
|
||||
find_package(Threads REQUIRED)
|
||||
|
||||
# ---------------------------------------------------------
|
||||
# Output directories
|
||||
# ---------------------------------------------------------
|
||||
@@ -26,12 +28,12 @@ endforeach()
|
||||
# Common
|
||||
file(GLOB_RECURSE COMMON_SRC CONFIGURE_DEPENDS src/common/*.c)
|
||||
add_library(common STATIC ${COMMON_SRC})
|
||||
target_link_libraries(common PUBLIC)
|
||||
target_link_libraries(common PUBLIC ${CMAKE_THREAD_LIBS_INIT})
|
||||
target_compile_options(common PRIVATE
|
||||
-Wall
|
||||
-Wextra
|
||||
-Wpedantic
|
||||
-lpthread
|
||||
-g
|
||||
)
|
||||
target_include_directories(common PUBLIC
|
||||
${PROJECT_SOURCE_DIR}/include
|
||||
@@ -40,7 +42,7 @@ target_include_directories(common PUBLIC
|
||||
# Client
|
||||
file(GLOB_RECURSE CLIENT_SRC CONFIGURE_DEPENDS src/client/*.c)
|
||||
add_executable(client ${CLIENT_SRC})
|
||||
target_link_libraries(client PRIVATE common)
|
||||
target_link_libraries(client PRIVATE common ${CMAKE_THREAD_LIBS_INIT})
|
||||
target_include_directories(client PRIVATE
|
||||
${PROJECT_SOURCE_DIR}/include
|
||||
)
|
||||
@@ -48,14 +50,14 @@ target_compile_options(client PRIVATE
|
||||
-Wall
|
||||
-Wextra
|
||||
-Wpedantic
|
||||
-lpthread
|
||||
-g
|
||||
)
|
||||
set_target_properties(client PROPERTIES OUTPUT_NAME "miniboinc_client")
|
||||
|
||||
# Server
|
||||
file(GLOB_RECURSE SERVER_SRC CONFIGURE_DEPENDS src/server/*.c)
|
||||
add_executable(server ${SERVER_SRC})
|
||||
target_link_libraries(server PRIVATE common)
|
||||
target_link_libraries(server PRIVATE common ${CMAKE_THREAD_LIBS_INIT})
|
||||
target_include_directories(server PRIVATE
|
||||
${PROJECT_SOURCE_DIR}/include
|
||||
)
|
||||
@@ -63,7 +65,6 @@ target_compile_options(server PRIVATE
|
||||
-Wall
|
||||
-Wextra
|
||||
-Wpedantic
|
||||
-lpthread
|
||||
-g
|
||||
)
|
||||
target_compile_definitions(server PRIVATE)
|
||||
|
||||
Reference in New Issue
Block a user