mirror of
https://github.com/opencv/opencv.git
synced 2024-11-24 03:00:14 +08:00
cmake: use /INCREMENTAL:NO with MSVS 2015
This commit is contained in:
parent
dc0c59fdc6
commit
13c2320e38
@ -22,6 +22,24 @@ if(NOT OPENCV_INITIAL_PASS)
|
||||
set(ENABLE_PRECOMPILED_HEADERS OFF CACHE INTERNAL "" FORCE)
|
||||
project(opencv_world)
|
||||
|
||||
# MSVS 2014 (vc14): LINK : fatal error LNK1210: exceeded internal ILK size limit; link with /INCREMENTAL:NO
|
||||
if(MSVC AND MSVC_VERSION EQUAL 1900)
|
||||
foreach(flag_var
|
||||
CMAKE_EXE_LINKER_FLAGS_DEBUG
|
||||
CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO
|
||||
CMAKE_MODULE_LINKER_FLAGS_DEBUG
|
||||
CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO
|
||||
CMAKE_SHARED_LINKER_FLAGS_DEBUG
|
||||
CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO
|
||||
)
|
||||
if(${flag_var} MATCHES "/INCREMENTAL")
|
||||
string(REGEX REPLACE "/INCREMENTAL[^ ]*" "/INCREMENTAL:NO" ${flag_var} "${${flag_var}}")
|
||||
else()
|
||||
set(${flag_var} "${${flag_var}} /INCREMENTAL:NO*")
|
||||
endif()
|
||||
endforeach(flag_var)
|
||||
endif()
|
||||
|
||||
message(STATUS "Processing WORLD modules...")
|
||||
foreach(m ${OPENCV_MODULES_BUILD})
|
||||
set(the_module ${m})
|
||||
|
Loading…
Reference in New Issue
Block a user