Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,15 @@ if (NOT SC_USE_WRAP)
message(STATUS "Turned off --wrap.")
endif()

option(SC_BUILD_STATIC "Build static library" ON)
Comment thread
yanzixiang marked this conversation as resolved.
Outdated
set(SC_LIBRARY_TYPE SHARED)
if (SC_BUILD_STATIC)
set(SC_LIBRARY_TYPE STATIC)
message(STATUS "Building static library enabled.")
else()
message(STATUS "Building shared library enabled.")
endif()

add_subdirectory(array)
add_subdirectory(buffer)
add_subdirectory(condition)
Expand Down
4 changes: 2 additions & 2 deletions array/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
cmake_minimum_required(VERSION 3.10)
cmake_minimum_required(VERSION 3.10)
Comment thread
yanzixiang marked this conversation as resolved.
project(sc_array C)

set(CMAKE_C_STANDARD 99)
set(CMAKE_C_STANDARD_REQUIRED ON)
set(CMAKE_C_EXTENSIONS OFF)

add_library(sc_array SHARED sc_array.h)
add_library(sc_array ${SC_LIBRARY_TYPE} sc_array.h)
set_target_properties(sc_array PROPERTIES LINKER_LANGUAGE C)


Expand Down
4 changes: 2 additions & 2 deletions buffer/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
cmake_minimum_required(VERSION 3.10)
cmake_minimum_required(VERSION 3.10)
project(sc_buf C)

set(CMAKE_C_STANDARD 99)
set(CMAKE_C_STANDARD_REQUIRED ON)
set(CMAKE_C_EXTENSIONS OFF)

add_library(
sc_buf SHARED
sc_buf ${SC_LIBRARY_TYPE}
sc_buf.c
sc_buf.h)

Expand Down
4 changes: 2 additions & 2 deletions condition/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
cmake_minimum_required(VERSION 3.10)
cmake_minimum_required(VERSION 3.10)
project(sc_cond C)

set(CMAKE_C_STANDARD 99)
set(CMAKE_C_STANDARD_REQUIRED ON)
set(CMAKE_C_EXTENSIONS OFF)

add_library(
sc_cond SHARED
sc_cond ${SC_LIBRARY_TYPE}
sc_cond.c
sc_cond.h)

Expand Down
4 changes: 2 additions & 2 deletions crc32/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
cmake_minimum_required(VERSION 3.10)
cmake_minimum_required(VERSION 3.10)
project(sc_crc32 C)

set(CMAKE_C_STANDARD 99)
set(CMAKE_C_STANDARD_REQUIRED ON)
set(CMAKE_C_EXTENSIONS OFF)

add_library(
sc_crc32 SHARED
sc_crc32 ${SC_LIBRARY_TYPE}
sc_crc32.c
sc_crc32.h)

Expand Down
4 changes: 2 additions & 2 deletions heap/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
cmake_minimum_required(VERSION 3.10)
cmake_minimum_required(VERSION 3.10)
project(sc_heap C)

set(CMAKE_C_STANDARD 99)
set(CMAKE_C_STANDARD_REQUIRED ON)
set(CMAKE_C_EXTENSIONS OFF)

add_library(
sc_heap SHARED
sc_heap ${SC_LIBRARY_TYPE}
sc_heap.c
sc_heap.h)

Expand Down
4 changes: 2 additions & 2 deletions ini/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
cmake_minimum_required(VERSION 3.10)
cmake_minimum_required(VERSION 3.10)
project(sc_ini C)

set(CMAKE_C_STANDARD 99)
set(CMAKE_C_STANDARD_REQUIRED ON)
set(CMAKE_C_EXTENSIONS OFF)

add_library(
sc_ini SHARED
sc_ini ${SC_LIBRARY_TYPE}
sc_ini.c
sc_ini.h)

Expand Down
4 changes: 2 additions & 2 deletions linked-list/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
cmake_minimum_required(VERSION 3.10)
cmake_minimum_required(VERSION 3.10)
project(sc_list C)

set(CMAKE_C_STANDARD 99)
set(CMAKE_C_STANDARD_REQUIRED ON)
set(CMAKE_C_EXTENSIONS OFF)

add_library(
sc_list SHARED
sc_list ${SC_LIBRARY_TYPE}
sc_list.c
sc_list.h)

Expand Down
4 changes: 2 additions & 2 deletions logger/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
cmake_minimum_required(VERSION 3.10)
cmake_minimum_required(VERSION 3.10)
project(sc_log C)

set(CMAKE_C_STANDARD 99)
set(CMAKE_C_STANDARD_REQUIRED ON)
set(CMAKE_C_EXTENSIONS OFF)

add_library(
sc_log SHARED
sc_log ${SC_LIBRARY_TYPE}
sc_log.c
sc_log.h)

Expand Down
4 changes: 2 additions & 2 deletions map/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
cmake_minimum_required(VERSION 3.10)
cmake_minimum_required(VERSION 3.10)
project(sc_map C)

set(CMAKE_C_STANDARD 99)
set(CMAKE_C_STANDARD_REQUIRED ON)
set(CMAKE_C_EXTENSIONS OFF)

add_library(
sc_map SHARED
sc_map ${SC_LIBRARY_TYPE}
sc_map.c
sc_map.h)

Expand Down
4 changes: 2 additions & 2 deletions memory-map/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
cmake_minimum_required(VERSION 3.10)
cmake_minimum_required(VERSION 3.10)
project(sc_mmap C)

set(CMAKE_C_STANDARD 99)
set(CMAKE_C_STANDARD_REQUIRED ON)
set(CMAKE_C_EXTENSIONS OFF)

add_library(
sc_mmap SHARED
sc_mmap ${SC_LIBRARY_TYPE}
sc_mmap.c
sc_mmap.h)

Expand Down
4 changes: 2 additions & 2 deletions mutex/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
cmake_minimum_required(VERSION 3.10)
cmake_minimum_required(VERSION 3.10)
project(sc_mutex C)

set(CMAKE_C_STANDARD 99)
set(CMAKE_C_STANDARD_REQUIRED ON)
set(CMAKE_C_EXTENSIONS OFF)

add_library(
sc_mutex SHARED
sc_mutex ${SC_LIBRARY_TYPE}
sc_mutex.c
sc_mutex.h)

Expand Down
4 changes: 2 additions & 2 deletions option/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
cmake_minimum_required(VERSION 3.10)
cmake_minimum_required(VERSION 3.10)
project(sc_option C)

set(CMAKE_C_STANDARD 99)
set(CMAKE_C_STANDARD_REQUIRED ON)
set(CMAKE_C_EXTENSIONS OFF)

add_library(
sc_option SHARED
sc_option ${SC_LIBRARY_TYPE}
sc_option.c
sc_option.h)

Expand Down
4 changes: 2 additions & 2 deletions perf/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.10)
cmake_minimum_required(VERSION 3.10)
project(sc_perf C)

set(CMAKE_C_STANDARD 99)
Expand All @@ -8,7 +8,7 @@ set(CMAKE_C_EXTENSIONS OFF)
if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")

add_library(
sc_perf SHARED
sc_perf ${SC_LIBRARY_TYPE}
sc_perf.c
sc_perf.h)

Expand Down
4 changes: 2 additions & 2 deletions queue/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
cmake_minimum_required(VERSION 3.10)
cmake_minimum_required(VERSION 3.10)
project(sc_queue C)

set(CMAKE_C_STANDARD 99)
set(CMAKE_C_STANDARD_REQUIRED ON)
set(CMAKE_C_EXTENSIONS OFF)

add_library(
sc_queue SHARED
sc_queue ${SC_LIBRARY_TYPE}
sc_queue.h)

set_target_properties(sc_queue PROPERTIES LINKER_LANGUAGE C)
Expand Down
4 changes: 2 additions & 2 deletions sc/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
cmake_minimum_required(VERSION 3.10)
cmake_minimum_required(VERSION 3.10)
project(sc C)

set(CMAKE_C_STANDARD 99)
set(CMAKE_C_STANDARD_REQUIRED ON)
set(CMAKE_C_EXTENSIONS OFF)

add_library(
sc SHARED
sc ${SC_LIBRARY_TYPE}
sc.c
sc.h)

Expand Down
4 changes: 2 additions & 2 deletions signal/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
cmake_minimum_required(VERSION 3.10)
cmake_minimum_required(VERSION 3.10)
project(sc_signal C)

set(CMAKE_C_STANDARD 99)
set(CMAKE_C_STANDARD_REQUIRED ON)
set(CMAKE_C_EXTENSIONS OFF)

add_library(
sc_signal SHARED
sc_signal ${SC_LIBRARY_TYPE}
sc_signal.c
sc_signal.h)

Expand Down
4 changes: 2 additions & 2 deletions socket/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
cmake_minimum_required(VERSION 3.10)
cmake_minimum_required(VERSION 3.10)
project(sc_socket C)

set(CMAKE_C_STANDARD 99)
set(CMAKE_C_STANDARD_REQUIRED ON)
set(CMAKE_C_EXTENSIONS OFF)

add_library(
sc_socket SHARED
sc_socket ${SC_LIBRARY_TYPE}
sc_sock.c
sc_sock.h)

Expand Down
4 changes: 2 additions & 2 deletions string/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
cmake_minimum_required(VERSION 3.10)
cmake_minimum_required(VERSION 3.10)
project(sc_str C)

set(CMAKE_C_STANDARD 99)
set(CMAKE_C_STANDARD_REQUIRED ON)
set(CMAKE_C_EXTENSIONS OFF)

add_library(
sc_str SHARED
sc_str ${SC_LIBRARY_TYPE}
sc_str.c
sc_str.h)

Expand Down
4 changes: 2 additions & 2 deletions thread/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
cmake_minimum_required(VERSION 3.10)
cmake_minimum_required(VERSION 3.10)
project(sc_thread C)

set(CMAKE_C_STANDARD 99)
set(CMAKE_C_STANDARD_REQUIRED ON)
set(CMAKE_C_EXTENSIONS OFF)

add_library(
sc_thread SHARED
sc_thread ${SC_LIBRARY_TYPE}
sc_thread.c
sc_thread.h)

Expand Down
4 changes: 2 additions & 2 deletions time/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
cmake_minimum_required(VERSION 3.10)
cmake_minimum_required(VERSION 3.10)
project(sc_time C)

set(CMAKE_C_STANDARD 99)
set(CMAKE_C_STANDARD_REQUIRED ON)
set(CMAKE_C_EXTENSIONS OFF)

add_library(
sc_time SHARED
sc_time ${SC_LIBRARY_TYPE}
sc_time.c
sc_time.h)

Expand Down
4 changes: 2 additions & 2 deletions timer/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
cmake_minimum_required(VERSION 3.10)
cmake_minimum_required(VERSION 3.10)
project(sc_timer C)

set(CMAKE_C_STANDARD 99)
set(CMAKE_C_STANDARD_REQUIRED ON)
set(CMAKE_C_EXTENSIONS OFF)

add_library(
sc_timer SHARED
sc_timer ${SC_LIBRARY_TYPE}
sc_timer.c
sc_timer.h)

Expand Down
2 changes: 1 addition & 1 deletion uri/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ set(CMAKE_C_STANDARD_REQUIRED ON)
set(CMAKE_C_EXTENSIONS OFF)

add_library(
sc_uri SHARED
sc_uri ${SC_LIBRARY_TYPE}
sc_uri.c
sc_uri.h)

Expand Down