blob: 6959f41e20779683780147d811bfea72ec3cf165 [file] [log] [blame]
Yuxiao Zhang1e760602024-03-07 12:35:24 -08001# Copyright 2024 Google LLC
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14#
15gtest = dependency('gtest', main: true, disabler: true, required: false)
16if not gtest.found()
Patrick Williams24c61c72025-02-01 08:38:07 -050017 gtest_proj = import('cmake').subproject(
18 'googletest',
19 cmake_options: ['-DCMAKE_CXX_FLAGS=-Wno-pedantic'],
20 required: false,
21 )
22 if gtest_proj.found()
23 gtest = declare_dependency(
24 dependencies: [
25 dependency('threads'),
26 gtest_proj.dependency('gtest'),
27 gtest_proj.dependency('gtest_main'),
28 ],
29 )
30 else
31 assert(not build_tests.allowed(), 'Googletest is required')
32 endif
Yuxiao Zhang1e760602024-03-07 12:35:24 -080033endif
34
Patrick Williams24c61c72025-02-01 08:38:07 -050035test(
36 'fileio_test',
37 executable(
38 'fileio_test',
39 ['fileio_test.cpp'],
40 implicit_include_directories: false,
41 dependencies: [gtest, dependency('stdplus')],
42 link_with: fileio_lib,
43 ),
44)