Skip to content

Commit

Permalink
Enable building the CubeView demo w/o requiring '<config.h>'
Browse files Browse the repository at this point in the history
This allows to build the CubeView demo from the unmodified FLTK sources
w/o having to provide a 'config.h' file by defining HAVE_GL=1 on the
compiler commandline. See also comment in test/CubeView.h.

test/CubeMain.cxx: don't include <config.h> at all (not needed)

test/CubeView.h: #include <config.h> only if HAVE_GL is not defined
  • Loading branch information
Albrecht Schlosser committed Nov 29, 2024
1 parent 404411e commit 12ea6a0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
3 changes: 1 addition & 2 deletions test/CubeMain.cxx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//
// CubeView class .
//
// Copyright 1998-2010 by Bill Spitzak and others.
// Copyright 1998-2024 by Bill Spitzak and others.
//
// 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
Expand All @@ -14,7 +14,6 @@
// https://www.fltk.org/bugs.php
//

#include <config.h>
#include <FL/Fl.H>
#include "CubeViewUI.h"

Expand Down
11 changes: 10 additions & 1 deletion test/CubeView.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//
// CubeView class definitions for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2021 by Bill Spitzak and others.
// Copyright 1998-2024 by Bill Spitzak and others.
//
// 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
Expand All @@ -17,7 +17,16 @@
#ifndef CUBEVIEW_H
#define CUBEVIEW_H 1

// Note: The CubeView demo program can only be built if
// (1) '<config.h>' can be included (FLTK build) *or*
// (2) 'HAVE_GL' has been defined prior to including this header.

// Define 'HAVE_GL=1' on the compiler commandline to build
// this program w/o 'config.h' (needs FLTK lib with GL).

#ifndef HAVE_GL
#include <config.h>
#endif

// Note to editor: the following code can and should be copied
// to the fluid tutorial in 'documentation/src/fluid.dox'
Expand Down

0 comments on commit 12ea6a0

Please sign in to comment.