cmake: new option -DEXTRA_PLUGINS=TRUE|FALSE

--extra for ./build.sh script

By default only build the pricipal plugin: GSdx|zzogl/spu2-x/onepad/UsbNull/Dev9Null

Extra plugins are: GsNull|zzogl-cg/Spu2Null|zerospu/PadNull

The purpose is to improve compilation time on linux
This commit is contained in:
Gregory Hainaut 2014-04-10 09:20:42 +02:00
parent 37b1d3ae42
commit 414ce3589a
3 changed files with 58 additions and 46 deletions

View File

@ -27,7 +27,9 @@ do
--egl ) flags="$flags -DEGL_API=TRUE" ;;
--gles ) flags="$flags -DGLES_API=TRUE" ;;
--sdl2 ) flags="$flags -DSDL2_API=TRUE" ;;
--extra ) flags="$flags -DEXTRA_PLUGINS=TRUE" ;;
--clean ) clean_build=true ;;
*)
# unknown option
echo "** User options **"
@ -35,6 +37,7 @@ do
echo "--debug : Build PCSX2 as a Debug build."
echo "--release : Build PCSX2 as a Release build."
echo "--clean : Do a clean build."
echo "--extra : Build all plugins"
echo "** Developper option **"
echo "--glsl : Replace CG backend of ZZogl by GLSL"
echo "--egl : Replace GLX by EGL (ZZogl plugins only)"

View File

@ -9,7 +9,8 @@
# Build the Replay Loaders : -DBUILD_REPLAY_LOADERS=TRUE|FALSE
# Use GLSL API(else NVIDIA_CG): -DGLSL_API=TRUE|FALSE
# Use EGL (vs GLX) : -DEGL_API=TRUE|FALSE
# Use SDL2 ; -DSDL2_API=TRUE|FALSE
# Use SDL2 : -DSDL2_API=TRUE|FALSE
# Build all plugins : -DEXTRA_PLUGINS=TRUE|FALSE
### GCC optimization options
# control C flags : -DUSER_CMAKE_C_FLAGS="cflags"
@ -211,3 +212,9 @@ if (NOT DEFINED XDG_STD)
set(XDG_STD FALSE)
endif (NOT DEFINED XDG_STD)
#-------------------------------------------------------------------------------
# Use only main plugin (faster compilation time)
#-------------------------------------------------------------------------------
if (NOT DEFINED EXTRA_PLUGINS)
set(EXTRA_PLUGINS FALSE)
endif()

View File

@ -85,20 +85,22 @@ endif(GTK2_FOUND)
# requires: -BZip2
# -gtk2 (linux)
#---------------------------------------
if(BZIP2_FOUND AND GTK2_FOUND)
if(BZIP2_FOUND AND GTK2_FOUND AND EXTRA_PLUGINS)
set(CDVDiso TRUE)
elseif(NOT EXISTS "${CMAKE_SOURCE_DIR}/plugins/CDVDiso")
set(CDVDiso FALSE)
else(BZIP2_FOUND AND GTK2_FOUND)
else()
set(CDVDiso FALSE)
message(STATUS "Skip build of CDVDiso: miss some dependencies")
message(STATUS "${msg_dep_cdvdiso}")
endif(BZIP2_FOUND AND GTK2_FOUND)
endif()
#---------------------------------------
# CDVDlinuz
#---------------------------------------
if(EXTRA_PLUGINS)
set(CDVDlinuz TRUE)
endif()
#---------------------------------------
# dev9null
@ -119,9 +121,9 @@ endif(GTK2_FOUND)
#---------------------------------------
# GSnull
#---------------------------------------
if(GTK2_FOUND)
if(GTK2_FOUND AND EXTRA_PLUGINS)
set(GSnull TRUE)
endif(GTK2_FOUND)
endif()
#---------------------------------------
#---------------------------------------
@ -149,15 +151,15 @@ endif(OPENGL_FOUND AND X11_FOUND AND EGL_FOUND)
# -X11
# -CG
#---------------------------------------
if(GLEW_FOUND AND OPENGL_FOUND AND X11_FOUND AND CG_FOUND)
if(GLEW_FOUND AND OPENGL_FOUND AND X11_FOUND AND CG_FOUND AND EXTRA_PLUGINS)
set(zerogs TRUE)
elseif(NOT EXISTS "${CMAKE_SOURCE_DIR}/plugins/zerogs")
set(zerogs FALSE)
else(GLEW_FOUND AND OPENGL_FOUND AND X11_FOUND AND CG_FOUND)
else()
set(zerogs FALSE)
message(STATUS "Skip build of zerogs: miss some dependencies")
message(STATUS "${msg_dep_zerogs}")
endif(GLEW_FOUND AND OPENGL_FOUND AND X11_FOUND AND CG_FOUND)
endif()
#---------------------------------------
#---------------------------------------
@ -172,30 +174,30 @@ endif(GLEW_FOUND AND OPENGL_FOUND AND X11_FOUND AND CG_FOUND)
#---------------------------------------
if((GLEW_FOUND AND OPENGL_FOUND AND X11_FOUND AND JPEG_FOUND AND common_libs) AND (CG_FOUND OR GLSL_API))
set(zzogl TRUE)
if(CG_FOUND AND NOT GLSL_API)
if(CG_FOUND AND NOT GLSL_API AND EXTRA_PLUGINS)
set(zzoglcg TRUE)
else(CG_FOUND AND NOT GLSL_API)
else()
set(zzoglcg FALSE)
endif(CG_FOUND AND NOT GLSL_API)
endif()
elseif(NOT EXISTS "${CMAKE_SOURCE_DIR}/plugins/zzogl-pg")
set(zzogl FALSE)
set(zzoglcg FALSE)
set(REBUILD_SHADER FALSE)
else((GLEW_FOUND AND OPENGL_FOUND AND X11_FOUND AND JPEG_FOUND AND common_libs) AND (CG_FOUND OR GLSL_API))
else()
set(zzogl FALSE)
set(zzoglcg FALSE)
set(REBUILD_SHADER FALSE)
message(STATUS "Skip build of zzogl: miss some dependencies")
message(STATUS "${msg_dep_zzogl}")
endif((GLEW_FOUND AND OPENGL_FOUND AND X11_FOUND AND JPEG_FOUND AND common_libs) AND (CG_FOUND OR GLSL_API))
endif()
#---------------------------------------
#---------------------------------------
# PadNull
#---------------------------------------
if(GTK2_FOUND)
if(GTK2_FOUND AND EXTRA_PLUGINS)
set(PadNull TRUE)
endif(GTK2_FOUND)
endif()
#---------------------------------------
#---------------------------------------
@ -217,9 +219,9 @@ endif(SDL_FOUND)
#---------------------------------------
# SPU2null
#---------------------------------------
if(GTK2_FOUND)
if(GTK2_FOUND AND EXTRA_PLUGINS)
set(SPU2null TRUE)
endif(GTK2_FOUND)
endif()
#---------------------------------------
#---------------------------------------
@ -249,18 +251,18 @@ endif()
# -ALSA
# -PortAudio
#---------------------------------------
if(EXISTS "${CMAKE_SOURCE_DIR}/plugins/zerospu2" AND SOUNDTOUCH_FOUND AND ALSA_FOUND)
if(EXISTS "${CMAKE_SOURCE_DIR}/plugins/zerospu2" AND SOUNDTOUCH_FOUND AND ALSA_FOUND AND EXTRA_PLUGINS)
set(zerospu2 TRUE)
# Comment the next line, if you want to compile zerospu2
set(zerospu2 FALSE)
message(STATUS "Don't build zerospu2. It is super-seeded by spu2x")
elseif(NOT EXISTS "${CMAKE_SOURCE_DIR}/plugins/zerospu2")
set(zerospu2 FALSE)
else(EXISTS "${CMAKE_SOURCE_DIR}/plugins/zerospu2" AND SOUNDTOUCH_FOUND AND ALSA_FOUND)
else()
set(zerospu2 FALSE)
message(STATUS "Skip build of zerospu2: miss some dependencies")
message(STATUS "${msg_dep_zerospu2}")
endif(EXISTS "${CMAKE_SOURCE_DIR}/plugins/zerospu2" AND SOUNDTOUCH_FOUND AND ALSA_FOUND)
endif()
#---------------------------------------
#---------------------------------------