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-06-06 13:16:55 +08:00
|
|
|
set_target_properties(YYCCTestbench
|
2024-05-29 23:11:52 +08:00
|
|
|
PROPERTIES
|
|
|
|
CXX_STANDARD 17
|
|
|
|
CXX_STANDARD_REQUIRED 17
|
|
|
|
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
|
|
|
|
EXPORT YYCCTestbenchTargets
|
2024-06-20 15:47:15 +08:00
|
|
|
CONFIGURATIONS Release
|
|
|
|
RUNTIME DESTINATION ${YYCC_INSTALL_PATH_BIN}
|
2024-06-03 14:24:05 +08:00
|
|
|
)
|