summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEgor Yusov <egor.yusov@gmail.com>2017-12-10 06:47:51 +0000
committerEgor Yusov <egor.yusov@gmail.com>2017-12-10 06:47:51 +0000
commit84beedbf263cb6f26fa453386899120b96b9de79 (patch)
treec0d32781f05618d72e0de906865b9af21a6b4c26
parentUpdated cmake files; fixed build warnings (diff)
downloadDiligentTools-84beedbf263cb6f26fa453386899120b96b9de79.tar.gz
DiligentTools-84beedbf263cb6f26fa453386899120b96b9de79.zip
Updated cmake lists: enabled link-time code generation for MSVC
-rw-r--r--External/libjpeg-9a/CMakeLists.txt15
-rw-r--r--External/libtiff-4.0.3/CMakeLists.txt10
-rw-r--r--External/lpng-1.6.17/CMakeLists.txt10
-rw-r--r--External/lua-5.2.3/CMakeLists.txt9
-rw-r--r--External/zlib-1.2.8/CMakeLists.txt10
-rw-r--r--RenderScript/CMakeLists.txt11
-rw-r--r--TextureLoader/CMakeLists.txt10
7 files changed, 67 insertions, 8 deletions
diff --git a/External/libjpeg-9a/CMakeLists.txt b/External/libjpeg-9a/CMakeLists.txt
index bf7eceb..30813b0 100644
--- a/External/libjpeg-9a/CMakeLists.txt
+++ b/External/libjpeg-9a/CMakeLists.txt
@@ -2,10 +2,6 @@ cmake_minimum_required (VERSION 3.3)
project(LibJpeg C)
-if(MSVC)
- add_definitions(-D_CRT_SECURE_NO_WARNINGS)
-endif()
-
set(SOURCE
jaricom.c
jcapimin.c
@@ -79,7 +75,16 @@ if(MSVC)
# Disable MSVC-specific warnings
# - w4244: '+=': conversion from 'int' to 'JCOEF', possible loss of data
# - w4127: conditional expression is constant
- target_compile_options(LibJpeg PRIVATE /W4 /wd4244 /wd4127)
+ target_compile_options(LibJpeg PRIVATE /wd4244 /wd4127)
+ target_compile_definitions(LibJpeg PRIVATE -D_CRT_SECURE_NO_WARNINGS)
+
+ # 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(LibJpeg PROPERTIES
+ STATIC_LIBRARY_FLAGS_RELEASE /LTCG
+ STATIC_LIBRARY_FLAGS_MINSIZEREL /LTCG
+ STATIC_LIBRARY_FLAGS_RELWITHDEBINFO /LTCG
+ )
endif(MSVC)
source_group("source" FILES ${SOURCE})
diff --git a/External/libtiff-4.0.3/CMakeLists.txt b/External/libtiff-4.0.3/CMakeLists.txt
index 8938149..9a71382 100644
--- a/External/libtiff-4.0.3/CMakeLists.txt
+++ b/External/libtiff-4.0.3/CMakeLists.txt
@@ -82,7 +82,15 @@ add_library(
if(MSVC)
# Disable MSVC-specific warnings
target_compile_definitions(LibTiff PRIVATE -D_CRT_SECURE_NO_WARNINGS)
- target_compile_options(LibTiff PRIVATE /W4 /wd4244 /wd4456 /wd4457 /wd4706)
+ target_compile_options(LibTiff PRIVATE /wd4244 /wd4456 /wd4457 /wd4706)
+
+ # 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(LibTiff PROPERTIES
+ STATIC_LIBRARY_FLAGS_RELEASE /LTCG
+ STATIC_LIBRARY_FLAGS_MINSIZEREL /LTCG
+ STATIC_LIBRARY_FLAGS_RELWITHDEBINFO /LTCG
+ )
endif(MSVC)
diff --git a/External/lpng-1.6.17/CMakeLists.txt b/External/lpng-1.6.17/CMakeLists.txt
index e8eb216..9a2d368 100644
--- a/External/lpng-1.6.17/CMakeLists.txt
+++ b/External/lpng-1.6.17/CMakeLists.txt
@@ -33,8 +33,16 @@ add_library(
LibPng ${SOURCE} ${INCLUDE}
)
-if(WIN32)
+if(MSVC)
target_compile_definitions(LibPng PRIVATE -D_CRT_SECURE_NO_WARNINGS)
+
+ # 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(LibPng PROPERTIES
+ STATIC_LIBRARY_FLAGS_RELEASE /LTCG
+ STATIC_LIBRARY_FLAGS_MINSIZEREL /LTCG
+ STATIC_LIBRARY_FLAGS_RELWITHDEBINFO /LTCG
+ )
endif()
target_include_directories(LibPng
diff --git a/External/lua-5.2.3/CMakeLists.txt b/External/lua-5.2.3/CMakeLists.txt
index 204f1ba..685613b 100644
--- a/External/lua-5.2.3/CMakeLists.txt
+++ b/External/lua-5.2.3/CMakeLists.txt
@@ -85,8 +85,17 @@ if(MSVC)
# Disable MSVC-specific warnings
target_compile_definitions(Lua PRIVATE -D_CRT_SECURE_NO_WARNINGS)
target_compile_options(Lua PRIVATE /W3 /wd4244 /wd4334 /wd4702)
+
+ # 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(Lua PROPERTIES
+ STATIC_LIBRARY_FLAGS_RELEASE /LTCG
+ STATIC_LIBRARY_FLAGS_MINSIZEREL /LTCG
+ STATIC_LIBRARY_FLAGS_RELWITHDEBINFO /LTCG
+ )
endif(MSVC)
+
source_group("source" FILES ${SOURCE})
source_group("include" FILES ${INCLUDE})
diff --git a/External/zlib-1.2.8/CMakeLists.txt b/External/zlib-1.2.8/CMakeLists.txt
index 09272d6..70bfd65 100644
--- a/External/zlib-1.2.8/CMakeLists.txt
+++ b/External/zlib-1.2.8/CMakeLists.txt
@@ -40,6 +40,16 @@ add_library(
target_link_libraries(ZLib PRIVATE BuildSettings)
+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(ZLib PROPERTIES
+ STATIC_LIBRARY_FLAGS_RELEASE /LTCG
+ STATIC_LIBRARY_FLAGS_MINSIZEREL /LTCG
+ STATIC_LIBRARY_FLAGS_RELWITHDEBINFO /LTCG
+ )
+endif()
+
target_include_directories(ZLib PUBLIC .)
if(MSVC)
diff --git a/RenderScript/CMakeLists.txt b/RenderScript/CMakeLists.txt
index c42c0ca..1756ad0 100644
--- a/RenderScript/CMakeLists.txt
+++ b/RenderScript/CMakeLists.txt
@@ -49,7 +49,6 @@ set(SOURCE
src/LuaFunctionBinding.cpp
src/LuaWrappers.cpp
src/ParsingErrors.cpp
- src/pch.cpp
src/PSODescParser.cpp
src/RasterizerStateDescParser.cpp
src/ResourceMappingParser.cpp
@@ -77,6 +76,16 @@ source_group("include" FILES ${INCLUDE})
target_link_libraries(RenderScript PRIVATE BuildSettings GraphicsEngine Lua Common PlatformInterface 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(RenderScript PROPERTIES
+ STATIC_LIBRARY_FLAGS_RELEASE /LTCG
+ STATIC_LIBRARY_FLAGS_MINSIZEREL /LTCG
+ STATIC_LIBRARY_FLAGS_RELWITHDEBINFO /LTCG
+ )
+endif()
+
set_target_properties(RenderScript PROPERTIES
FOLDER Tools
) \ No newline at end of file
diff --git a/TextureLoader/CMakeLists.txt b/TextureLoader/CMakeLists.txt
index 3899618..74ecde0 100644
--- a/TextureLoader/CMakeLists.txt
+++ b/TextureLoader/CMakeLists.txt
@@ -34,6 +34,16 @@ source_group("include" FILES ${INCLUDE})
target_link_libraries(TextureLoader PRIVATE BuildSettings Common PlatformInterface GraphicsEngine GraphicsTools LibJpeg LibPng LibTiff Lua ZLib)
+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(TextureLoader PROPERTIES
+ STATIC_LIBRARY_FLAGS_RELEASE /LTCG
+ STATIC_LIBRARY_FLAGS_MINSIZEREL /LTCG
+ STATIC_LIBRARY_FLAGS_RELWITHDEBINFO /LTCG
+ )
+endif()
+
set_target_properties(TextureLoader PROPERTIES
FOLDER Tools
) \ No newline at end of file