YYCCommonplace/testbench/CMakeLists.txt
yyc12345 1e990b74ae feat: update console output method
- remove the macros disable the warning and error of std functions in MSVC because YYCC has disable them in header.
- update console input output functions. provide CSharp-like interface for UTF8 console input output.
	- console output function is done by WriteConsoleW and WriteFile.
	- console input function still work in progress.
- rename console ASCII color macros
- add console ASCII color test.
- remove EnableUTF8Console because no longer needed.
- add a bunch of annotation to describe YYCC UTF8 console strategy.
- add UNICODE macro in CMakeLists.txt to order CMake generate Visual Studio solution with UNICODE charset enabled, not MBCS.
2024-06-09 21:34:28 +08:00

44 lines
956 B
CMake

# Create executable testbench
add_executable(YYCCTestbench "")
# Setup testbench sources
target_sources(YYCCTestbench
PRIVATE
${CMAKE_CURRENT_LIST_DIR}/main.cpp
)
# Add YYCC as its library
target_include_directories(YYCCTestbench
PRIVATE
YYCCommonplace
)
target_link_libraries(YYCCTestbench
PRIVATE
YYCCommonplace
)
# Setup C++ standard
set_target_properties(YYCCTestbench
PROPERTIES
CXX_STANDARD 17
CXX_STANDARD_REQUIRED 17
CXX_EXTENSION OFF
)
# Order Unicode charset for private using
target_compile_definitions(YYCCTestbench
PRIVATE
$<$<CXX_COMPILER_ID:MSVC>:UNICODE>
$<$<CXX_COMPILER_ID:MSVC>:_UNICODE>
)
# Order build as UTF-8 in MSVC
target_compile_options(YYCCTestbench
PRIVATE
$<$<CXX_COMPILER_ID:MSVC>:/utf-8>
)
# Install binary
install(TARGETS YYCCTestbench
EXPORT YYCCTestbenchTargets
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
RUNTIME DESTINATION bin
INCLUDES DESTINATION include
)