Skip to content

Commit 95d35d1

Browse files
authored
Fix builds without test or examples (#87)
1 parent df234ff commit 95d35d1

File tree

10 files changed

+95
-88
lines changed

10 files changed

+95
-88
lines changed

.github/appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ artifacts:
306306
#-------------------------------------------------------------------
307307

308308
cache:
309-
- C:\Tools\vcpkg\installed -> appveyor.yml
309+
- '%APPVEYOR_BUILD_FOLDER%\build\vcpkg_installed -> %APPVEYOR_BUILD_FOLDER%\build\vcpkg_installed\vcpkg\status'
310310
- '%VULKAN_SDK%\Bin -> appveyor.yml'
311311
- '%VULKAN_SDK%\Bin32 -> appveyor.yml'
312312
- '%VULKAN_SDK%\Include -> appveyor.yml'

CMakeLists.txt

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -463,22 +463,17 @@ endif()
463463
#-------------------------------------------------------------------
464464
# Installation Rules: ttauri_tests (executable)
465465
#-------------------------------------------------------------------
466-
467-
install(TARGETS ttauri_tests DESTINATION tests)
468-
469-
install(DIRECTORY tests/data/ DESTINATION tests)
470-
471-
# experimental
472-
x_vcpkg_install_local_dependencies(TARGETS ttauri_tests DESTINATION tests)
466+
if(TT_BUILD_TESTS)
467+
install(TARGETS ttauri_tests DESTINATION tests)
468+
install(DIRECTORY tests/data/ DESTINATION tests)
469+
x_vcpkg_install_local_dependencies(TARGETS ttauri_tests DESTINATION tests)
470+
endif()
473471

474472
#-------------------------------------------------------------------
475473
# Build examples
476474
#-------------------------------------------------------------------
477-
478475
if(TT_BUILD_EXAMPLES)
479-
480476
add_subdirectory(examples/ttauri_demo)
481-
482477
endif()
483478

484479
#-------------------------------------------------------------------

src/ttauri/CMakeLists.txt

Lines changed: 33 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -188,38 +188,40 @@ if(TT_BUILD_PCH)
188188
endif()
189189
endif()
190190

191-
target_sources(ttauri_tests PRIVATE
192-
algorithm_tests.cpp
193-
bezier_curve_tests.cpp
194-
bigint_tests.cpp
195-
coroutine_tests.cpp
196-
counters_tests.cpp
197-
datum_tests.cpp
198-
decimal_tests.cpp
199-
exceptions_tests.cpp
200-
file_view_tests.cpp
201-
forward_value_tests.cpp
202-
#gap_buffer_tests.cpp
203-
glob_tests.cpp
204-
int_overflow_tests.cpp
205-
interval_extent2_tests.cpp
206-
math_tests.cpp
207-
graphic_path_tests.cpp
208-
pixel_map_tests.cpp
209-
polymorphic_optional_tests.cpp
210-
polynomial_tests.cpp
211-
ranges_tests.cpp
212-
safe_int_tests.cpp
213-
small_map_tests.cpp
214-
strings_tests.cpp
215-
tokenizer_tests.cpp
216-
type_traits_tests.cpp
217-
url_parser_tests.cpp
218-
URL_tests.cpp
219-
)
191+
if(TT_BUILD_TESTS)
192+
target_sources(ttauri_tests PRIVATE
193+
algorithm_tests.cpp
194+
bezier_curve_tests.cpp
195+
bigint_tests.cpp
196+
coroutine_tests.cpp
197+
counters_tests.cpp
198+
datum_tests.cpp
199+
decimal_tests.cpp
200+
exceptions_tests.cpp
201+
file_view_tests.cpp
202+
forward_value_tests.cpp
203+
#gap_buffer_tests.cpp
204+
glob_tests.cpp
205+
int_overflow_tests.cpp
206+
interval_extent2_tests.cpp
207+
math_tests.cpp
208+
graphic_path_tests.cpp
209+
pixel_map_tests.cpp
210+
polymorphic_optional_tests.cpp
211+
polynomial_tests.cpp
212+
ranges_tests.cpp
213+
safe_int_tests.cpp
214+
small_map_tests.cpp
215+
strings_tests.cpp
216+
tokenizer_tests.cpp
217+
type_traits_tests.cpp
218+
url_parser_tests.cpp
219+
URL_tests.cpp
220+
)
221+
endif()
220222

221-
if(TT_BUILD_PCH)
222-
if(NOT TT_ENABLE_ANALYSIS)
223+
224+
if(TT_BUILD_TESTS AND TT_BUILD_PCH AND NOT TT_ENABLE_ANALYSIS)
223225
target_precompile_headers(ttauri_tests PRIVATE
224226
assert.hpp
225227
counters.hpp
@@ -233,5 +235,4 @@ if(TT_BUILD_PCH)
233235
trace.hpp
234236
URL.hpp
235237
)
236-
endif()
237238
endif()

src/ttauri/codec/CMakeLists.txt

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,11 @@ target_sources(ttauri PRIVATE
1919
BON8.cpp
2020
)
2121

22-
target_sources(ttauri_tests PRIVATE
23-
JSON_tests.cpp
24-
gzip_tests.cpp
25-
base_n_tests.cpp
26-
SHA2_tests.cpp
27-
)
22+
if(TT_BUILD_TESTS)
23+
target_sources(ttauri_tests PRIVATE
24+
JSON_tests.cpp
25+
gzip_tests.cpp
26+
base_n_tests.cpp
27+
SHA2_tests.cpp
28+
)
29+
endif()

src/ttauri/color/CMakeLists.txt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ target_sources(ttauri PRIVATE
1414
sdf_r8.hpp
1515
)
1616

17-
target_sources(ttauri_tests PRIVATE
18-
color_space_tests.cpp
19-
)
17+
if(TT_BUILD_TESTS)
18+
target_sources(ttauri_tests PRIVATE
19+
color_space_tests.cpp
20+
)
21+
endif()

src/ttauri/formula/CMakeLists.txt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ target_sources(ttauri PRIVATE
6060
formula_vector_literal_node.hpp
6161
)
6262

63-
target_sources(ttauri_tests PRIVATE
64-
formula_tests.cpp
65-
)
63+
if(TT_BUILD_TESTS)
64+
target_sources(ttauri_tests PRIVATE
65+
formula_tests.cpp
66+
)
67+
endif()

src/ttauri/geometry/CMakeLists.txt

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,16 @@ target_sources(ttauri PRIVATE
1717
vector.hpp
1818
)
1919

20-
target_sources(ttauri_tests PRIVATE
21-
identity_tests.cpp
22-
matrix_tests.cpp
23-
numeric_array_tests.cpp
24-
point_tests.cpp
25-
scale_tests.cpp
26-
spread_sheet_address_tests.cpp
27-
transform_tests.cpp
28-
translate_tests.cpp
29-
vector_tests.cpp
30-
)
31-
20+
if(TT_BUILD_TESTS)
21+
target_sources(ttauri_tests PRIVATE
22+
identity_tests.cpp
23+
matrix_tests.cpp
24+
numeric_array_tests.cpp
25+
point_tests.cpp
26+
scale_tests.cpp
27+
spread_sheet_address_tests.cpp
28+
transform_tests.cpp
29+
translate_tests.cpp
30+
vector_tests.cpp
31+
)
32+
endif()

src/ttauri/skeleton/CMakeLists.txt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ target_sources(ttauri PRIVATE
2323
skeleton_while_node.hpp
2424
)
2525

26-
target_sources(ttauri_tests PRIVATE
27-
skeleton_tests.cpp
28-
)
26+
if(TT_BUILD_TESTS)
27+
target_sources(ttauri_tests PRIVATE
28+
skeleton_tests.cpp
29+
)
30+
endif()

src/ttauri/text/CMakeLists.txt

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,11 @@ target_sources(ttauri PRIVATE
6565
unicode_ranges.hpp
6666
)
6767

68-
69-
target_sources(ttauri_tests PRIVATE
70-
unicode_bidi_tests.cpp
71-
unicode_text_segmentation_tests.cpp
72-
unicode_normalization_tests.cpp
73-
language_tag_tests.cpp
74-
)
68+
if(TT_BUILD_TESTS)
69+
target_sources(ttauri_tests PRIVATE
70+
unicode_bidi_tests.cpp
71+
unicode_text_segmentation_tests.cpp
72+
unicode_normalization_tests.cpp
73+
language_tag_tests.cpp
74+
)
75+
endif()

vcpkg.json

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
{
2-
"name": "ttauri",
3-
"version": "0.3.0",
4-
"license": "BSL-1.0",
5-
"homepage": "https://github.com/ttauri-project/ttauri",
6-
"description": "A portable, low latency, retained-mode GUI library written in C++.",
7-
"dependencies": [
8-
"fmt",
9-
"date",
10-
"vulkan",
11-
"vulkan-memory-allocator"
12-
]
2+
"name": "ttauri",
3+
"version": "0.3.0",
4+
"description": "A portable, low latency, retained-mode GUI library written in C++.",
5+
"homepage": "https://github.com/ttauri-project/ttauri",
6+
"license": "BSL-1.0",
7+
"supports": "windows & x64",
8+
"dependencies": [
9+
"date",
10+
"fmt",
11+
"vulkan",
12+
"vulkan-memory-allocator"
13+
]
1314
}

0 commit comments

Comments
 (0)