summaryrefslogtreecommitdiffstats
path: root/Graphics
diff options
context:
space:
mode:
authorEgor Yusov <egor.yusov@gmail.com>2017-12-10 06:46:45 +0000
committerEgor Yusov <egor.yusov@gmail.com>2017-12-10 06:46:45 +0000
commit26cc27e45f811ec48993b13c398af324a842e0f0 (patch)
treed6cec1e2478e8ff46ade5bf5d129f371cab5bae1 /Graphics
parentFixed tolower()-related warnings (diff)
downloadDiligentCore-26cc27e45f811ec48993b13c398af324a842e0f0.tar.gz
DiligentCore-26cc27e45f811ec48993b13c398af324a842e0f0.zip
Updated cmake lists: enabled link-time code generation for MSVC
Diffstat (limited to 'Graphics')
-rw-r--r--Graphics/GraphicsEngine/CMakeLists.txt16
-rw-r--r--Graphics/GraphicsEngineD3D11/CMakeLists.txt17
-rw-r--r--Graphics/GraphicsEngineD3D12/CMakeLists.txt18
-rw-r--r--Graphics/GraphicsEngineD3DBase/CMakeLists.txt12
-rw-r--r--Graphics/GraphicsEngineOpenGL/CMakeLists.txt15
-rw-r--r--Graphics/GraphicsTools/CMakeLists.txt10
-rw-r--r--Graphics/HLSL2GLSLConverterLib/CMakeLists.txt9
7 files changed, 90 insertions, 7 deletions
diff --git a/Graphics/GraphicsEngine/CMakeLists.txt b/Graphics/GraphicsEngine/CMakeLists.txt
index 8aed9f16..5bfd92c4 100644
--- a/Graphics/GraphicsEngine/CMakeLists.txt
+++ b/Graphics/GraphicsEngine/CMakeLists.txt
@@ -1,6 +1,6 @@
cmake_minimum_required (VERSION 3.3)
-project(GraphicsEngine)
+project(GraphicsEngine CXX)
set(INCLUDE
include/BufferBase.h
@@ -60,17 +60,25 @@ target_include_directories(GraphicsEngine
PUBLIC
include
interface
-)
-
-target_include_directories(GraphicsEngine
PRIVATE
../GraphicsTools/include
)
+
set_target_properties(GraphicsEngine PROPERTIES
FOLDER Core/Graphics
)
target_link_libraries(GraphicsEngine PRIVATE BuildSettings PlatformInterface Common)
+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(GraphicsEngine PROPERTIES
+ STATIC_LIBRARY_FLAGS_RELEASE /LTCG
+ STATIC_LIBRARY_FLAGS_MINSIZEREL /LTCG
+ STATIC_LIBRARY_FLAGS_RELWITHDEBINFO /LTCG
+ )
+endif()
+
source_group("src" FILES ${SOURCE})
source_group("include" FILES ${INCLUDE})
source_group("interface" FILES ${INTERFACE})
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
diff --git a/Graphics/GraphicsEngineD3D12/CMakeLists.txt b/Graphics/GraphicsEngineD3D12/CMakeLists.txt
index d8876e43..cc18526e 100644
--- a/Graphics/GraphicsEngineD3D12/CMakeLists.txt
+++ b/Graphics/GraphicsEngineD3D12/CMakeLists.txt
@@ -1,6 +1,6 @@
cmake_minimum_required (VERSION 3.3)
-project(GraphicsEngineD3D12)
+project(GraphicsEngineD3D12 CXX)
set(INCLUDE
include/BufferD3D12Impl.h
@@ -178,6 +178,22 @@ set_target_properties(GraphicsEngineD3D12-shared PROPERTIES
OUTPUT_NAME_MINSIZEREL GraphicsEngineD3D12${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(GraphicsEngineD3D12-shared PROPERTIES
+ LINK_FLAGS_RELEASE /LTCG
+ LINK_FLAGS_MINSIZEREL /LTCG
+ LINK_FLAGS_RELWITHDEBINFO /LTCG
+ )
+ set_target_properties(GraphicsEngineD3D12-static PROPERTIES
+ STATIC_LIBRARY_FLAGS_RELEASE /LTCG
+ STATIC_LIBRARY_FLAGS_MINSIZEREL /LTCG
+ STATIC_LIBRARY_FLAGS_RELWITHDEBINFO /LTCG
+ )
+endif()
+
+
source_group("src" FILES
${SRC}
)
diff --git a/Graphics/GraphicsEngineD3DBase/CMakeLists.txt b/Graphics/GraphicsEngineD3DBase/CMakeLists.txt
index 999f34f7..3f35446a 100644
--- a/Graphics/GraphicsEngineD3DBase/CMakeLists.txt
+++ b/Graphics/GraphicsEngineD3DBase/CMakeLists.txt
@@ -1,6 +1,6 @@
cmake_minimum_required (VERSION 3.3)
-project(GraphicsEngineD3DBase)
+project(GraphicsEngineD3DBase CXX)
set(INCLUDE
include/D3DErrors.h
@@ -59,6 +59,16 @@ PRIVATE
target_link_libraries(GraphicsEngineD3DBase PRIVATE BuildSettings GraphicsEngine PlatformInterface Common)
+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(GraphicsEngineD3DBase PROPERTIES
+ STATIC_LIBRARY_FLAGS_RELEASE /LTCG
+ STATIC_LIBRARY_FLAGS_MINSIZEREL /LTCG
+ STATIC_LIBRARY_FLAGS_RELWITHDEBINFO /LTCG
+ )
+endif()
+
source_group("src" FILES ${SOURCE})
source_group("include" FILES ${INCLUDE})
source_group("generated" FILES include/HLSLDefinitions_inc.fxh)
diff --git a/Graphics/GraphicsEngineOpenGL/CMakeLists.txt b/Graphics/GraphicsEngineOpenGL/CMakeLists.txt
index 6294beb6..acd9f191 100644
--- a/Graphics/GraphicsEngineOpenGL/CMakeLists.txt
+++ b/Graphics/GraphicsEngineOpenGL/CMakeLists.txt
@@ -159,6 +159,21 @@ set_target_properties(GraphicsEngineOpenGL-shared PROPERTIES
OUTPUT_NAME_MINSIZEREL GraphicsEngineOpenGL${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(GraphicsEngineOpenGL-shared PROPERTIES
+ LINK_FLAGS_RELEASE /LTCG
+ LINK_FLAGS_MINSIZEREL /LTCG
+ LINK_FLAGS_RELWITHDEBINFO /LTCG
+ )
+ set_target_properties(GraphicsEngineOpenGL-static PROPERTIES
+ STATIC_LIBRARY_FLAGS_RELEASE /LTCG
+ STATIC_LIBRARY_FLAGS_MINSIZEREL /LTCG
+ STATIC_LIBRARY_FLAGS_RELWITHDEBINFO /LTCG
+ )
+endif()
+
source_group("src" FILES
${SOURCE}
src/DLLMain.cpp
diff --git a/Graphics/GraphicsTools/CMakeLists.txt b/Graphics/GraphicsTools/CMakeLists.txt
index ea4f3f12..cbfcea27 100644
--- a/Graphics/GraphicsTools/CMakeLists.txt
+++ b/Graphics/GraphicsTools/CMakeLists.txt
@@ -50,6 +50,16 @@ PRIVATE
PlatformInterface
)
+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(GraphicsTools PROPERTIES
+ STATIC_LIBRARY_FLAGS_RELEASE /LTCG
+ STATIC_LIBRARY_FLAGS_MINSIZEREL /LTCG
+ STATIC_LIBRARY_FLAGS_RELWITHDEBINFO /LTCG
+ )
+endif()
+
source_group("src" FILES ${SOURCE})
source_group("include" FILES ${INCLUDE})
source_group("interface" FILES ${INTERFACE})
diff --git a/Graphics/HLSL2GLSLConverterLib/CMakeLists.txt b/Graphics/HLSL2GLSLConverterLib/CMakeLists.txt
index 82ab1b4e..cb8e3a46 100644
--- a/Graphics/HLSL2GLSLConverterLib/CMakeLists.txt
+++ b/Graphics/HLSL2GLSLConverterLib/CMakeLists.txt
@@ -41,6 +41,15 @@ PRIVATE
GraphicsTools
)
+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(HLSL2GLSLConverterLib PROPERTIES
+ STATIC_LIBRARY_FLAGS_RELEASE /LTCG
+ STATIC_LIBRARY_FLAGS_MINSIZEREL /LTCG
+ STATIC_LIBRARY_FLAGS_RELWITHDEBINFO /LTCG
+ )
+endif()
# Create custom target to convert GLSLDefinitions.h to GLSLDefinitions_inc.h
add_custom_target(ProcessGLSLDefinitions