diff --git a/.ycm_extra_conf.py b/.ycm_extra_conf.py index e335358d5d..cbda75bb1f 100644 --- a/.ycm_extra_conf.py +++ b/.ycm_extra_conf.py @@ -42,7 +42,7 @@ flags = [ '-DNDEBUG', '-Iext/native', '-Iext/native/ext', -'-Iext/native/ext/glew', +'-Iext/glew', '-ICommon', # THIS IS IMPORTANT! Without a "-std=" flag, clang won't know which # language to use when compiling headers. So it will guess. Badly. So C++ diff --git a/CMakeLists.txt b/CMakeLists.txt index c81809a5d8..39318dd94b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -115,7 +115,7 @@ if(NOT OPENGL_LIBRARIES AND USING_GLES2) endif() if(NOT OPENGL_LIBRARIES) - include(FindOpenGL REQUIRED) + find_package(OpenGL REQUIRED) endif() find_package(SDL2) @@ -364,19 +364,7 @@ if(TARGET SDL2::SDL2) endif() if(NOT USING_GLES2) - include_directories(${OPENGL_INCLUDE_DIR}) - find_package(GLEW) - if(NOT GLEW_FOUND) - add_definitions(-DGLEW_STATIC) - add_library(glew STATIC - ext/native/ext/glew/GL/glew.h - ext/native/ext/glew/GL/glxew.h - ext/native/ext/glew/GL/wglew.h - ext/native/ext/glew/glew.c) - target_link_libraries(glew ${OPENGL_LIBRARIES}) - include_directories(ext/native/ext/glew) - set(GLEW_LIBRARIES glew) - endif() + add_subdirectory(ext/glew) else() find_package(X11) endif() @@ -1061,7 +1049,10 @@ if(ANDROID) SET(ATOMIC_LIB atomic) endif() -target_link_libraries(native ${LIBZIP_LIBRARY} ${ZLIB_LIBRARY} ${PNG_LIBRARY} rg_etc1 vjson snappy udis86 ${RT_LIB} ${GLEW_LIBRARIES} ${nativeExtraLibs} ${ATOMIC_LIB}) +target_link_libraries(native ${LIBZIP_LIBRARY} ${ZLIB_LIBRARY} ${PNG_LIBRARY} rg_etc1 vjson snappy udis86 ${RT_LIB} ${nativeExtraLibs} ${ATOMIC_LIB}) +if(TARGET glew) + target_link_libraries(native glew) +endif() if(ANDROID) target_link_libraries(native log EGL OpenSLES) @@ -1664,7 +1655,7 @@ add_library(${CoreLibName} ${CoreLinkType} ${GPU_SOURCES} Globals.h git-version.cpp - ext/disarm.cpp + ext/disarm.cpp git-version.cpp) if(ANDROID) @@ -1675,7 +1666,7 @@ if(ANDROID) endif() target_link_libraries(${CoreLibName} Common native kirk cityhash sfmt19937 xbrz xxhash glslang - ${CoreExtraLibs} ${GLEW_LIBRARIES} ${OPENGL_LIBRARIES} ${X11_LIBRARIES} ${CMAKE_DL_LIBS}) + ${CoreExtraLibs} ${OPENGL_LIBRARIES} ${X11_LIBRARIES} ${CMAKE_DL_LIBS}) setup_target_project(${CoreLibName} Core) diff --git a/Core/Core.vcxproj b/Core/Core.vcxproj index f5afe70279..1a5f1a465b 100644 --- a/Core/Core.vcxproj +++ b/Core/Core.vcxproj @@ -68,7 +68,7 @@ Level3 - ..\ffmpeg\WindowsInclude;..\ffmpeg\Windows\x86\include;../common;..;../ext/native;../ext/native/ext/glew;../ext/zlib;../ext/native/ext + ..\ffmpeg\WindowsInclude;..\ffmpeg\Windows\x86\include;../common;..;../ext/native;../ext/glew;../ext/zlib;../ext/native/ext _CRTDBG_MAP_ALLOC;USING_WIN_UI;_CRT_SECURE_NO_WARNINGS;USE_FFMPEG;WIN32;_ARCH_32=1;_M_IX86=1;_DEBUG;_LIB;_UNICODE;UNICODE;%(PreprocessorDefinitions) StreamingSIMDExtensions2 Fast @@ -90,7 +90,7 @@ Level3 - ..\ffmpeg\WindowsInclude;..\ffmpeg\Windows\x86_64\include;../common;..;../ext/native;../ext/native/ext/glew;../ext/zlib;../ext/native/ext + ..\ffmpeg\WindowsInclude;..\ffmpeg\Windows\x86_64\include;../common;..;../ext/native;../ext/glew;../ext/zlib;../ext/native/ext _CRTDBG_MAP_ALLOC;USING_WIN_UI;_CRT_SECURE_NO_WARNINGS;USE_FFMPEG;WIN32;_ARCH_64=1;_M_X64=1;_DEBUG;_LIB;_UNICODE;UNICODE;%(PreprocessorDefinitions) NotSet Fast @@ -116,7 +116,7 @@ MaxSpeed true true - ..\ffmpeg\WindowsInclude;..\ffmpeg\Windows\x86\include;../common;..;../ext/native;../ext/native/ext/glew;../ext/zlib;../ext/native/ext + ..\ffmpeg\WindowsInclude;..\ffmpeg\Windows\x86\include;../common;..;../ext/native;../ext/glew;../ext/zlib;../ext/native/ext false StreamingSIMDExtensions2 Fast @@ -146,7 +146,7 @@ MaxSpeed true true - ..\ffmpeg\WindowsInclude;..\ffmpeg\Windows\x86_64\include;../common;..;../ext/native;../ext/native/ext/glew;../ext/zlib;../ext/native/ext + ..\ffmpeg\WindowsInclude;..\ffmpeg\Windows\x86_64\include;../common;..;../ext/native;../ext/glew;../ext/zlib;../ext/native/ext NotSet Fast false diff --git a/GPU/GPU.vcxproj b/GPU/GPU.vcxproj index 5b49067da8..94b56fbea7 100644 --- a/GPU/GPU.vcxproj +++ b/GPU/GPU.vcxproj @@ -83,7 +83,7 @@ Level3 - ../common;..;../ext;../ext/native;../ext/native/ext/glew; + ../common;..;../ext;../ext/native;../ext/glew; _CRTDBG_MAP_ALLOC;USING_WIN_UI;_CRT_SECURE_NO_WARNINGS;WIN32;_ARCH_32=1;_M_IX86=1;_DEBUG;_LIB;_UNICODE;UNICODE;%(PreprocessorDefinitions) StreamingSIMDExtensions2 Fast @@ -105,7 +105,7 @@ Level3 - ../common;..;../ext;../ext/native;../ext/native/ext/glew; + ../common;..;../ext;../ext/native;../ext/glew; NotSet Fast false @@ -131,7 +131,7 @@ MaxSpeed true true - ../common;..;../ext;../ext/native;../ext/native/ext/glew; + ../common;..;../ext;../ext/native;../ext/glew; false StreamingSIMDExtensions2 Fast @@ -157,7 +157,7 @@ MaxSpeed true true - ../common;..;../ext;../ext/native;../ext/native/ext/glew; + ../common;..;../ext;../ext/native;../ext/glew; false NotSet Fast diff --git a/UI/UI.vcxproj b/UI/UI.vcxproj index 15093677a8..d5116f5c23 100644 --- a/UI/UI.vcxproj +++ b/UI/UI.vcxproj @@ -132,7 +132,7 @@ Level3 _CRTDBG_MAP_ALLOC;USING_WIN_UI;_CRT_SECURE_NO_WARNINGS;_ARCH_32=1;WIN32;_DEBUG;_LIB;_UNICODE;UNICODE;%(PreprocessorDefinitions) - ../common;..;../ext/native;../ext/native/ext/glew;../ext/zlib;../ext/native/ext + ../common;..;../ext/native;../ext/glew;../ext/zlib;../ext/native/ext true false false @@ -155,7 +155,7 @@ Level3 _CRTDBG_MAP_ALLOC;USING_WIN_UI;_CRT_SECURE_NO_WARNINGS;_ARCH_64=1;WIN32;_DEBUG;_LIB;_UNICODE;UNICODE;%(PreprocessorDefinitions) - ../common;..;../ext/native;../ext/native/ext/glew;../ext/zlib;../ext/native/ext + ../common;..;../ext/native;../ext/glew;../ext/zlib;../ext/native/ext true false false @@ -182,7 +182,7 @@ true true USING_WIN_UI;_CRT_SECURE_NO_WARNINGS;_ARCH_32=1;WIN32;NDEBUG;_LIB;_UNICODE;UNICODE;%(PreprocessorDefinitions) - ../common;..;../ext/native;../ext/native/ext/glew;../ext/zlib;../ext/native/ext + ../common;..;../ext/native;../ext/glew;../ext/zlib;../ext/native/ext false Speed true @@ -209,7 +209,7 @@ true true USING_WIN_UI;_CRT_SECURE_NO_WARNINGS;_ARCH_64=1;WIN32;NDEBUG;_LIB;_UNICODE;UNICODE;%(PreprocessorDefinitions) - ../common;..;../ext/native;../ext/native/ext/glew;../ext/zlib;../ext/native/ext + ../common;..;../ext/native;../ext/glew;../ext/zlib;../ext/native/ext false true false diff --git a/Windows/PPSSPP.vcxproj b/Windows/PPSSPP.vcxproj index 33bea34b30..41eb13d2f5 100644 --- a/Windows/PPSSPP.vcxproj +++ b/Windows/PPSSPP.vcxproj @@ -124,7 +124,7 @@ Use Level3 ProgramDatabase - ../ext;../common;..;../ext/native;../ext/native/ext/glew;../ext/zlib + ../ext;../common;..;../ext/native;../ext/glew;../ext/zlib stdafx.h;Common/DbgNew.h MultiThreadedDebug StreamingSIMDExtensions2 @@ -160,7 +160,7 @@ Use Level3 ProgramDatabase - ../ext;../common;..;../ext/native;../ext/native/ext/glew;../ext/zlib + ../ext;../common;..;../ext/native;../ext/glew;../ext/zlib stdafx.h;Common/DbgNew.h MultiThreadedDebug false @@ -199,7 +199,7 @@ Use Level3 ProgramDatabase - ../ext;../common;..;../ext/native;../ext/native/ext/glew;../ext/zlib + ../ext;../common;..;../ext/native;../ext/glew;../ext/zlib stdafx.h stdafx.h true @@ -244,7 +244,7 @@ Use Level3 ProgramDatabase - ../ext;../common;..;../ext/native;../ext/native/ext/glew;../ext/zlib + ../ext;../common;..;../ext/native;../ext/glew;../ext/zlib stdafx.h true false @@ -279,7 +279,7 @@ true - + NotUsing diff --git a/Windows/PPSSPP.vcxproj.filters b/Windows/PPSSPP.vcxproj.filters index e062f0b744..ba19036339 100644 --- a/Windows/PPSSPP.vcxproj.filters +++ b/Windows/PPSSPP.vcxproj.filters @@ -145,7 +145,7 @@ Windows\GE Debugger - + Windows\UI @@ -446,4 +446,4 @@ Resource Files - \ No newline at end of file + diff --git a/ext/glew/CMakeLists.txt b/ext/glew/CMakeLists.txt new file mode 100644 index 0000000000..5e5a9df970 --- /dev/null +++ b/ext/glew/CMakeLists.txt @@ -0,0 +1,13 @@ +find_package(GLEW) +if(NOT GLEW_FOUND) + find_package(OpenGL REQUIRED) + add_library(glew STATIC + GL/glew.h + GL/glxew.h + GL/wglew.h + glew.c + ) + target_link_libraries(glew PUBLIC ${OPENGL_LIBRARIES}) + target_compile_definitions(glew PUBLIC GLEW_STATIC) + target_include_directories(glew PUBLIC . ${OPENGL_INCLUDE_DIR}) +endif() diff --git a/ext/native/ext/glew/GL/glew.h b/ext/glew/GL/glew.h similarity index 100% rename from ext/native/ext/glew/GL/glew.h rename to ext/glew/GL/glew.h diff --git a/ext/native/ext/glew/GL/glxew.h b/ext/glew/GL/glxew.h similarity index 100% rename from ext/native/ext/glew/GL/glxew.h rename to ext/glew/GL/glxew.h diff --git a/ext/native/ext/glew/GL/wglew.h b/ext/glew/GL/wglew.h similarity index 100% rename from ext/native/ext/glew/GL/wglew.h rename to ext/glew/GL/wglew.h diff --git a/ext/native/ext/glew/glew.c b/ext/glew/glew.c similarity index 100% rename from ext/native/ext/glew/glew.c rename to ext/glew/glew.c diff --git a/ext/native/ext/glew/glewinfo.c b/ext/glew/glewinfo.c similarity index 100% rename from ext/native/ext/glew/glewinfo.c rename to ext/glew/glewinfo.c diff --git a/ext/native/ext/glew/visualinfo.c b/ext/glew/visualinfo.c similarity index 100% rename from ext/native/ext/glew/visualinfo.c rename to ext/glew/visualinfo.c diff --git a/ext/native/native.vcxproj b/ext/native/native.vcxproj index 725020c74a..6dd2ba5a32 100644 --- a/ext/native/native.vcxproj +++ b/ext/native/native.vcxproj @@ -79,7 +79,7 @@ Level3 _CRTDBG_MAP_ALLOC;_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) - ..\..\ext;..\..;..\..\dx9sdk\Include;..\zlib;..\ext\zlib;..\native;..\RollerballGL;..\native\ext\glew;..\SDL\include;..\native\ext;%(AdditionalIncludeDirectories); + ..\..\ext;..\..;..\..\dx9sdk\Include;..\zlib;..\ext\zlib;..\native;..\RollerballGL;..\glew;..\SDL\include;..\native\ext;%(AdditionalIncludeDirectories); ProgramDatabase true false @@ -101,7 +101,7 @@ Level3 _CRTDBG_MAP_ALLOC;_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) - ..\..\ext;..\..;..\..\dx9sdk\Include;..\zlib;..\ext\zlib;..\native;..\RollerballGL;..\native\ext\glew;..\SDL\include;..\native\ext;%(AdditionalIncludeDirectories); + ..\..\ext;..\..;..\..\dx9sdk\Include;..\zlib;..\ext\zlib;..\native;..\RollerballGL;..\glew;..\SDL\include;..\native\ext;%(AdditionalIncludeDirectories); true false false @@ -127,7 +127,7 @@ true true WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) - ..\..\ext;..\..;..\..\dx9sdk\Include;..\zlib;..\ext\zlib;..\native;..\RollerballGL;..\native\ext\glew;..\SDL\include;..\native\ext;%(AdditionalIncludeDirectories); + ..\..\ext;..\..;..\..\dx9sdk\Include;..\zlib;..\ext\zlib;..\native;..\RollerballGL;..\glew;..\SDL\include;..\native\ext;%(AdditionalIncludeDirectories); StreamingSIMDExtensions2 Fast true @@ -153,7 +153,7 @@ true true WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) - ..\..\ext;..\..;..\..\dx9sdk\Include;..\zlib;..\ext\zlib;..\native;..\RollerballGL;..\native\ext\glew;..\SDL\include;..\native\ext;%(AdditionalIncludeDirectories); + ..\..\ext;..\..;..\..\dx9sdk\Include;..\zlib;..\ext\zlib;..\native;..\RollerballGL;..\glew;..\SDL\include;..\native\ext;%(AdditionalIncludeDirectories); NotSet Fast true diff --git a/headless/Headless.vcxproj b/headless/Headless.vcxproj index ce1048f8be..90a93f0578 100644 --- a/headless/Headless.vcxproj +++ b/headless/Headless.vcxproj @@ -91,7 +91,7 @@ NotUsing Level3 _CRTDBG_MAP_ALLOC;USING_WIN_UI;GLEW_STATIC;_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_ARCH_32=1;_CONSOLE;_UNICODE;UNICODE;%(PreprocessorDefinitions);_CRT_SECURE_NO_WARNINGS - ../Common;..;../Core;../ext/native/ext/glew;../ext/native + ../Common;..;../Core;../ext/glew;../ext/native Default StreamingSIMDExtensions2 Fast @@ -123,7 +123,7 @@ NotUsing Level3 _CRTDBG_MAP_ALLOC;USING_WIN_UI;GLEW_STATIC;_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_ARCH_64=1;_CONSOLE;_UNICODE;UNICODE;%(PreprocessorDefinitions) - ../Common;..;../Core;../ext/native/ext/glew;../ext/native + ../Common;..;../Core;../ext/glew;../ext/native NotSet Fast false @@ -158,7 +158,7 @@ true true USING_WIN_UI;GLEW_STATIC;_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_ARCH_32=1;_CONSOLE;_UNICODE;UNICODE;%(PreprocessorDefinitions);_CRT_SECURE_NO_WARNINGS - ../Common;..;../Core;../ext/native/ext/glew;../ext/native + ../Common;..;../Core;../ext/glew;../ext/native false StreamingSIMDExtensions2 Fast @@ -193,7 +193,7 @@ true true USING_WIN_UI;GLEW_STATIC;_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_ARCH_64=1;_CONSOLE;_UNICODE;UNICODE;%(PreprocessorDefinitions) - ../Common;..;../Core;../ext/native/ext/glew;../ext/native + ../Common;..;../Core;../ext/glew;../ext/native false NotSet Fast @@ -223,7 +223,7 @@ - + @@ -272,4 +272,4 @@ - \ No newline at end of file + diff --git a/headless/Headless.vcxproj.filters b/headless/Headless.vcxproj.filters index 65c3c90c80..97d9382999 100644 --- a/headless/Headless.vcxproj.filters +++ b/headless/Headless.vcxproj.filters @@ -3,7 +3,7 @@ - + Windows @@ -36,4 +36,4 @@ {28215e85-3e11-4a8a-8b4d-3e355b85a542} - \ No newline at end of file + diff --git a/unittest/UnitTests.vcxproj b/unittest/UnitTests.vcxproj index 0ea78b3d12..a5b9feec93 100644 --- a/unittest/UnitTests.vcxproj +++ b/unittest/UnitTests.vcxproj @@ -88,7 +88,7 @@ Level3 _CRTDBG_MAP_ALLOC;USING_WIN_UI;USING_WIN_UI;GLEW_STATIC;_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_ARCH_32=1;_WINDOWS;_UNICODE;UNICODE;%(PreprocessorDefinitions) - ../ext;../common;..;../ext/native;../ext/native/ext/glew;../ext/zlib + ../ext;../common;..;../ext/native;../ext/glew;../ext/zlib true false false @@ -110,7 +110,7 @@ Level3 _CRTDBG_MAP_ALLOC;USING_WIN_UI;GLEW_STATIC;_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_ARCH_64=1;_WINDOWS;_UNICODE;UNICODE;%(PreprocessorDefinitions) - ../ext;../common;..;../ext/native;../ext/native/ext/glew;../ext/zlib + ../ext;../common;..;../ext/native;../ext/glew;../ext/zlib true false false @@ -136,7 +136,7 @@ true true USING_WIN_UI;GLEW_STATIC;_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_ARCH_32=1;_WINDOWS;_UNICODE;UNICODE;%(PreprocessorDefinitions) - ../ext;../common;..;../ext/native;../ext/native/ext/glew;../ext/zlib + ../ext;../common;..;../ext/native;../ext/glew;../ext/zlib false Speed true @@ -162,7 +162,7 @@ true true USING_WIN_UI;GLEW_STATIC;_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_ARCH_64=1;_WINDOWS;_UNICODE;UNICODE;%(PreprocessorDefinitions) - ../ext;../common;..;../ext/native;../ext/native/ext/glew;../ext/zlib + ../ext;../common;..;../ext/native;../ext/glew;../ext/zlib false true false @@ -180,7 +180,7 @@ - + diff --git a/unittest/UnitTests.vcxproj.filters b/unittest/UnitTests.vcxproj.filters index cb4d15d536..a92e8e080c 100644 --- a/unittest/UnitTests.vcxproj.filters +++ b/unittest/UnitTests.vcxproj.filters @@ -7,11 +7,11 @@ - + - \ No newline at end of file +