From e96943c1211235dff56d94606ee779ed2a3dfa73 Mon Sep 17 00:00:00 2001 From: Glenn Rice Date: Sun, 7 Nov 2010 17:45:35 +0000 Subject: [PATCH] Added an option in the cmake build to disable wxWidgets. To use add "-DDISABLE_WX=1" to the cmake configuration command. Also fixed the nowx build. Set scons build to autodetect OpenCL by checking for both the library and header instead of having an option. Unfortunately there probably needs to be a path variable that can be set to the location to look for the headers. For example on Ubuntu with nvidia, the headers are located in /usr/include/nvidia-current instead of /usr/include, and hence not found by scons. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6355 8ced0084-cf51-0410-be5f-012b33b47a6e --- CMakeLists.txt | 9 ++++++--- Externals/Lua/CMakeLists.txt | 8 +++----- SConstruct | 9 +++------ Source/Core/DolphinWX/CMakeLists.txt | 3 ++- Source/Core/DolphinWX/Src/MainNoGUI.cpp | 1 + 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c3cdad79a5..be0c8bbbc8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -33,10 +33,10 @@ endif() include(FindPkgConfig REQUIRED) # Various compile flags -add_definitions(-msse2 -Wall) +add_definitions(-msse2 -Wall -Wno-unused-result) # gcc uses some optimizations which might break stuff without this flag -add_definitions(-fno-strict-aliasing) +add_definitions(-fno-strict-aliasing -fno-exceptions) include(CheckCXXCompilerFlag) CHECK_CXX_COMPILER_FLAG(-fvisibility-inlines-hidden VISIBILITY_INLINES_HIDDEN) @@ -88,7 +88,10 @@ include(FindOpenGL REQUIRED) include(FindALSA OPTIONAL) include(FindOpenAL OPTIONAL) -include(FindwxWidgets OPTIONAL) +set(DISABLE_WX FALSE CACHE BOOL "Disable wxWidgets (use CLI interface)") +if(NOT DISABLE_WX) + include(FindwxWidgets OPTIONAL) +endif(NOT DISABLE_WX) if(UNIX) include(FindX11 REQUIRED) endif(UNIX) diff --git a/Externals/Lua/CMakeLists.txt b/Externals/Lua/CMakeLists.txt index 9bec9d8944..0665cc6686 100644 --- a/Externals/Lua/CMakeLists.txt +++ b/Externals/Lua/CMakeLists.txt @@ -1,8 +1,6 @@ -# TODO? -#luaenv = env.Clone() -# -#if not sys.platform == 'win32': -# luaenv['CPPDEFINES'].append('LUA_USE_LINUX') # Also works for OS X +if(UNIX) + add_definitions(-DLUA_USE_LINUX) +endif(UNIX) set(SRCS lapi.c lauxlib.c diff --git a/SConstruct b/SConstruct index ea6978b175..9307cfa773 100644 --- a/SConstruct +++ b/SConstruct @@ -36,7 +36,6 @@ if env['PLATFORM'] == 'posix': vars.AddVariables( '/usr', PathVariable.PathAccept), PathVariable('userdir', 'Set the name of the user data directory in home', '.dolphin-emu', PathVariable.PathAccept), - BoolVariable('opencl', 'Build with OpenCL', False), EnumVariable('pgo', 'Profile-Guided Optimization (generate or use)', 'none', allowed_values = ('none', 'generate', 'use'), ignorecase = 2), BoolVariable('shared_glew', 'Use system shared libGLEW', True), @@ -275,11 +274,9 @@ else: print "Must have CgGL to build" Exit(1) - if env['opencl']: - env['HAVE_OPENCL'] = conf.CheckPKG('OpenCL') - conf.Define('HAVE_OPENCL', env['HAVE_OPENCL']) - else: - env['HAVE_OPENCL'] = 0 + env['HAVE_OPENCL'] = int(conf.CheckPKG('OpenCL') and \ + conf.CheckCXXHeader("CL/cl.h")) + conf.Define('HAVE_OPENCL', env['HAVE_OPENCL']) # PGO - Profile Guided Optimization if env['pgo'] == 'generate': diff --git a/Source/Core/DolphinWX/CMakeLists.txt b/Source/Core/DolphinWX/CMakeLists.txt index 8f89e29939..9a99df2e66 100644 --- a/Source/Core/DolphinWX/CMakeLists.txt +++ b/Source/Core/DolphinWX/CMakeLists.txt @@ -8,7 +8,8 @@ set(LIBS core common lua z - sfml-network) + sfml-network + wiiuse) if(wxWidgets_FOUND) set(MEMCARDSRCS Src/MemcardManager.cpp diff --git a/Source/Core/DolphinWX/Src/MainNoGUI.cpp b/Source/Core/DolphinWX/Src/MainNoGUI.cpp index 171fc2281d..c07ee7f379 100644 --- a/Source/Core/DolphinWX/Src/MainNoGUI.cpp +++ b/Source/Core/DolphinWX/Src/MainNoGUI.cpp @@ -42,6 +42,7 @@ #include "cmdline.h" #include "Thread.h" #include "PowerPC/PowerPC.h" +#include "HW/Wiimote.h" #include "PluginManager.h" #include "ConfigManager.h"