1
1
CMAKE_MINIMUM_REQUIRED ( VERSION 3.10 )
2
2
PROJECT ( cppcore )
3
- SET ( CPPCORE_VERSION_MAJOR 0 )
4
- SET ( CPPCORE_VERSION_MINOR 1 )
5
- SET ( CPPCORE_VERSION_PATCH 0 )
6
- SET ( CPPCORE_VERSION ${CPPCORE_VERSION_MAJOR} .${CPPCORE_VERSION_MINOR}.${CPPCORE_VERSION_PATCH} )
7
- SET ( PROJECT_VERSION "${CPPCORE_VERSION} " )
3
+ SET ( CPPCORE_VERSION_MAJOR 0 )
4
+ SET ( CPPCORE_VERSION_MINOR 1 )
5
+ SET ( CPPCORE_VERSION_PATCH 0 )
6
+ SET ( CPPCORE_VERSION ${CPPCORE_VERSION_MAJOR} .${CPPCORE_VERSION_MINOR}.${CPPCORE_VERSION_PATCH} )
7
+ SET ( PROJECT_VERSION "${CPPCORE_VERSION} " )
8
8
9
9
find_package (GTest )
10
10
@@ -17,11 +17,11 @@ option( CPPCORE_BUILD_UNITTESTS
17
17
"Build unit tests."
18
18
ON
19
19
)
20
- option ( CPPCORE_ASAN
20
+ option (CPPCORE_ASAN
21
21
"Enable AddressSanitizer."
22
22
OFF
23
23
)
24
- option ( CPPCORE_UBSAN
24
+ option (CPPCORE_UBSAN
25
25
"Enable Undefined Behavior sanitizer."
26
26
OFF
27
27
)
@@ -38,9 +38,9 @@ link_directories(
38
38
${CMAKE_HOME_DIRECTORY} /
39
39
)
40
40
41
- SET ( CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_HOME_DIRECTORY} /lib )
42
- SET ( CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_HOME_DIRECTORY} /lib )
43
- SET ( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_HOME_DIRECTORY} /bin )
41
+ SET (CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_HOME_DIRECTORY} /lib )
42
+ SET (CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_HOME_DIRECTORY} /lib )
43
+ SET (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_HOME_DIRECTORY} /bin )
44
44
45
45
if ( WIN32 AND NOT CYGWIN )
46
46
set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc" ) # Force to always compile with W4
@@ -56,38 +56,39 @@ elseif ( "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" )
56
56
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wno-long-long -g -pedantic -std=c++11" )
57
57
endif ()
58
58
59
- IF ( ASSIMP_ASAN )
59
+ IF ( CPPCORE_ASAN )
60
60
MESSAGE (STATUS "AddressSanitizer enabled" )
61
61
SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address" )
62
62
SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=address" )
63
63
ENDIF ()
64
64
65
- IF ( ASSIMP_UBSAN )
65
+ IF ( CPPCORE_UBSAN )
66
66
MESSAGE (STATUS "Undefined Behavior sanitizer enabled" )
67
- SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=undefined -fno-sanitize-recover=all" )
68
- SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=undefined -fno-sanitize-recover=all" )
67
+ SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=undefined -fno-sanitize-recover=all" )
68
+ SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=undefined -fno-sanitize-recover=all" )
69
69
ENDIF ()
70
70
71
- SET ( cppcore_src
71
+ SET ( cppcore_src
72
72
code/cppcore.cpp
73
73
include /cppcore/CPPCoreCommon.h
74
74
)
75
75
76
- SET ( cppcore_common_src
76
+ SET ( cppcore_common_src
77
77
include /cppcore/Common/Hash.h
78
78
include /cppcore/Common/TStringBase.h
79
+ include /cppcore/Common/TStringView.h
79
80
include /cppcore/Common/Variant.h
80
81
include /cppcore/Common/Sort.h
81
82
include /cppcore/Common/TBitField.h
82
83
include /cppcore/Common/TOptional.h
83
84
)
84
85
85
- SET ( cppcore_random_src
86
+ SET (cppcore_random_src
86
87
include /cppcore/Random/RandomGenerator.h
87
88
code/Random/RandomGenerator.cpp
88
89
)
89
90
90
- SET ( cppcore_container_src
91
+ SET ( cppcore_container_src
91
92
include /cppcore/Container/THashMap.h
92
93
include /cppcore/Container/TArray.h
93
94
include /cppcore/Container/TStaticArray.h
@@ -96,7 +97,7 @@ SET ( cppcore_container_src
96
97
include /cppcore/Container/TStaticArray.h
97
98
)
98
99
99
- SET ( cppcore_memory_src
100
+ SET ( cppcore_memory_src
100
101
include /cppcore/Memory/MemUtils.h
101
102
include /cppcore/Memory/TDefaultAllocator.h
102
103
include /cppcore/Memory/TStackAllocator.h
@@ -137,6 +138,8 @@ IF( CPPCORE_BUILD_UNITTESTS )
137
138
test /common/SortTest.cpp
138
139
test /common/TBitFieldTest.cpp
139
140
test /common/TOptionalTest.cpp
141
+ test /common/TStringViewTest.cpp
142
+ test /common/TStringBaseTest.cpp
140
143
)
141
144
142
145
SET ( cppcore_container_test_src
0 commit comments