Debian Codegraph @

unittest/gunit/innodb/CMakeLists.txt

raw
1 # Copyright (c) 2013, 2026, Oracle and/or its affiliates.
2 #
3 # This program is free software; you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License, version 2.0,
5 # as published by the Free Software Foundation.
6 #
7 # This program is designed to work with certain software (including
8 # but not limited to OpenSSL) that is licensed under separate terms,
9 # as designated in a particular file or component or in included license
10 # documentation. The authors of MySQL hereby grant you an additional
11 # permission to link the program and your derivative works with the
12 # separately licensed software that they have either included with
13 # the program or referenced in the documentation.
14 #
15 # This program is distributed in the hope that it will be useful,
16 # but WITHOUT ANY WARRANTY; without even the implied warranty of
17 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 # GNU General Public License, version 2.0, for more details.
19 #
20 # You should have received a copy of the GNU General Public License
21 # along with this program; if not, write to the Free Software
22 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
23
24 INCLUDE_DIRECTORIES(
25 ${CMAKE_SOURCE_DIR}/sql
26 ${CMAKE_SOURCE_DIR}/storage/innobase/include
27 )
28
29 INCLUDE(${CMAKE_SOURCE_DIR}/storage/innobase/innodb.cmake)
30
31 IF(WITH_LTO OR CMAKE_COMPILER_FLAG_WITH_LTO)
32 IF(MY_COMPILER_IS_GNU AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 10)
33 # -Walloc-size-larger-than=PTRDIFF_MAX is enabled by default.
34 STRING_APPEND(CMAKE_EXE_LINKER_FLAGS " -Wno-alloc-size-larger-than")
35 ENDIF()
36 ENDIF()
37
38 SET(TESTS
39 #example
40 fil_path
41 fts0vlc
42 ha_innodb
43 fts0fts
44 log0log
45 mem0mem
46 os0file
47 os0thread-create
48 srv0conc
49 sync0rw
50 ut0bitset
51 ut0crc32
52 ut0lock_free_hash
53 ut0math
54 ut0mem
55 ut0new
56 ut0rbt
57 ut0rnd
58 )
59
60 # Treat warnings as errors on MSVC for InnoDB's unittests
61 IF(MSVC AND NOT WIN32_CLANG)
62 ADD_COMPILE_OPTIONS("/WX")
63 ENDIF()
64
65 # Fixes "C1128: number of sections exceeded object file format limit" in MSVC
66 IF(MSVC)
67 ADD_COMPILE_FLAGS(
68 ut0new-t.cc
69 COMPILE_FLAGS "/bigobj"
70 )
71 ENDIF()
72
73 SET(ALL_INNODB_TESTS)
74 FOREACH(test ${TESTS})
75 LIST(APPEND ALL_INNODB_TESTS ${test}-t.cc)
76 ENDFOREACH()
77
78 IF(WIN32)
79 LIST(APPEND ALL_INNODB_TESTS ../../../sql/nt_servc.cc)
80 ENDIF()
81 MYSQL_ADD_EXECUTABLE(merge_innodb_tests-t ${ALL_INNODB_TESTS}
82 DEPENDENCIES GenError
83 ENABLE_EXPORTS
84 ADD_TEST merge_innodb_tests-t
85 EXCLUDE_FROM_GCOV
86 LINK_LIBRARIES gunit_large server_unittest_library
87 )
88
89 # Download TBB from https://www.threadingbuildingblocks.org
90 #SET(TBB_INCDIR /path/to/tbb43_20150611oss/include)
91 #SET(TBB_LIBDIR /path/to/tbb43_20150611oss/build/linux_intel64_gcc_cc4.9.1_libc2.12_kernel2.6.39_release)
92 #TARGET_LINK_LIBRARIES(merge_innodb_tests-t tbb -L${TBB_LIBDIR} -Wl,-rpath=${TBB_LIBDIR})
93 #INCLUDE_DIRECTORIES(${TBB_INCDIR})
94
95 FOREACH(test ${TESTS})
96 SET(SRC_FILES ${test}-t.cc)
97 IF(WIN32)
98 LIST(APPEND SRC_FILES ../../../sql/nt_servc.cc)
99 ENDIF()
100 MYSQL_ADD_EXECUTABLE(${test}-t ${SRC_FILES}
101 ENABLE_EXPORTS
102 EXCLUDE_FROM_ALL
103 SKIP_INSTALL
104 LINK_LIBRARIES gunit_large server_unittest_library
105 DEPENDENCIES GenError
106 ADD_GCOV_TEST ${test}
107 )
108 ENDFOREACH()
109
110 ADD_SUBDIRECTORY(lob)