YYCCommonplace/testbench/CMakeLists.txt
yyc12345 019034a9c2 chore: update CMakeLists.txt
- update CMakeLists.txt. Add an option to disable the generation of testbench.
- rename testbench name to YYCCTestbench.
- allow emoji test in code.
2024-06-06 13:16:55 +08:00

38 lines
784 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 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
)