2024-05-29 23:11:52 +08:00
|
|
|
# Create executable testbench
|
2024-06-06 13:16:55 +08:00
|
|
|
add_executable(YYCCTestbench "")
|
2024-06-03 14:24:05 +08:00
|
|
|
# Setup testbench sources
|
2024-06-06 13:16:55 +08:00
|
|
|
target_sources(YYCCTestbench
|
2024-06-03 14:24:05 +08:00
|
|
|
PRIVATE
|
2024-06-15 21:53:45 +08:00
|
|
|
main.cpp
|
2025-06-20 23:38:34 +08:00
|
|
|
yycc/constraint.cpp
|
|
|
|
yycc/constraint/builder.cpp
|
|
|
|
yycc/string/op.cpp
|
|
|
|
yycc/string/reinterpret.cpp
|
2025-06-24 11:29:01 +08:00
|
|
|
yycc/string/parse.cpp
|
|
|
|
yycc/string/stringify.cpp
|
2025-06-26 10:27:33 +08:00
|
|
|
yycc/rust/parse.cpp
|
|
|
|
yycc/rust/stringify.cpp
|
2024-05-29 23:11:52 +08:00
|
|
|
)
|
2025-06-20 23:38:34 +08:00
|
|
|
# Setup headers
|
2024-06-06 13:16:55 +08:00
|
|
|
target_include_directories(YYCCTestbench
|
2025-06-20 23:38:34 +08:00
|
|
|
PUBLIC
|
|
|
|
"${CMAKE_CURRENT_LIST_DIR}"
|
2024-05-29 23:11:52 +08:00
|
|
|
)
|
2025-06-20 23:38:34 +08:00
|
|
|
# Setup libraries
|
2024-06-06 13:16:55 +08:00
|
|
|
target_link_libraries(YYCCTestbench
|
2024-05-29 23:11:52 +08:00
|
|
|
PRIVATE
|
|
|
|
YYCCommonplace
|
2025-06-20 23:38:34 +08:00
|
|
|
GTest::gtest_main
|
2024-05-29 23:11:52 +08:00
|
|
|
)
|
|
|
|
# Setup C++ standard
|
2024-08-26 11:58:20 +08:00
|
|
|
target_compile_features(YYCCTestbench PUBLIC cxx_std_17)
|
|
|
|
set_target_properties(YYCCTestbench PROPERTIES CXX_EXTENSION OFF)
|
2024-06-09 21:34:28 +08:00
|
|
|
# Order Unicode charset for private using
|
|
|
|
target_compile_definitions(YYCCTestbench
|
|
|
|
PRIVATE
|
|
|
|
$<$<CXX_COMPILER_ID:MSVC>:UNICODE>
|
|
|
|
$<$<CXX_COMPILER_ID:MSVC>:_UNICODE>
|
|
|
|
)
|
2024-05-29 23:11:52 +08:00
|
|
|
# Order build as UTF-8 in MSVC
|
2024-06-06 13:16:55 +08:00
|
|
|
target_compile_options(YYCCTestbench
|
2024-05-29 23:11:52 +08:00
|
|
|
PRIVATE
|
|
|
|
$<$<CXX_COMPILER_ID:MSVC>:/utf-8>
|
|
|
|
)
|
2024-06-03 14:24:05 +08:00
|
|
|
|
2025-06-20 23:38:34 +08:00
|
|
|
# Discover all test
|
|
|
|
include(GoogleTest)
|
|
|
|
gtest_discover_tests(YYCCTestbench)
|