From 26cc27e45f811ec48993b13c398af324a842e0f0 Mon Sep 17 00:00:00 2001 From: Egor Yusov Date: Sat, 9 Dec 2017 22:46:45 -0800 Subject: Updated cmake lists: enabled link-time code generation for MSVC --- Graphics/GraphicsEngineD3D11/CMakeLists.txt | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'Graphics/GraphicsEngineD3D11') diff --git a/Graphics/GraphicsEngineD3D11/CMakeLists.txt b/Graphics/GraphicsEngineD3D11/CMakeLists.txt index 2d77b3c7..596515a0 100644 --- a/Graphics/GraphicsEngineD3D11/CMakeLists.txt +++ b/Graphics/GraphicsEngineD3D11/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required (VERSION 3.3) -project(GraphicsEngineD3D11) +project(GraphicsEngineD3D11 CXX) set(INCLUDE @@ -90,6 +90,21 @@ set_target_properties(GraphicsEngineD3D11-shared PROPERTIES OUTPUT_NAME_MINSIZEREL GraphicsEngineD3D11${DLL_REL_SUFFIX} ) +if(MSVC) + # Enable link-time code generation for release builds (I was not able to + # find any way to set these settings through interface library BuildSettings) + set_target_properties(GraphicsEngineD3D11-shared PROPERTIES + LINK_FLAGS_RELEASE /LTCG + LINK_FLAGS_MINSIZEREL /LTCG + LINK_FLAGS_RELWITHDEBINFO /LTCG + ) + set_target_properties(GraphicsEngineD3D11-static PROPERTIES + STATIC_LIBRARY_FLAGS_RELEASE /LTCG + STATIC_LIBRARY_FLAGS_MINSIZEREL /LTCG + STATIC_LIBRARY_FLAGS_RELWITHDEBINFO /LTCG + ) +endif() + target_include_directories(GraphicsEngineD3D11-static PUBLIC interface -- cgit v1.2.3