-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathCMakeLists.txt
56 lines (49 loc) · 1.73 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
cmake_minimum_required(VERSION 3.15...3.26)
project(${SKBUILD_PROJECT_NAME} LANGUAGES C)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
find_package(Python
REQUIRED
COMPONENTS
Interpreter
Development.Module
${SKBUILD_SABI_COMPONENT})
if(NOT "${SKBUILD_SABI_COMPONENT}" STREQUAL "")
set(PY_ABI_OPTIONS "WITH_SOABI" "USE_SABI" "3.11")
else()
set(PY_ABI_OPTIONS "")
endif()
python_add_library(crc
MODULE
${CMAKE_SOURCE_DIR}/src/e2e/crc.c
${PY_ABI_OPTIONS})
python_add_library(p01
MODULE
${CMAKE_SOURCE_DIR}/src/e2e/p01.c
${PY_ABI_OPTIONS})
python_add_library(p02
MODULE
${CMAKE_SOURCE_DIR}/src/e2e/p02.c
${PY_ABI_OPTIONS})
python_add_library(p04
MODULE
${CMAKE_SOURCE_DIR}/src/e2e/p04.c
${PY_ABI_OPTIONS})
python_add_library(p05
MODULE
${CMAKE_SOURCE_DIR}/src/e2e/p05.c
${PY_ABI_OPTIONS})
python_add_library(p07
MODULE
${CMAKE_SOURCE_DIR}/src/e2e/p07.c
${PY_ABI_OPTIONS})
# Add libraries
add_library(crclib STATIC ${CMAKE_SOURCE_DIR}/src/e2e/crclib.c)
add_library(util STATIC ${CMAKE_SOURCE_DIR}/src/e2e/util.c)
# Link against util
target_link_libraries(crc PRIVATE crclib)
target_link_libraries(p01 PRIVATE crclib)
target_link_libraries(p02 PRIVATE crclib)
target_link_libraries(p04 PRIVATE crclib util)
target_link_libraries(p05 PRIVATE crclib util)
target_link_libraries(p07 PRIVATE crclib util)
install(TARGETS crc p01 p02 p04 p05 p07 LIBRARY DESTINATION e2e)