diff --git a/cmake/BuildParameters.cmake b/cmake/BuildParameters.cmake index fdec78b868..a62123fba7 100644 --- a/cmake/BuildParameters.cmake +++ b/cmake/BuildParameters.cmake @@ -82,6 +82,40 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") message(STATUS "Building with Clang/LLVM.") endif() +#------------------------------------------------------------------------------- +# Select the support of plugin +#------------------------------------------------------------------------------- +option(BUILTIN_GS "Disable support of GS plugin (developer option)") +option(BUILTIN_PAD "Disable support of PAD plugin (developer option)") +option(BUILTIN_SPU2 "Disable support of SPU2 plugin (developer option)") +option(BUILTIN_USB "Disable support of USB plugin (developer option)") +option(BUILTIN_FW "Disable support of FW plugin (developer option)") +option(BUILTIN_DEV9 "Disable support of DEV9 plugin (developer option)") +option(BUILTIN_CDVD "Disable support of CDVD plugin (developer option)") + +set(PLUGIN_SUPPORT "") +if(BUILTIN_GS) + set(PLUGIN_SUPPORT "${PLUGIN_SUPPORT} -DBUILTIN_GS_PLUGIN") +endif() +if(BUILTIN_PAD) + set(PLUGIN_SUPPORT "${PLUGIN_SUPPORT} -DBUILTIN_PAD_PLUGIN") +endif() +if(BUILTIN_SPU2) + set(PLUGIN_SUPPORT "${PLUGIN_SUPPORT} -DBUILTIN_SPU2_PLUGIN") +endif() +if(BUILTIN_USB) + set(PLUGIN_SUPPORT "${PLUGIN_SUPPORT} -DBUILTIN_USB_PLUGIN") +endif() +if(BUILTIN_FW) + set(PLUGIN_SUPPORT "${PLUGIN_SUPPORT} -DBUILTIN_FW_PLUGIN") +endif() +if(BUILTIN_DEV) + set(PLUGIN_SUPPORT "${PLUGIN_SUPPORT} -DBUILTIN_DEV_PLUGIN") +endif() +if(BUILTIN_CDVD) + set(PLUGIN_SUPPORT "${PLUGIN_SUPPORT} -DBUILTIN_CDVD_PLUGIN") +endif() + #------------------------------------------------------------------------------- # Select the architecture #------------------------------------------------------------------------------- @@ -312,7 +346,7 @@ else() endif() # Note: -DGTK_DISABLE_DEPRECATED can be used to test a build without gtk deprecated feature. It could be useful to port to a newer API -set(DEFAULT_GCC_FLAG "${ARCH_FLAG} ${COMMON_FLAG} ${DEFAULT_WARNINGS} ${AGGRESSIVE_WARNING} ${HARDENING_FLAG} ${DEBUG_FLAG} ${ASAN_FLAG} ${OPTIMIZATION_FLAG} ${LTO_FLAGS}") +set(DEFAULT_GCC_FLAG "${ARCH_FLAG} ${COMMON_FLAG} ${DEFAULT_WARNINGS} ${AGGRESSIVE_WARNING} ${HARDENING_FLAG} ${DEBUG_FLAG} ${ASAN_FLAG} ${OPTIMIZATION_FLAG} ${LTO_FLAGS} ${PLUGIN_SUPPORT}") # c++ only flags set(DEFAULT_CPP_FLAG "${DEFAULT_GCC_FLAG} -std=c++11 -Wno-invalid-offsetof") diff --git a/pcsx2/CMakeLists.txt b/pcsx2/CMakeLists.txt index 5aa6406ac0..40cf529f0b 100644 --- a/pcsx2/CMakeLists.txt +++ b/pcsx2/CMakeLists.txt @@ -630,6 +630,28 @@ set(pcsx2FinalLibs ${GCOV_LIBRARIES} ) +if(BUILTIN_GS) + set(pcsx2FinalLibs "${pcsx2FinalLibs} GSdx-1.0.0") +endif() +if(BUILTIN_PAD) + set(pcsx2FinalLibs "${pcsx2FinalLibs} onepad-1.2.0") +endif() +if(BUILTIN_SPU2) + set(pcsx2FinalLibs "${pcsx2FinalLibs} spu2x-2.0.0") +endif() +if(BUILTIN_USB) + set(pcsx2FinalLibs "${pcsx2FinalLibs} USBnull-0.7.0") +endif() +if(BUILTIN_FW) + set(pcsx2FinalLibs "${pcsx2FinalLibs} FWnull-0.7.0") +endif() +if(BUILTIN_DEV) + set(pcsx2FinalLibs "${pcsx2FinalLibs} dev9null-0.5.0") +endif() +if(BUILTIN_CDVD) + set(pcsx2FinalLibs "${pcsx2FinalLibs} CDVDnull") +endif() + # additonal include directories include_directories( gui diff --git a/plugins/FWnull/CMakeLists.txt b/plugins/FWnull/CMakeLists.txt index aaf9e4e3a8..ce2eb570ff 100644 --- a/plugins/FWnull/CMakeLists.txt +++ b/plugins/FWnull/CMakeLists.txt @@ -50,4 +50,8 @@ set(FWnullFinalLibs ${GTK2_LIBRARIES} ) -add_pcsx2_plugin(${Output} "${FWnullFinalSources}" "${FWnullFinalLibs}" "${FWnullFinalFlags}") +if(BUILTIN_FW) + add_pcsx2_lib(${Output} "${FWnullFinalSources}" "${FWnullFinalLibs}" "${FWnullFinalFlags}") +else() + add_pcsx2_plugin(${Output} "${FWnullFinalSources}" "${FWnullFinalLibs}" "${FWnullFinalFlags}") +endif() diff --git a/plugins/GSdx/CMakeLists.txt b/plugins/GSdx/CMakeLists.txt index 7309ac7d9a..20cbd9e61b 100644 --- a/plugins/GSdx/CMakeLists.txt +++ b/plugins/GSdx/CMakeLists.txt @@ -211,7 +211,11 @@ if (REBUILD_SHADER) add_custom_command(OUTPUT res/glsl_source.h COMMAND perl ${CMAKE_SOURCE_DIR}/linux_various/glsl2h.pl) endif() -add_pcsx2_plugin(${Output} "${GSdxFinalSources}" "${GSdxFinalLibs}" "${GSdxFinalFlags}") +if(BUILTIN_GS) + add_pcsx2_lib(${Output} "${GSdxFinalSources}" "${GSdxFinalLibs}" "${GSdxFinalFlags}") +else() + add_pcsx2_plugin(${Output} "${GSdxFinalSources}" "${GSdxFinalLibs}" "${GSdxFinalFlags}") +endif() ################################### Replay Loader if(BUILD_REPLAY_LOADERS) diff --git a/plugins/USBnull/CMakeLists.txt b/plugins/USBnull/CMakeLists.txt index 7892d03ed8..fd6a6bb5e4 100644 --- a/plugins/USBnull/CMakeLists.txt +++ b/plugins/USBnull/CMakeLists.txt @@ -50,4 +50,8 @@ set(USBnullFinalLibs ${GTK2_LIBRARIES} ) -add_pcsx2_plugin(${Output} "${USBnullFinalSources}" "${USBnullFinalLibs}" "${USBnullFinalFlags}") +if(BUILTIN_USB) + add_pcsx2_lib(${Output} "${USBnullFinalSources}" "${USBnullFinalLibs}" "${USBnullFinalFlags}") +else() + add_pcsx2_plugin(${Output} "${USBnullFinalSources}" "${USBnullFinalLibs}" "${USBnullFinalFlags}") +endif() diff --git a/plugins/dev9null/CMakeLists.txt b/plugins/dev9null/CMakeLists.txt index b819985218..1fb0a3e7b5 100644 --- a/plugins/dev9null/CMakeLists.txt +++ b/plugins/dev9null/CMakeLists.txt @@ -47,4 +47,8 @@ set(dev9nullFinalLibs ${GTK2_LIBRARIES} ) -add_pcsx2_plugin(${Output} "${dev9nullFinalSources}" "${dev9nullFinalLibs}" "${dev9nullFinalFlags}") +if(BUILTIN_DEV9) + add_pcsx2_lib(${Output} "${dev9nullFinalSources}" "${dev9nullFinalLibs}" "${dev9nullFinalFlags}") +else() + add_pcsx2_plugin(${Output} "${dev9nullFinalSources}" "${dev9nullFinalLibs}" "${dev9nullFinalFlags}") +endif() diff --git a/plugins/onepad/CMakeLists.txt b/plugins/onepad/CMakeLists.txt index c7e40beafe..46ed79e2e2 100644 --- a/plugins/onepad/CMakeLists.txt +++ b/plugins/onepad/CMakeLists.txt @@ -126,4 +126,8 @@ foreach(result_file IN ITEMS COMMAND perl ${CMAKE_SOURCE_DIR}/linux_various/hex2h.pl "${image_sources}/${result_file}.png" "${compiled_images}/${result_file}" ) endforeach() -add_pcsx2_plugin(${Output} "${onepadFinalSources}" "${onepadFinalLibs}" "${onepadFinalFlags}") +if(BUILTIN_PAD) + add_pcsx2_lib(${Output} "${onepadFinalSources}" "${onepadFinalLibs}" "${onepadFinalFlags}") +else() + add_pcsx2_plugin(${Output} "${onepadFinalSources}" "${onepadFinalLibs}" "${onepadFinalFlags}") +endif() diff --git a/plugins/spu2-x/src/CMakeLists.txt b/plugins/spu2-x/src/CMakeLists.txt index 942dc6b363..cadb90f946 100644 --- a/plugins/spu2-x/src/CMakeLists.txt +++ b/plugins/spu2-x/src/CMakeLists.txt @@ -114,4 +114,8 @@ else() ) endif() -add_pcsx2_plugin(${Output} "${spu2xFinalSources}" "${spu2xFinalLibs}" "${spu2xFinalFlags}") +if(BUILTIN_SPU2) + add_pcsx2_lib(${Output} "${spu2xFinalSources}" "${spu2xFinalLibs}" "${spu2xFinalFlags}") +else() + add_pcsx2_plugin(${Output} "${spu2xFinalSources}" "${spu2xFinalLibs}" "${spu2xFinalFlags}") +endif()