File: BuildLibEIO.cmake

package info (click to toggle)
tarantool 1.7.2.385.g952d79e-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 21,556 kB
  • ctags: 28,405
  • sloc: ansic: 180,313; cpp: 26,044; sh: 15,513; python: 4,893; makefile: 1,412
file content (42 lines) | stat: -rw-r--r-- 1,398 bytes parent folder | download
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
#
# A macro to build the bundled libeio
macro(libeio_build)
    set(eio_compile_flags)

    set(eio_compile_flags "${eio_compile_flags} -Wno-unused")
    if (CC_HAS_WNO_DANGLING_ELSE)
        set(eio_compile_flags "${eio_compile_flags} -Wno-dangling-else")
    endif()
    if (CC_HAS_WNO_PARENTHESES)
        set(eio_compile_flags "${eio_compile_flags} -Wno-parentheses")
    endif()
    if (CC_HAS_WNO_UNUSED_FUNCTION)
        set(eio_compile_flags "${eio_compile_flags} -Wno-unused-function")
    endif()
    if (CC_HAS_WNO_UNUSED_VALUE)
        set(eio_compile_flags "${eio_compile_flags} -Wno-unused-value")
    endif()
    if (CC_HAS_WNO_UNUSED_RESULT)
        set(eio_compile_flags "${eio_compile_flags} -Wno-unused-result")
    endif()
    set(eio_compile_flags "${eio_compile_flags} -DENABLE_BUNDLED_LIBEIO=1")
    set(eio_compile_flags "${eio_compile_flags} -DEIO_STACKSIZE=0")
    if (TARGET_OS_LINUX)
        set(eio_compile_flags
            "${eio_compile_flags} -DHAVE_SYS_PRCTL_H -DHAVE_PRCTL_SET_NAME")
    endif ()

    set(eio_src
        ${PROJECT_SOURCE_DIR}/third_party/tarantool_eio.c
    )

    add_library(eio STATIC ${eio_src})

    set_target_properties(eio PROPERTIES COMPILE_FLAGS "${eio_compile_flags}")

    set(LIBEIO_INCLUDE_DIR ${PROJECT_SOURCE_DIR}/third_party)
    set(LIBEIO_LIBRARIES eio)

    unset(eio_src)
    unset(eio_compile_flags)
endmacro(libeio_build)