From e1d6dc27ec013dfecde942c7690432925ce3e23a Mon Sep 17 00:00:00 2001 From: Egor Yusov Date: Thu, 13 Dec 2018 23:28:05 -0800 Subject: Fixed MinGW build --- Tests/TestApp/CMakeLists.txt | 57 +++++++++++++++++-------------------------- Tests/TestApp/src/TestApp.cpp | 9 ++++++- 2 files changed, 31 insertions(+), 35 deletions(-) (limited to 'Tests/TestApp') diff --git a/Tests/TestApp/CMakeLists.txt b/Tests/TestApp/CMakeLists.txt index d88fa39..c87fb03 100644 --- a/Tests/TestApp/CMakeLists.txt +++ b/Tests/TestApp/CMakeLists.txt @@ -125,45 +125,34 @@ if(MSVC) endif() endif() + if(PLATFORM_WIN32) - SET(ENGINE_LIBRARIES - GraphicsEngineD3D11-shared - GraphicsEngineOpenGL-shared - ) - if(D3D12_SUPPORTED) - list(APPEND ENGINE_LIBRARIES GraphicsEngineD3D12-shared) - endif() - if(VULKAN_SUPPORTED) - list(APPEND ENGINE_LIBRARIES GraphicsEngineVk-shared) - endif() -elseif(PLATFORM_ANDROID) - SET(ENGINE_LIBRARIES - GraphicsEngineOpenGL-shared - ) -elseif(PLATFORM_UNIVERSAL_WINDOWS) - SET(ENGINE_LIBRARIES - GraphicsEngineD3D11-static - GraphicsEngineD3D12-static - ) -elseif(PLATFORM_LINUX) - SET(ENGINE_LIBRARIES - GraphicsEngineOpenGL-shared - ) - if(VULKAN_SUPPORTED) - list(APPEND ENGINE_LIBRARIES GraphicsEngineVk-shared) - endif() -elseif(PLATFORM_MACOS) - SET(ENGINE_LIBRARIES - GraphicsEngineOpenGL-shared - ) -elseif(PLATFORM_IOS) - SET(ENGINE_LIBRARIES - GraphicsEngineOpenGL-static - ) + if(MSVC) + set(LIB_TYPE "shared") + else() + set(LIB_TYPE "static") + endif() +elseif(PLATFORM_LINUX OR PLATFORM_ANDROID OR PLATFORM_MACOS) + set(LIB_TYPE "shared") +elseif(PLATFORM_UNIVERSAL_WINDOWS OR PLATFORM_IOS) + set(LIB_TYPE "static") else() message(FATAL_ERROR "Undefined platform") endif() +if(D3D11_SUPPORTED) + list(APPEND ENGINE_LIBRARIES GraphicsEngineD3D11-${LIB_TYPE}) +endif() +if(D3D12_SUPPORTED) + list(APPEND ENGINE_LIBRARIES GraphicsEngineD3D12-${LIB_TYPE}) +endif() +if(GL_SUPPORTED OR GLES_SUPPORTED) + list(APPEND ENGINE_LIBRARIES GraphicsEngineOpenGL-${LIB_TYPE}) +endif() +if(VULKAN_SUPPORTED) + list(APPEND ENGINE_LIBRARIES GraphicsEngineVk-${LIB_TYPE}) +endif() + target_link_libraries(TestApp PRIVATE BuildSettings diff --git a/Tests/TestApp/src/TestApp.cpp b/Tests/TestApp/src/TestApp.cpp index 9fc9802..f0fbb08 100644 --- a/Tests/TestApp/src/TestApp.cpp +++ b/Tests/TestApp/src/TestApp.cpp @@ -596,8 +596,15 @@ void TestApp::ProcessCommandLine(const char *CmdLine) } else { - LOG_INFO_MESSAGE("Device type is not specified. Using D3D11 device"); +#if D3D12_SUPPORTED + m_DeviceType = DeviceType::D3D12; +#elif VULKAN_SUPPORTED + m_DeviceType = DeviceType::Vulkan; +#elif D3D11_SUPPORTED m_DeviceType = DeviceType::D3D11; +#elif GL_SUPPORTED || GLES_SUPPORTED + m_DeviceType = DeviceType::OpenGL; +#endif } switch (m_DeviceType) -- cgit v1.2.3