-
Notifications
You must be signed in to change notification settings - Fork 162
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
67 lines (61 loc) · 1.92 KB
/
Copy pathCMakeLists.txt
File metadata and controls
67 lines (61 loc) · 1.92 KB
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
list(APPEND PATCH_FILES
# Revert 6e36e7730caf07b6cd0bfa265cdf9b5e31e7acad, because it's
# not helpful in our workflow, and just causes logging noise.
sdcv-no-unknown-dict-warning.patch
# Force UTF-8 command line parsing.
sdcv-locale-hack.patch
# Fix compilation with newer GLib.
compat_with_newer_glib.patch
# Don't walk into "res/" subdirectories.
sdcv-ignore-res.patch
)
string(APPEND GLIB2_INCLUDE_DIRS
${STAGING_DIR}/include/glib-2.0
$<SEMICOLON>
${STAGING_DIR}/lib/glib-2.0/include
)
string(APPEND GLIB2_LIBRARIES ${STAGING_DIR}/lib/libglib-2.0.a)
if(NOT HAS_GETTEXT)
string(APPEND GLIB2_LIBRARIES $<SEMICOLON> ${STAGING_DIR}/lib/libintl.a)
endif()
if(NOT HAS_ICONV)
string(APPEND GLIB2_LIBRARIES $<SEMICOLON> ${STAGING_DIR}/lib/libiconv.a)
endif()
if(APPLE)
string(APPEND GLIB2_LIBRARIES
$<SEMICOLON> "-framework Foundation"
$<SEMICOLON> "-framework AppKit"
)
else()
# Need pthread library and rt library on old glibc (for `clock_gettime`).
string(APPEND GLIB2_LIBRARIES $<SEMICOLON> -pthread)
if(NOT ANDROID)
string(APPEND GLIB2_LIBRARIES $<SEMICOLON> -lrt)
endif()
endif()
if(ANDROID OR MONOLIBTIC)
set(ZLIB ${STAGING_DIR}/lib/libz.a)
else()
set(ZLIB ${STAGING_DIR}/lib/libz${LIB_EXT})
endif()
list(APPEND CMAKE_ARGS
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
# Project options.
-DENABLE_NLS=False
-DWITH_READLINE=False
# GLib.
-DGLIB2_INCLUDE_DIRS=${GLIB2_INCLUDE_DIRS}
-DGLIB2_LIBRARIES=${GLIB2_LIBRARIES}
# Zlib.
-DZLIB_LIBRARY_RELEASE=${ZLIB}
)
list(APPEND BUILD_CMD COMMAND ninja)
append_binary_install_command(INSTALL_CMD sdcv)
external_project(
DOWNLOAD URL 265dbfda83a57810595d156877f3e6fd
https://github.com/Dushistov/sdcv/archive/refs/tags/v0.5.5.tar.gz
CMAKE_ARGS ${CMAKE_ARGS}
PATCH_FILES ${PATCH_FILES}
BUILD_COMMAND ${BUILD_CMD}
INSTALL_COMMAND ${INSTALL_CMD}
)