-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathCMakeLists.txt
73 lines (56 loc) · 1.9 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
71
72
73
cmake_minimum_required(VERSION 3.15)
project(TBS)
option(TBS_BUILD_TESTS "TBS Tests" OFF)
option(TBS_INSTALL "TBS Install" ON)
if(NOT TBS_INSTALL)
set(CBUILDKIT_NOINSTALL ON)
endif()
find_package(CBuildKit REQUIRED)
option(TBS_MT "Enable multithreading in TBS" OFF)
option(TBS_USE_SSE2 "Enable SSE2 in TBS" OFF)
option(TBS_USE_AVX "Enable AVX in TBS" OFF)
option(TBS_USE_ARCH_WORD_SIMD "Enable SIMD using Arch Word in TBS" ON)
option(TBS_USE_ETL "Enable Embedded Template Library in TBS" OFF)
option(TBS_NO_STL "Disable STL Usage in TBS" OFF)
if(TBS_NO_STL)
set(TBS_USE_ETL ON) # Using Aux ETL
set(TBS_MT OFF) # Disabling Multi-Threading
endif()
add_subdirectory(vendor)
add_library_ns(tbs tbs INTERFACE)
if(MSVC)
# Set the minimum required version for SSE2
if(TBS_USE_SSE2)
# target_compile_options(tbs-tbs INTERFACE /arch:SSE2)
target_compile_definitions(tbs-tbs INTERFACE TBS_USE_SSE2)
message(STATUS "SSE2 support enabled.")
endif()
if(TBS_USE_AVX)
# target_compile_options(tbs-tbs INTERFACE /arch:AVX)
target_compile_definitions(tbs-tbs INTERFACE TBS_USE_AVX)
message(STATUS "AVX support enabled.")
endif()
endif()
if(TBS_MT)
target_compile_definitions(tbs-tbs INTERFACE TBS_MT)
endif()
if(TBS_USE_ETL)
target_compile_definitions(tbs-tbs INTERFACE TBS_USE_ETL)
target_link_libraries(tbs-tbs INTERFACE etl)
endif()
if(TBS_USE_ARCH_WORD_SIMD)
target_compile_definitions(tbs-tbs INTERFACE TBS_USE_ARCH_WORD_SIMD)
endif()
add_subdirectory(cli)
if(TBS_BUILD_TESTS)
add_subdirectory(tests)
endif()
target_include_dir_iface(tbs-tbs INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/include include)
if(TBS_INSTALL)
install_target_and_headers(tbs tbs)
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/
DESTINATION include)
install(FILES
${CMAKE_CURRENT_SOURCE_DIR}/cmake/TBSConfig.cmake
DESTINATION lib/cmake/tbs)
endif()