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
|
2024-05-29 23:11:52 +08:00
|
|
|
)
|
|
|
|
# Add YYCC as its library
|
2024-06-06 13:16:55 +08:00
|
|
|
target_include_directories(YYCCTestbench
|
2024-05-29 23:11:52 +08:00
|
|
|
PRIVATE
|
2024-05-30 16:22:03 +08:00
|
|
|
YYCCommonplace
|
2024-05-29 23:11:52 +08:00
|
|
|
)
|
2024-06-06 13:16:55 +08:00
|
|
|
target_link_libraries(YYCCTestbench
|
2024-05-29 23:11:52 +08:00
|
|
|
PRIVATE
|
|
|
|
YYCCommonplace
|
|
|
|
)
|
|
|
|
# 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
|
|
|
|
2024-06-20 15:47:15 +08:00
|
|
|
# Install testbench only on Release mode
|
2024-06-06 13:16:55 +08:00
|
|
|
install(TARGETS YYCCTestbench
|
2024-06-20 15:47:15 +08:00
|
|
|
CONFIGURATIONS Release
|
2024-07-22 13:56:00 +08:00
|
|
|
RUNTIME DESTINATION ${YYCC_INSTALL_BIN_PATH}
|
2024-06-03 14:24:05 +08:00
|
|
|
)
|