forked from bilke/cmake-modules
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMSVCVerboseLinking.cmake
48 lines (45 loc) · 1.47 KB
/
MSVCVerboseLinking.cmake
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# - Add appropriate linker flags to show link details on Visual Studio
#
# include(MSVCVerboseLinking) - to add the flags automaticlly if applicable
#
# Be sure to include this module _BEFORE_ adding your targets, or the targets
# won't pick up the updated flags.
#
# Requires these CMake modules:
# - none
#
# Original Author:
# 2010 Ryan Pavlik <[email protected]> <[email protected]>
# http://academic.cleardefinition.com
# Iowa State University HCI Graduate Program/VRAC
#
# Copyright Iowa State University 2009-2010.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
if(MSVC)
if(NOT DEFINED MSVC_LINK_REALLY_VERBOSE)
if(IN_DASHBOARD_SCRIPT)
set(MSVC_LINK_REALLY_VERBOSE TRUE)
else()
set(MSVC_LINK_REALLY_VERBOSE FALSE)
endif()
endif()
set(MSVC_LINK_REALLY_VERBOSE
"${MSVC_LINK_REALLY_VERBOSE}"
CACHE
BOOL
"Provide maximum linker messages?")
mark_as_advanced(MSVC_LINK_REALLY_VERBOSE)
if(MSVC_LINK_REALLY_VERBOSE)
set(_verbose_flag "/VERBOSE")
else()
set(_verbose_flag "/VERBOSE:LIB")
endif()
set(CMAKE_EXE_LINKER_FLAGS
"${CMAKE_EXE_LINKER_FLAGS} ${_verbose_flag}")
set(CMAKE_MODULE_LINKER_FLAGS
"${CMAKE_MODULE_LINKER_FLAGS} ${_verbose_flag}")
set(CMAKE_SHARED_LINKER_FLAGS
"${CMAKE_SHARED_LINKER_FLAGS} ${_verbose_flag}")
endif()