DirectWrite support #28

Merged
IoI_xD merged 13 commits from directwrite into master 2026-07-18 11:39:53 +09:00
3 changed files with 39 additions and 39 deletions
Showing only changes of commit bf03674b5d - Show all commits

cross compiling fixes
Some checks failed
pyrite-dev/milsko/pipeline/head There was a failure building this commit

IoIxD 2026-07-17 17:44:43 -07:00

View file

@ -39,6 +39,10 @@ else()
endif() endif()
if(${CMAKE_SYSTEM_NAME} STREQUAL Windows) if(${CMAKE_SYSTEM_NAME} STREQUAL Windows)
if(${CMAKE_CROSSCOMPILING})
message(STATUS "DirectWrite support has been enabled")
option(MW_USE_DIRECTWRITE "Use DirectWrite" ON)
else()
# DirectWrite stuff can only be used on Win10+ # DirectWrite stuff can only be used on Win10+
if(${CMAKE_SYSTEM_VERSION} GREATER_EQUAL 10) if(${CMAKE_SYSTEM_VERSION} GREATER_EQUAL 10)
message(STATUS "DirectWrite support has been enabled") message(STATUS "DirectWrite support has been enabled")
@ -47,6 +51,7 @@ if(${CMAKE_SYSTEM_NAME} STREQUAL Windows)
message(WARNING "DirectWrite support has been disabled (must be compiling on Win10+)") message(WARNING "DirectWrite support has been disabled (must be compiling on Win10+)")
option(MW_USE_DIRECTWRITE "Use DirectWrite" OFF) option(MW_USE_DIRECTWRITE "Use DirectWrite" OFF)
endif() endif()
endif()
endif() endif()
if(${CMAKE_SYSTEM_NAME} STREQUAL Linux OR ${CMAKE_SYSTEM_NAME} STREQUAL FreeBSD) if(${CMAKE_SYSTEM_NAME} STREQUAL Linux OR ${CMAKE_SYSTEM_NAME} STREQUAL FreeBSD)
@ -83,8 +88,8 @@ if(MW_TRY_OPENGL)
endif() endif()
if(MW_TRY_VULKAN) if(MW_TRY_VULKAN)
check_include_files(vulkan/vulkan.h HAVE_VULKAN_VULKAN_H) find_package(Vulkan OPTIONAL VULKAN)
if(HAVE_VULKAN_VULKAN_H) if(${Vulkan_FOUND})
set(MW_BUILD_VULKAN ON) set(MW_BUILD_VULKAN ON)
message(STATUS "Vulkan widget has been enabled") message(STATUS "Vulkan widget has been enabled")
else() else()

View file

@ -5,7 +5,8 @@ file(
) )
find_package(Vulkan) find_package(Vulkan)
foreach(PATH IN LISTS EXAMPLES_VULKAN_SOURCES) if(${Vulkan_FOUND})
foreach(PATH IN LISTS EXAMPLES_VULKAN_SOURCES)
get_filename_component(TARGET ${PATH} NAME_WE) get_filename_component(TARGET ${PATH} NAME_WE)
add_executable(${TARGET} MACOSX_BUNDLE ${PATH}) add_executable(${TARGET} MACOSX_BUNDLE ${PATH})
target_include_directories( target_include_directories(
@ -25,4 +26,5 @@ foreach(PATH IN LISTS EXAMPLES_VULKAN_SOURCES)
m m
) )
endif() endif()
endforeach() endforeach()
endif()

View file

@ -1,10 +1,3 @@
/**
* this example is quite minimal, you may need to modify it if your graphics card is more esoteric
*
* ioixd maintains this file. nishi doesn't know vulkan at all
*/
#include <Mw/Milsko.h> #include <Mw/Milsko.h>
#include <Mw/Widget/Vulkan.h> #include <Mw/Widget/Vulkan.h>