-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
78 lines (62 loc) · 1.52 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
74
75
76
77
78
cmake_minimum_required(VERSION 3.15.0)
project(BiNums LANGUAGES C CXX)
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
# Set the build artifacts directories
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/$<CONFIG>/bin")
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/$<CONFIG>/lib")
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/$<CONFIG>/lib")
if (MSVC)
add_compile_options(/W3)
add_compile_options(/sdl)
else()
add_compile_options(-Wall)
endif()
option(ENABLE_ADDRESS_SANITIZER "Enable Address Sanitizer" OFF)
if (NOT MSVC)
add_compile_options(-Wall)
add_compile_options(-Wextra)
endif()
# Address sanitizer settings
if (ENABLE_ADDRESS_SANITIZER)
add_compile_options(-fsanitize=address)
if (NOT MSVC)
add_link_options(-fsanitize=address)
endif()
endif()
if (MSVC)
add_compile_options(/W4)
add_compile_options(/MP)
endif()
add_executable(binums)
target_sources(binums PUBLIC
Common.h
FixedNumber.h
Float16m7e8s1.h
Half.h
Int24.h
precomp.h
BiNums.cpp
BiNumsMain.cpp
precomp.cpp
)
add_executable(binumstest)
target_sources(binumstest PUBLIC
Common.h
FixedNumber.h
Float16m7e8s1.h
Half.h
Int24.h
precomp.h
BiNums.cpp
BiNumsTest.cpp
precomp.cpp
)
target_include_directories(binums PUBLIC
${LOCAL_INCLUDE_DIR}
)
target_include_directories(binumstest PUBLIC
${LOCAL_INCLUDE_DIR}
)