Allow cmake -DOPTION_APPLE_X11=On without -U__APPLE__
This commit is contained in:
parent
4e75549e7b
commit
6276822e9e
@ -2,7 +2,7 @@
|
|||||||
# CMakeLists.txt to build the FLTK project using CMake (www.cmake.org)
|
# CMakeLists.txt to build the FLTK project using CMake (www.cmake.org)
|
||||||
# Originally written by Michael Surette
|
# Originally written by Michael Surette
|
||||||
#
|
#
|
||||||
# Copyright 1998-2022 by Bill Spitzak and others.
|
# Copyright 1998-2023 by Bill Spitzak and others.
|
||||||
#
|
#
|
||||||
# This library is free software. Distribution and use rights are outlined in
|
# This library is free software. Distribution and use rights are outlined in
|
||||||
# the file "COPYING" which should have been included with this file. If this
|
# the file "COPYING" which should have been included with this file. If this
|
||||||
@ -97,8 +97,6 @@ if (APPLE)
|
|||||||
set (HAVE_SCANDIR 1)
|
set (HAVE_SCANDIR 1)
|
||||||
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated")
|
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated")
|
||||||
if (OPTION_APPLE_X11)
|
if (OPTION_APPLE_X11)
|
||||||
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -U__APPLE__")
|
|
||||||
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -U__APPLE__")
|
|
||||||
if (NOT(${CMAKE_SYSTEM_VERSION} VERSION_LESS 17.0.0)) # a.k.a. macOS version ≥ 10.13
|
if (NOT(${CMAKE_SYSTEM_VERSION} VERSION_LESS 17.0.0)) # a.k.a. macOS version ≥ 10.13
|
||||||
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_LIBCPP_HAS_THREAD_API_PTHREAD")
|
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_LIBCPP_HAS_THREAD_API_PTHREAD")
|
||||||
endif (NOT(${CMAKE_SYSTEM_VERSION} VERSION_LESS 17.0.0))
|
endif (NOT(${CMAKE_SYSTEM_VERSION} VERSION_LESS 17.0.0))
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
//
|
//
|
||||||
// Platform header file for the Fast Light Tool Kit (FLTK).
|
// Platform header file for the Fast Light Tool Kit (FLTK).
|
||||||
//
|
//
|
||||||
// Copyright 1998-2022 by Bill Spitzak and others.
|
// Copyright 1998-2023 by Bill Spitzak and others.
|
||||||
//
|
//
|
||||||
// This library is free software. Distribution and use rights are outlined in
|
// This library is free software. Distribution and use rights are outlined in
|
||||||
// the file "COPYING" which should have been included with this file. If this
|
// the file "COPYING" which should have been included with this file. If this
|
||||||
@ -35,12 +35,12 @@ class Fl_Window;
|
|||||||
|
|
||||||
# ifdef _WIN32
|
# ifdef _WIN32
|
||||||
# include "win32.H"
|
# include "win32.H"
|
||||||
# elif defined(__APPLE__)
|
|
||||||
# include "mac.H"
|
|
||||||
# elif defined(FLTK_USE_WAYLAND)
|
# elif defined(FLTK_USE_WAYLAND)
|
||||||
# include "wayland.H"
|
# include "wayland.H"
|
||||||
# elif defined(FLTK_USE_X11)
|
# elif defined(FLTK_USE_X11)
|
||||||
# include "x11.H"
|
# include "x11.H"
|
||||||
|
# elif defined(__APPLE__)
|
||||||
|
# include "mac.H"
|
||||||
# endif // _WIN32
|
# endif // _WIN32
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
//
|
//
|
||||||
// Special Cairo support for the Fast Light Tool Kit (FLTK).
|
// Special Cairo support for the Fast Light Tool Kit (FLTK).
|
||||||
//
|
//
|
||||||
// Copyright 1998-2022 by Bill Spitzak and others.
|
// Copyright 1998-2023 by Bill Spitzak and others.
|
||||||
//
|
//
|
||||||
// This library is free software. Distribution and use rights are outlined in
|
// This library is free software. Distribution and use rights are outlined in
|
||||||
// the file "COPYING" which should have been included with this file. If this
|
// the file "COPYING" which should have been included with this file. If this
|
||||||
@ -34,8 +34,6 @@
|
|||||||
|
|
||||||
#if defined(_WIN32) // Windows
|
#if defined(_WIN32) // Windows
|
||||||
# include <cairo-win32.h>
|
# include <cairo-win32.h>
|
||||||
#elif defined(__APPLE__) // macOS
|
|
||||||
# include <cairo-quartz.h>
|
|
||||||
#elif defined(FLTK_USE_WAYLAND) // Wayland or hybrid
|
#elif defined(FLTK_USE_WAYLAND) // Wayland or hybrid
|
||||||
# include "../src/drivers/Wayland/Fl_Wayland_Graphics_Driver.H"
|
# include "../src/drivers/Wayland/Fl_Wayland_Graphics_Driver.H"
|
||||||
# include "../src/drivers/Wayland/Fl_Wayland_Window_Driver.H"
|
# include "../src/drivers/Wayland/Fl_Wayland_Window_Driver.H"
|
||||||
@ -46,6 +44,8 @@
|
|||||||
# endif
|
# endif
|
||||||
#elif defined(FLTK_USE_X11) // X11
|
#elif defined(FLTK_USE_X11) // X11
|
||||||
# include <cairo-xlib.h>
|
# include <cairo-xlib.h>
|
||||||
|
#elif defined(__APPLE__) // macOS
|
||||||
|
# include <cairo-quartz.h>
|
||||||
#else
|
#else
|
||||||
# error Cairo is not supported on this platform.
|
# error Cairo is not supported on this platform.
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@ -3,7 +3,7 @@ dnl the "configure" script is made from this by running GNU "autoconf"
|
|||||||
dnl
|
dnl
|
||||||
dnl Configuration script for the Fast Light Tool Kit (FLTK).
|
dnl Configuration script for the Fast Light Tool Kit (FLTK).
|
||||||
dnl
|
dnl
|
||||||
dnl Copyright 1998-2022 by Bill Spitzak and others.
|
dnl Copyright 1998-2023 by Bill Spitzak and others.
|
||||||
dnl
|
dnl
|
||||||
dnl This library is free software. Distribution and use rights are outlined in
|
dnl This library is free software. Distribution and use rights are outlined in
|
||||||
dnl the file "COPYING" which should have been included with this file. If this
|
dnl the file "COPYING" which should have been included with this file. If this
|
||||||
@ -185,7 +185,6 @@ AS_CASE([$host_os], [cygwin*], [
|
|||||||
], [darwin*], [
|
], [darwin*], [
|
||||||
AS_IF([test x$enable_x11 = xyes], [
|
AS_IF([test x$enable_x11 = xyes], [
|
||||||
host_os_gui="X11"
|
host_os_gui="X11"
|
||||||
OPTIM="-U__APPLE__ $OPTIM"
|
|
||||||
macosversion=$(sw_vers -productVersion | cut -d. -f2)
|
macosversion=$(sw_vers -productVersion | cut -d. -f2)
|
||||||
macosversion_maj=$(sw_vers -productVersion | cut -d. -f1)
|
macosversion_maj=$(sw_vers -productVersion | cut -d. -f1)
|
||||||
AS_IF([test $macosversion_maj -ge 11 -o $macosversion -ge 13], [
|
AS_IF([test $macosversion_maj -ge 11 -o $macosversion -ge 13], [
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
//
|
//
|
||||||
// Definition of Posix system driver (used by the X11, Wayland and macOS platforms).
|
// Definition of Posix system driver (used by the X11, Wayland and macOS platforms).
|
||||||
//
|
//
|
||||||
// Copyright 1998-2022 by Bill Spitzak and others.
|
// Copyright 1998-2023 by Bill Spitzak and others.
|
||||||
//
|
//
|
||||||
// This library is free software. Distribution and use rights are outlined in
|
// This library is free software. Distribution and use rights are outlined in
|
||||||
// the file "COPYING" which should have been included with this file. If this
|
// the file "COPYING" which should have been included with this file. If this
|
||||||
@ -262,7 +262,13 @@ bool Fl_Posix_System_Driver::probe_for_GTK(int major, int minor, void **p_ptr_gt
|
|||||||
#endif
|
#endif
|
||||||
} else {
|
} else {
|
||||||
// Try then with GTK2
|
// Try then with GTK2
|
||||||
Fl_Posix_System_Driver::ptr_gtk = Fl_Posix_System_Driver::dlopen_or_dlsym("libgtk-x11-2.0");
|
Fl_Posix_System_Driver::ptr_gtk = Fl_Posix_System_Driver::dlopen_or_dlsym(
|
||||||
|
#ifdef __APPLE__
|
||||||
|
"libgtkmacintegration-gtk2"
|
||||||
|
#else
|
||||||
|
"libgtk-x11-2.0"
|
||||||
|
#endif
|
||||||
|
);
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
if (Fl_Posix_System_Driver::ptr_gtk) {
|
if (Fl_Posix_System_Driver::ptr_gtk) {
|
||||||
puts("selected GTK-2\n");
|
puts("selected GTK-2\n");
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
//
|
//
|
||||||
// Menubar test program for the Fast Light Tool Kit (FLTK).
|
// Menubar test program for the Fast Light Tool Kit (FLTK).
|
||||||
//
|
//
|
||||||
// Copyright 1998-2020 by Bill Spitzak and others.
|
// Copyright 1998-2023 by Bill Spitzak and others.
|
||||||
//
|
//
|
||||||
// This library is free software. Distribution and use rights are outlined in
|
// This library is free software. Distribution and use rights are outlined in
|
||||||
// the file "COPYING" which should have been included with this file. If this
|
// the file "COPYING" which should have been included with this file. If this
|
||||||
@ -15,6 +15,9 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
#include <FL/Fl.H>
|
#include <FL/Fl.H>
|
||||||
|
#if defined(FLTK_USE_X11) && defined(__APPLE__)
|
||||||
|
# undef __APPLE__
|
||||||
|
#endif
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
#include <FL/platform.H> // for Fl_Mac_App_Menu
|
#include <FL/platform.H> // for Fl_Mac_App_Menu
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user