CMake: enable Direct2D graphics context by default
Disable it when the d2d1.h header is not found. When using MSVC, match the behaviour of setup.h.
This commit is contained in:
@@ -142,10 +142,6 @@ if(DEFINED wxUSE_OLE AND wxUSE_OLE)
|
|||||||
set(wxUSE_OLE_AUTOMATION ON)
|
set(wxUSE_OLE_AUTOMATION ON)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(DEFINED wxUSE_GRAPHICS_DIRECT2D AND NOT wxUSE_GRAPHICS_CONTEXT)
|
|
||||||
set(wxUSE_GRAPHICS_DIRECT2D OFF)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(wxUSE_OPENGL)
|
if(wxUSE_OPENGL)
|
||||||
set(wxUSE_GLCANVAS ON)
|
set(wxUSE_GLCANVAS ON)
|
||||||
endif()
|
endif()
|
||||||
@@ -174,6 +170,21 @@ if(wxUSE_GUI)
|
|||||||
set(wxUSE_ENH_METAFILE ON)
|
set(wxUSE_ENH_METAFILE ON)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# Direct2D check
|
||||||
|
if(WIN32 AND wxUSE_GRAPHICS_DIRECT2D)
|
||||||
|
check_include_file(d2d1.h HAVE_D2D1_H)
|
||||||
|
if (NOT HAVE_D2D1_H)
|
||||||
|
wx_option_force_value(wxUSE_GRAPHICS_DIRECT2D OFF)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
if(MSVC) # match setup.h
|
||||||
|
if(MSVC_VERSION LESS 1600)
|
||||||
|
wx_option_force_value(wxUSE_GRAPHICS_DIRECT2D OFF)
|
||||||
|
else()
|
||||||
|
wx_option_force_value(wxUSE_GRAPHICS_DIRECT2D ${wxUSE_GRAPHICS_CONTEXT})
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
# WXQT checks
|
# WXQT checks
|
||||||
if(WXQT)
|
if(WXQT)
|
||||||
wx_option_force_value(wxUSE_WEBVIEW OFF)
|
wx_option_force_value(wxUSE_WEBVIEW OFF)
|
||||||
|
@@ -208,8 +208,8 @@ if(APPLE)
|
|||||||
set(wxUSE_GRAPHICS_CONTEXT ON)
|
set(wxUSE_GRAPHICS_CONTEXT ON)
|
||||||
else()
|
else()
|
||||||
wx_option(wxUSE_GRAPHICS_CONTEXT "use graphics context 2D drawing API")
|
wx_option(wxUSE_GRAPHICS_CONTEXT "use graphics context 2D drawing API")
|
||||||
if (WIN32 AND (NOT MSVC OR MSVC_VERSION LESS 1600))
|
if(WIN32)
|
||||||
wx_option(wxUSE_GRAPHICS_DIRECT2D "enable Direct2D graphics context" OFF)
|
wx_option(wxUSE_GRAPHICS_DIRECT2D "enable Direct2D graphics context")
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user