Fix windows build with CUDA (#1101)

Co-authored-by: firecoperana <firecoperana>
This commit is contained in:
firecoperana
2026-01-04 23:59:23 -06:00
committed by GitHub
parent d7476a1b46
commit 56dceefd6b
5 changed files with 13 additions and 16 deletions

View File

@@ -8,9 +8,6 @@ set(CMAKE_WARN_UNUSED_CLI YES)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED true)
if(MSVC)
add_compile_options(/permissive- /Zc:__cplusplus)
endif()
set(CMAKE_CUDA_USE_RESPONSE_FILE_FOR_INCLUDES 0)
set(CMAKE_CUDA_USE_RESPONSE_FILE_FOR_LIBRARIES 0)
set(CMAKE_CUDA_USE_RESPONSE_FILE_FOR_OBJECTS 0)

View File

@@ -96,11 +96,5 @@ endif()
if (WIN32)
TARGET_LINK_LIBRARIES(${TARGET} PRIVATE ws2_32)
endif()
if(MSVC)
set_target_properties(${TARGET} PROPERTIES
CXX_STANDARD 17
CXX_STANDARD_REQUIRED ON
)
endif()
target_compile_features(${TARGET} PRIVATE cxx_std_17)

View File

@@ -47,6 +47,7 @@ struct DatabaseHandle {
#endif
using json = nlohmann::ordered_json;
namespace fs = std::filesystem;
bool server_verbose = false;
bool server_log_json = true;
@@ -1310,7 +1311,6 @@ int main(int argc, char ** argv) {
const auto list_saved_prompts = [&ctx_server, &params](const httplib::Request& req, httplib::Response& res) {
json response = json::array();
namespace fs = std::filesystem;
try {
for (const auto& entry : fs::directory_iterator(params.slot_save_path)) {

View File

@@ -1540,6 +1540,12 @@ target_compile_definitions(ggml PRIVATE $<$<CONFIG:Release>:NDEBUG>)
target_include_directories(ggml PUBLIC ../include)
target_include_directories(ggml PRIVATE . ${GGML_EXTRA_INCLUDES})
target_link_directories(ggml PRIVATE ${GGML_EXTRA_LIBDIRS})
if(MSVC)
set_target_properties(ggml PROPERTIES
CUDA_STANDARD 17
CUDA_STANDARD_REQUIRED ON
)
endif()
target_compile_features (ggml PRIVATE c_std_11) # don't bump
target_link_libraries(ggml PRIVATE Threads::Threads ${GGML_EXTRA_LIBS})

View File

@@ -78,12 +78,12 @@
#include <io.h>
#endif
#if __cplusplus >= 202000L
#define LU8(x) (const char*)(u8##x)
#else
#define LU8(x) u8##x
#endif
//#if __cplusplus >= 202000L
// #define LU8(x) (const char*)(u8##x)
//#else
// #define LU8(x) u8##x
//#endif
#define LU8(x) (const char*)(u8##x)
#include <algorithm>
#include <array>
#include <cassert>