Skip to content

Commit

Permalink
Remove most dependencies on config.h.
Browse files Browse the repository at this point in the history
The only thing we need it anymore is the package version and platform
configuration, so only include it for that. As a result, less files
are rebuilt when the git commit changes and config.h is regenerated.
  • Loading branch information
whitequark committed Nov 19, 2016
1 parent 369b0a3 commit d3f2ac7
Show file tree
Hide file tree
Showing 7 changed files with 4 additions and 14 deletions.
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,6 @@ else() # Linux and compatible systems
pkg_check_modules(JSONC REQUIRED json-c)
pkg_check_modules(FREETYPE REQUIRED freetype2)

set(HAVE_GTK TRUE)
if(GUI STREQUAL "gtk3")
set(HAVE_GTK3 TRUE)
pkg_check_modules(GTKMM REQUIRED gtkmm-3.0 pangomm-1.4 x11)
Expand Down
7 changes: 1 addition & 6 deletions exposed/CDemo.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,13 @@
*
* Copyright 2008-2013 Jonathan Westhues.
*---------------------------------------------------------------------------*/
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#ifdef WIN32
# include <windows.h>
#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#ifdef HAVE_STDINT_H
# include <stdint.h>
#endif
#include <stdint.h>

#include <slvs.h>

Expand Down
2 changes: 1 addition & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ elseif(APPLE)

set(platform_LIBRARIES
${APPKIT_LIBRARY})
elseif(HAVE_GTK)
elseif(HAVE_GTK2 OR HAVE_GTK3)
set(platform_SOURCES
platform/gtkmain.cpp
render/rendergl.cpp
Expand Down
1 change: 0 additions & 1 deletion src/config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
/* Do we have the si library on win32, or libspnav on *nix? */
#cmakedefine HAVE_SPACEWARE

#cmakedefine HAVE_GTK
#cmakedefine HAVE_GTK2
#cmakedefine HAVE_GTK3

Expand Down
5 changes: 2 additions & 3 deletions src/graphicswin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
// Copyright 2008-2013 Jonathan Westhues.
//-----------------------------------------------------------------------------
#include "solvespace.h"
#include "config.h"

#define mView (&GraphicsWindow::MenuView)
#define mEdit (&GraphicsWindow::MenuEdit)
Expand Down Expand Up @@ -85,7 +84,7 @@ const GraphicsWindow::MenuEntry GraphicsWindow::menu[] = {
{ 1, NULL, Command::NONE, 0, TN, NULL },
{ 1, "Dimensions in &Inches", Command::UNITS_INCHES, 0, TR, mView },
{ 1, "Dimensions in &Millimeters", Command::UNITS_MM, 0, TR, mView },
#if defined(HAVE_GTK) || defined(__APPLE__)
#if defined(__unix__) || defined(__APPLE__)
{ 1, NULL, Command::NONE, 0, TN, NULL },
{ 1, "&Full Screen", Command::FULL_SCREEN, C|F(11), TC, mView },
#endif
Expand Down Expand Up @@ -697,7 +696,7 @@ void GraphicsWindow::EnsureValidActives() {
CheckMenuByCmd(Command::SHOW_TOOLBAR, /*checked=*/SS.showToolbar);
CheckMenuByCmd(Command::PERSPECTIVE_PROJ, /*checked=*/SS.usePerspectiveProj);
CheckMenuByCmd(Command::SHOW_GRID,/*checked=*/SS.GW.showSnapGrid);
#if defined(HAVE_GTK) || defined(__APPLE__)
#if defined(__unix__) || defined(__APPLE__)
CheckMenuByCmd(Command::FULL_SCREEN, /*checked=*/FullScreenIsActive());
#endif

Expand Down
1 change: 0 additions & 1 deletion src/platform/cocoamain.mm
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
#include <map>

#include "solvespace.h"
#include <config.h>

using SolveSpace::dbp;

Expand Down
1 change: 0 additions & 1 deletion src/render/rendergl1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
//
// Copyright 2016 whitequark
//-----------------------------------------------------------------------------
#include "config.h"
#include "solvespace.h"

#ifdef WIN32
Expand Down

0 comments on commit d3f2ac7

Please sign in to comment.