-
Notifications
You must be signed in to change notification settings - Fork 59
/
CMakeLists.txt
70 lines (57 loc) · 1.66 KB
/
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
cmake_minimum_required(VERSION 3.25 FATAL_ERROR)
set(VERSION_MAJOR 3)
set(VERSION_MINOR 0)
set(VERSION_PATCH 0)
set(VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}")
set(ARCHES aarch64;arm;i686;x86_64)
set(APIS 21;24)
project(elf-cleaner
LANGUAGES C CXX
VERSION ${VERSION}
)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(PACKAGE_NAME "termux-elf-cleaner" CACHE STRING "Name of the package")
add_executable("${PACKAGE_NAME}"
elf-cleaner.cpp
arghandling.c
)
target_compile_definitions("${PACKAGE_NAME}"
PRIVATE "COPYRIGHT=\"Copyright (C) 2022-2024 Termux and contributors.\""
PRIVATE "PACKAGE_VERSION=\"${VERSION}\""
PRIVATE "PACKAGE_NAME=\"${PACKAGE_NAME}\""
)
enable_testing()
# Dynamic section tests
foreach(arch ${ARCHES})
foreach(api ${APIS})
add_test(
NAME "dynamic-section-${arch}-api${api}"
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/tests/test-dynamic-section.sh
${CMAKE_CURRENT_BINARY_DIR}/${PACKAGE_NAME}
${CMAKE_CURRENT_SOURCE_DIR}
curl-7.83.1
${arch}
${api}
)
endforeach()
endforeach()
# TLS alignment tests
foreach(arch ${ARCHES})
add_test(
NAME "tls-alignment-${arch}-api${api}"
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/tests/test-tls-alignment.sh
${CMAKE_CURRENT_BINARY_DIR}/${PACKAGE_NAME}
${CMAKE_CURRENT_SOURCE_DIR}
valgrind-3.19.0
${arch}
)
endforeach()
# Thread test
add_test(
NAME "thread"
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/tests/test-threads.sh
${CMAKE_CURRENT_BINARY_DIR}/${PACKAGE_NAME}
${CMAKE_CURRENT_SOURCE_DIR}
)