From 5cf46bc3a97cd476fbf506076f7123594410ea03 Mon Sep 17 00:00:00 2001 From: Egor Yusov Date: Thu, 13 Dec 2018 20:40:06 -0800 Subject: Another couple of updates to GL and VK backend CMake files to fix MinGW build --- Graphics/GraphicsEngineOpenGL/CMakeLists.txt | 5 ++++- Graphics/GraphicsEngineVulkan/CMakeLists.txt | 7 +++++-- 2 files changed, 9 insertions(+), 3 deletions(-) (limited to 'Graphics') diff --git a/Graphics/GraphicsEngineOpenGL/CMakeLists.txt b/Graphics/GraphicsEngineOpenGL/CMakeLists.txt index 356b7240..ab1268c3 100644 --- a/Graphics/GraphicsEngineOpenGL/CMakeLists.txt +++ b/Graphics/GraphicsEngineOpenGL/CMakeLists.txt @@ -138,7 +138,7 @@ add_library(GraphicsEngineOpenGL-static STATIC add_library(GraphicsEngineOpenGL-shared SHARED readme.md ) -if(PLATFORM_WIN32 AND MSVC) +if(MSVC) target_sources(GraphicsEngineOpenGL-shared PRIVATE src/DLLMain.cpp @@ -200,6 +200,9 @@ target_compile_definitions(GraphicsEngineOpenGL-shared PUBLIC ENGINE_DLL=1) if(PLATFORM_WIN32) + # Do not add 'lib' prefix when building with MinGW + set_target_properties(GraphicsEngineOpenGL-shared PROPERTIES PREFIX "") + # Set output name to GraphicsEngineOpenGL_{32|64}{r|d} set_dll_output_name(GraphicsEngineOpenGL-shared GraphicsEngineOpenGL) diff --git a/Graphics/GraphicsEngineVulkan/CMakeLists.txt b/Graphics/GraphicsEngineVulkan/CMakeLists.txt index 4e56087f..c5d7b78e 100644 --- a/Graphics/GraphicsEngineVulkan/CMakeLists.txt +++ b/Graphics/GraphicsEngineVulkan/CMakeLists.txt @@ -152,7 +152,7 @@ add_library(GraphicsEngineVk-shared SHARED readme.md ) -if(PLATFORM_WIN32 AND MSVC) +if(MSVC) target_sources(GraphicsEngineVk-shared PRIVATE src/DLLMain.cpp src/GraphicsEngineVk.def @@ -202,13 +202,16 @@ if(PLATFORM_WIN32) elseif(PLATFORM_LINUX) set(PRIVATE_COMPILE_DEFINITIONS VK_USE_PLATFORM_XCB_KHR=1) else() - message(FATAL_ERROR "Unknwon platform") + message(FATAL_ERROR "Unknown platform") endif() target_compile_definitions(GraphicsEngineVk-shared PRIVATE ${PRIVATE_COMPILE_DEFINITIONS}) target_compile_definitions(GraphicsEngineVk-static PRIVATE ${PRIVATE_COMPILE_DEFINITIONS}) if(PLATFORM_WIN32) + # Do not add 'lib' prefix when building with MinGW + set_target_properties(GraphicsEngineVk-shared PROPERTIES PREFIX "") + # Set output name to GraphicsEngineVk_{32|64}{r|d} set_dll_output_name(GraphicsEngineVk-shared GraphicsEngineVk) -- cgit v1.2.3