COMP: if a new cmake runs on an old build tree, set CMAKE_LINKER to link to make it link
Alex
This commit is contained in:
parent
891f2130cf
commit
15a7414a60
|
@ -50,6 +50,10 @@ IF("${CMAKE_CXX_COMPILER_ID}" MATCHES "MSVC" OR "${CMAKE_C_COMPILER_ID}" MATCHES
|
||||||
FIND_PROGRAM(CMAKE_LINKER NAMES link PATHS ${_CMAKE_TOOLCHAIN_LOCATION} NO_DEFAULT_PATH)
|
FIND_PROGRAM(CMAKE_LINKER NAMES link PATHS ${_CMAKE_TOOLCHAIN_LOCATION} NO_DEFAULT_PATH)
|
||||||
FIND_PROGRAM(CMAKE_LINKER NAMES link)
|
FIND_PROGRAM(CMAKE_LINKER NAMES link)
|
||||||
|
|
||||||
|
IF(NOT CMAKE_LINKER)
|
||||||
|
MESSAGE(FATAL_ERROR "Could not find link, please check your installation.")
|
||||||
|
ENDIF(NOT CMAKE_LINKER)
|
||||||
|
|
||||||
MARK_AS_ADVANCED(CMAKE_LINKER)
|
MARK_AS_ADVANCED(CMAKE_LINKER)
|
||||||
ENDIF("${CMAKE_CXX_COMPILER_ID}" MATCHES "MSVC" OR "${CMAKE_C_COMPILER_ID}" MATCHES "MSVC")
|
ENDIF("${CMAKE_CXX_COMPILER_ID}" MATCHES "MSVC" OR "${CMAKE_C_COMPILER_ID}" MATCHES "MSVC")
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,14 @@ SET(CMAKE_LIBRARY_PATH_FLAG "-LIBPATH:")
|
||||||
SET(CMAKE_LINK_LIBRARY_FLAG "")
|
SET(CMAKE_LINK_LIBRARY_FLAG "")
|
||||||
SET(MSVC 1)
|
SET(MSVC 1)
|
||||||
|
|
||||||
|
# hack: if a new cmake (which uses CMAKE__LINKER) runs on an old build tree
|
||||||
|
# (where link was hardcoded) and where CMAKE_LINKER isn't in the cache
|
||||||
|
# and still cmake didn't fail in CMakeFindBinUtils.cmake (because it isn't rerun)
|
||||||
|
# hardcode CMAKE_LINKER here to link, so it behaves as it did before, Alex
|
||||||
|
IF(NOT DEFINED CMAKE_LINKER)
|
||||||
|
SET(CMAKE_LINKER link)
|
||||||
|
ENDIF(NOT DEFINED CMAKE_LINKER)
|
||||||
|
|
||||||
IF(CMAKE_VERBOSE_MAKEFILE)
|
IF(CMAKE_VERBOSE_MAKEFILE)
|
||||||
SET(CMAKE_CL_NOLOGO)
|
SET(CMAKE_CL_NOLOGO)
|
||||||
ELSE(CMAKE_VERBOSE_MAKEFILE)
|
ELSE(CMAKE_VERBOSE_MAKEFILE)
|
||||||
|
|
Loading…
Reference in New Issue