-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathCMakeLists.txt
53 lines (48 loc) · 935 Bytes
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
set(src
cio_os.c
cio_log.c
cio_file.c
cio_memfs.c
cio_chunk.c
cio_meta.c
cio_scan.c
cio_utils.c
cio_stream.c
cio_stats.c
cio_error.c
chunkio.c
)
set(libs cio-crc32)
if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
set(src
${src}
cio_file_win32.c
win32/dirent.c
)
set(libs
${libs}
Shell32.lib
Shlwapi.lib)
else()
set(src
${src}
cio_file_unix.c
)
endif()
if(CIO_LIB_STATIC)
add_library(chunkio-static STATIC ${src})
target_link_libraries(chunkio-static ${libs})
if(CIO_SANITIZE_ADDRESS)
add_sanitizers(chunkio-static)
endif()
endif()
if (CIO_LIB_SHARED)
add_library(chunkio-shared SHARED ${src})
target_link_libraries(chunkio-shared ${libs})
if(CIO_SANITIZE_ADDRESS)
add_sanitizers(chunkio-shared)
endif()
endif()
if (NOT CIO_LIB_STATIC AND NOT CIO_LIB_SHARED)
message(FATAL_ERROR "What are you doing?, you should build something")
endif()