尝试添加CYGWIN支持
This commit is contained in:
parent
79704b894b
commit
546c40a18b
@ -21,7 +21,7 @@ function(set_cpp_standard standard)
|
||||
set(CMAKE_CXX_EXTENSIONS OFF PARENT_SCOPE)
|
||||
|
||||
# --- 平台特定设置 ---
|
||||
if(WIN32)
|
||||
if(WIN32 OR CYGWIN)
|
||||
# 为 Windows 定义 UNICODE 宏
|
||||
add_definitions(-DUNICODE -D_UNICODE)
|
||||
# 可选:添加 WIN32_LEAN_AND_MEAN 以减少 Windows 头文件包含,加快编译速度
|
||||
|
@ -3,6 +3,8 @@
|
||||
#include <stdexcept>
|
||||
#include <windows.h>
|
||||
|
||||
#include "utf8.h"
|
||||
|
||||
class mapped_file_win : public mapped_file {
|
||||
public:
|
||||
mapped_file_win();
|
||||
@ -71,8 +73,8 @@ mapped_file_win& mapped_file_win::operator=(mapped_file_win&& other) noexcept {
|
||||
bool mapped_file_win::map_file(const std::filesystem::path& filename) {
|
||||
cleanup();
|
||||
|
||||
file_handle_ = CreateFile(
|
||||
filename.c_str(),
|
||||
file_handle_ = CreateFileW(
|
||||
filename.generic_wstring().c_str(),
|
||||
GENERIC_READ,
|
||||
FILE_SHARE_READ,
|
||||
nullptr,
|
||||
|
@ -126,8 +126,8 @@ platform_window::platform_window(int32_t in_width, int32_t in_height, const wcha
|
||||
wc.hInstance = GetModuleHandle(nullptr);
|
||||
wc.lpszClassName = L"mirage_window_class";
|
||||
wc.style = CS_HREDRAW | CS_VREDRAW | CS_OWNDC | CS_DBLCLKS;
|
||||
wc.hCursor = LoadCursor(NULL, IDC_ARROW);
|
||||
wc.hIcon = LoadIcon(NULL, IDI_WINLOGO);
|
||||
wc.hCursor = LoadCursor(nullptr, IDC_ARROW);
|
||||
wc.hIcon = LoadIcon(nullptr, IDI_WINLOGO);
|
||||
RegisterClass(&wc);
|
||||
|
||||
RECT rect = { 0, 0, in_width, in_height };
|
||||
|
@ -6,7 +6,7 @@ retrieve_files(${CMAKE_CURRENT_SOURCE_DIR} SRC_FILES)
|
||||
add_library(${PROJECT_NAME} STATIC ${SRC_FILES})
|
||||
target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
||||
if (WIN32)
|
||||
if (WIN32 OR CYGWIN)
|
||||
target_compile_definitions(${PROJECT_NAME} PUBLIC -DSOKOL_D3D11)
|
||||
target_link_libraries(${PROJECT_NAME} PUBLIC d3d11 dxgi)
|
||||
elseif (UNIX)
|
||||
|
Loading…
x
Reference in New Issue
Block a user