MSVC support

This commit is contained in:
htower committed 2025-07-09 22:28:43 +08:00
1 parent 74c9446cdb
commit c31ddcf282
4 files changed
+16

No files matched your search

+5
View File
@@ -13,7 +13,12 @@ if (NOT DEFINED OPTCON_LOCAL_BUILD)
FetchContent_MakeAvailable(fmt)
endif()
if (MSVC)
# https://learn.microsoft.com/en-us/cpp/build/reference/compiler-option-warning-level?view=msvc-170
add_compile_options(/Wall)
else()
add_compile_options(-Wall -Wextra -Wpedantic)
endif()
add_subdirectory(src)
add_subdirectory(test)
+5
View File
@@ -9,6 +9,11 @@
#include <windows.h>
#endif
#if defined(_MSC_VER)
// https://www.scivision.dev/ssize_t-platform-independent
#define ssize_t std::ptrdiff_t
#endif
namespace ipc {
void
+3
View File
@@ -5,7 +5,10 @@
#include <fmt/core.h>
#include <string>
#include <thread>
#if !defined(_MSC_VER)
#include <unistd.h>
#endif
#include "ipc.hpp"
+3
View File
@@ -2,7 +2,10 @@
#include <cmath>
#include <fmt/core.h>
#include <thread>
#if !defined(_MSC_VER)
#include <unistd.h>
#endif
#include "ipc/api.hpp"