2024-08-15 22:20:51 +08:00
|
|
|
# Create executable
|
|
|
|
add_executable(Unvirt "")
|
|
|
|
# Setup sources
|
|
|
|
target_sources(Unvirt
|
|
|
|
PRIVATE
|
2023-03-01 10:48:50 +08:00
|
|
|
AccessibleValue.cpp
|
|
|
|
CmdHelper.cpp
|
|
|
|
StructFormatter.cpp
|
2023-08-31 10:20:10 +08:00
|
|
|
UnvirtContext.cpp
|
2023-03-01 10:48:50 +08:00
|
|
|
Unvirt.cpp
|
|
|
|
)
|
2024-08-15 22:20:51 +08:00
|
|
|
# Setup headers
|
|
|
|
target_sources(Unvirt
|
2023-03-01 10:48:50 +08:00
|
|
|
PRIVATE
|
2024-08-15 22:20:51 +08:00
|
|
|
FILE_SET HEADERS
|
|
|
|
FILES
|
|
|
|
AccessibleValue.hpp
|
|
|
|
CmdHelper.hpp
|
|
|
|
StructFormatter.hpp
|
|
|
|
UnvirtContext.hpp
|
2023-03-01 10:48:50 +08:00
|
|
|
)
|
2024-08-15 22:20:51 +08:00
|
|
|
# Setup header infomation
|
2023-09-25 21:45:53 +08:00
|
|
|
target_include_directories(Unvirt
|
|
|
|
PRIVATE
|
2024-08-15 22:20:51 +08:00
|
|
|
"${CMAKE_CURRENT_LIST_DIR}"
|
|
|
|
YYCC::YYCCommonplace
|
|
|
|
LibCmo
|
2023-09-25 21:45:53 +08:00
|
|
|
)
|
2024-08-15 22:20:51 +08:00
|
|
|
# Setup linked library infomation
|
|
|
|
target_link_libraries(Unvirt
|
|
|
|
PRIVATE
|
|
|
|
YYCC::YYCCommonplace
|
|
|
|
LibCmo
|
|
|
|
)
|
|
|
|
# Setup C++ standard
|
2023-09-25 21:45:53 +08:00
|
|
|
set_target_properties(Unvirt
|
|
|
|
PROPERTIES
|
2024-08-15 22:20:51 +08:00
|
|
|
CXX_STANDARD 20
|
|
|
|
CXX_STANDARD_REQUIRED 20
|
|
|
|
CXX_EXTENSION OFF
|
|
|
|
)
|
|
|
|
# Order Unicode charset for private using
|
|
|
|
target_compile_definitions(Unvirt
|
|
|
|
PRIVATE
|
|
|
|
$<$<CXX_COMPILER_ID:MSVC>:UNICODE>
|
|
|
|
$<$<CXX_COMPILER_ID:MSVC>:_UNICODE>
|
2023-09-25 21:45:53 +08:00
|
|
|
)
|
2024-08-15 22:20:51 +08:00
|
|
|
# Order build as UTF-8 in MSVC
|
|
|
|
target_compile_options(Unvirt
|
|
|
|
PRIVATE
|
|
|
|
$<$<CXX_COMPILER_ID:MSVC>:/utf-8>
|
|
|
|
)
|
|
|
|
|
|
|
|
# Install Unvirt only on Release mode
|
|
|
|
install(TARGETS Unvirt
|
|
|
|
CONFIGURATIONS Release
|
|
|
|
RUNTIME DESTINATION ${YYCC_INSTALL_BIN_PATH}
|
|
|
|
)
|