From 035dd284b70429c7a59237c1e6debc1663bd7e15 Mon Sep 17 00:00:00 2001 From: Egor Yusov Date: Fri, 15 Dec 2017 21:23:06 -0800 Subject: CMake: enabling Android build --- Graphics/GraphicsEngineOpenGL/CMakeLists.txt | 16 ++++++++++++---- Graphics/GraphicsEngineOpenGL/include/VAOCache.h | 3 ++- 2 files changed, 14 insertions(+), 5 deletions(-) (limited to 'Graphics/GraphicsEngineOpenGL') diff --git a/Graphics/GraphicsEngineOpenGL/CMakeLists.txt b/Graphics/GraphicsEngineOpenGL/CMakeLists.txt index bf046937..bb257613 100644 --- a/Graphics/GraphicsEngineOpenGL/CMakeLists.txt +++ b/Graphics/GraphicsEngineOpenGL/CMakeLists.txt @@ -84,7 +84,7 @@ if(PLATFORM_WIN32) list(APPEND SOURCE src/RenderDeviceGLImpl.cpp) set(APPEND INCLUDE include/GLContextWindows.h) -elseif(PLATFORM_ANRDOID) +elseif(PLATFORM_ANDROID) list(APPEND SOURCE src/GLContextAndroid.cpp) list(APPEND SOURCE src/RenderDeviceGLESImpl.cpp) list(APPEND SOURCE src/GLStubs.cpp) @@ -132,13 +132,10 @@ PRIVATE ../HLSL2GLSLConverterLib/include ) - set(PRIVATE_DEPENDENCIES BuildSettings - glew-static Common GraphicsTools - opengl32.lib TargetPlatform ) @@ -147,6 +144,17 @@ set(PUBLIC_DEPENDENCIES HLSL2GLSLConverterLib ) +if(PLATFORM_WIN32) + set(PRIVATE_DEPENDENCIES ${PRIVATE_DEPENDENCIES} glew-static opengl32.lib) +elseif(PLATFORM_ANDROID) + set(PRIVATE_DEPENDENCIES ${PRIVATE_DEPENDENCIES} GLESv3 EGL android) + target_compile_definitions(GraphicsEngineOpenGL-static PRIVATE BUILDING_DLL USE_GL3_STUB=0) + target_compile_definitions(GraphicsEngineOpenGL-shared PRIVATE BUILDING_DLL USE_GL3_STUB=0) + # LOCAL_CFLAGS := -fvisibility=hidden +else() + message(FATAL_ERROR "Unknown platform") +endif() + target_link_libraries(GraphicsEngineOpenGL-static PRIVATE ${PRIVATE_DEPENDENCIES} PUBLIC ${PUBLIC_DEPENDENCIES}) target_link_libraries(GraphicsEngineOpenGL-shared PRIVATE ${PRIVATE_DEPENDENCIES} PUBLIC ${PUBLIC_DEPENDENCIES}) target_compile_definitions(GraphicsEngineOpenGL-shared PUBLIC ENGINE_DLL) diff --git a/Graphics/GraphicsEngineOpenGL/include/VAOCache.h b/Graphics/GraphicsEngineOpenGL/include/VAOCache.h index ac469f16..cd2995c8 100644 --- a/Graphics/GraphicsEngineOpenGL/include/VAOCache.h +++ b/Graphics/GraphicsEngineOpenGL/include/VAOCache.h @@ -23,6 +23,7 @@ #pragma once +#include #include "GraphicsTypes.h" #include "Buffer.h" #include "InputLayout.h" @@ -91,7 +92,7 @@ private: return pPSO == Key.pPSO && pIndexBuffer == Key.pIndexBuffer && NumUsedSlots == Key.NumUsedSlots && - memcmp(Streams, Key.Streams, sizeof(StreamAttribs) * NumUsedSlots) == 0; + std::memcmp(Streams, Key.Streams, sizeof(StreamAttribs) * NumUsedSlots) == 0; } }; -- cgit v1.2.3