From 5ce6e4fce469696fb3792c12d9b70e2b7d6e9332 Mon Sep 17 00:00:00 2001 From: szdytom Date: Mon, 5 Aug 2024 21:34:19 +0800 Subject: [PATCH] Fix cmake for windows --- CMakeLists.txt | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9e0b94e..f3f9312 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,11 +7,20 @@ project( LANGUAGES CXX ) -option("ENABLE_CUDA" "Enable CUDA support" OFF) - include("cmake/third_party.cmake") set(CHECTUS_SRC src/main.cpp) add_executable(chectus_engine ${CHECTUS_SRC}) target_link_libraries(chectus_engine PRIVATE fmt simdjson "${TORCH_LIBRARIES}") +target_compile_features(chectus_engine PRIVATE cxx_std_20) + +if (MSVC) + file(GLOB TORCH_DLLS "${TORCH_INSTALL_PREFIX}/lib/*.dll") + add_custom_command( + TARGET chectus_engine + POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_if_different + ${TORCH_DLLS} + $) +endif (MSVC)