diff --git a/CMakeLists.txt b/CMakeLists.txt index 673cf86..76fb915 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,9 +1,12 @@ cmake_minimum_required(VERSION 3.28...3.30) +project(latch) set(CMAKE_EXPORT_COMPILE_COMMANDS yes) -project(latch) -set(OUTPUT_BUILD_DIR ${PROJECT_SOURCE_DIR}/build) +if(MSVC) + add_compile_options("/source-charset:utf-8") + add_compile_options("/execution-charset:utf-8") +endif() option(TEST "是否启动单元测试" ON) option(SHARED "是否编译为动态库" OFF) diff --git a/src/io/cross/windows/lt-file-windows.c b/src/io/cross/windows/lt-file-windows.c index 23ac086..2de2ea3 100644 --- a/src/io/cross/windows/lt-file-windows.c +++ b/src/io/cross/windows/lt-file-windows.c @@ -1,4 +1,4 @@ -#ifdef __WIN32__ +#if defined(__WIN32__) || defined(_WIN32) #include "lt-file-windows.h" #include diff --git a/src/io/lt-file.c b/src/io/lt-file.c index f90369e..5266eb9 100644 --- a/src/io/lt-file.c +++ b/src/io/lt-file.c @@ -6,7 +6,7 @@ #ifdef __linux__ #include "cross/unix/lt-file-linux.h" -#elif __WIN32__ +#elif defined(__WIN32__) || defined(_WIN32) #include "cross/windows/lt-file-windows.h" #endif