diff options
| author | Egor Yusov <egor.yusov@gmail.com> | 2017-12-16 05:23:06 +0000 |
|---|---|---|
| committer | Egor Yusov <egor.yusov@gmail.com> | 2017-12-16 05:23:06 +0000 |
| commit | 035dd284b70429c7a59237c1e6debc1663bd7e15 (patch) | |
| tree | b2d50e6c0141bfb8c403010831036799ac657411 /Graphics/GraphicsEngineOpenGL | |
| parent | Updated CMakeLists (diff) | |
| download | DiligentCore-035dd284b70429c7a59237c1e6debc1663bd7e15.tar.gz DiligentCore-035dd284b70429c7a59237c1e6debc1663bd7e15.zip | |
CMake: enabling Android build
Diffstat (limited to 'Graphics/GraphicsEngineOpenGL')
| -rw-r--r-- | Graphics/GraphicsEngineOpenGL/CMakeLists.txt | 16 | ||||
| -rw-r--r-- | Graphics/GraphicsEngineOpenGL/include/VAOCache.h | 3 |
2 files changed, 14 insertions, 5 deletions
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 <cstring> #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; } }; |
