aboutsummaryrefslogtreecommitdiff
path: root/ports/wepoll/CMakeLists.txt
blob: cd8d29a2ca8d7547b4246de8bd507884dc92a6bf (plain)
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
cmake_minimum_required(VERSION 3.14)

project(wepoll C)

add_library(wepoll wepoll.c)

if (MSVC)
    if (BUILD_SHARED_LIBS)
        target_compile_definitions(
            wepoll
            PRIVATE
                "-DWEPOLL_EXPORT=__declspec(dllexport)"
        )
    endif ()

    target_compile_options(wepoll PRIVATE /Wall /wd4127 /wd4201 /wd4242 /wd4710 /wd4711 /wd4820)

    if (MSVC_VERSION GREATER_EQUAL 1900)
        target_compile_options(wepoll PRIVATE /wd5045)
    endif ()
else ()
    target_compile_definitions(
        wepoll
        PRIVATE
            "-DWEPOLL_EXPORT=__attribute__((visibility(\"default\")))"
    )

    target_compile_options(wepoll PRIVATE -Wall -Wextra -Werror -fvisibility=hidden)
endif ()

target_link_libraries(wepoll PUBLIC ws2_32)

set_target_properties(
    wepoll
    PROPERTIES
        OUTPUT_NAME wepoll
        PUBLIC_HEADER wepoll.h
)

install(TARGETS wepoll)