chore: update build system

- use configuration-arch-based path in MSVC to make sure generated package can be used by native MSVC project.
- add github action and corresponding build script. but not tested.
- fix some testbench code.
This commit is contained in:
2024-06-20 15:47:15 +08:00
parent 3fa05b43d9
commit bb17bb6a1f
7 changed files with 93 additions and 12 deletions

View File

@ -8,6 +8,18 @@ project(YYCC
option(YYCC_BUILD_TESTBENCH "Build testbench of YYCCommonplace." OFF)
option(YYCC_BUILD_DOC "Build document of YYCCommonplace." OFF)
# Detect MSVC IDE environment.
# If we in it, we should add configuration and build type in install path.
if (CMAKE_GENERATOR MATCHES "Visual Studio")
# Do Visual Studio specific
set(YYCC_INSTALL_PATH_LIB lib/${CMAKE_VS_PLATFORM_NAME}/$<CONFIG>)
set(YYCC_INSTALL_PATH_BIN bin/${CMAKE_VS_PLATFORM_NAME})
else()
# Other stuff
set(YYCC_INSTALL_PATH_LIB lib)
set(YYCC_INSTALL_PATH_BIN bin)
endif()
# Import 2 build targets
add_subdirectory(src)
if (YYCC_BUILD_TESTBENCH)