From c3c4ff1c66d87d5074960b79b23003c3dbaf35d0 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Mon, 14 Aug 2017 21:13:51 +0200 Subject: cmake/msvc: fix build Dunno what was wrong otherwise. --- cmake/msvc.cmake | 38 +++++++++++++++++--------------------- 1 file changed, 17 insertions(+), 21 deletions(-) (limited to 'cmake') diff --git a/cmake/msvc.cmake b/cmake/msvc.cmake index 50144132..e54cd505 100644 --- a/cmake/msvc.cmake +++ b/cmake/msvc.cmake @@ -62,32 +62,28 @@ set(_LDFLAGS_STATIC "-machine:X86 -WX") set(_LDFLAGS_STATIC_RELEASE "-LTCG:INCREMENTAL") set(_LDFLAGS_STATIC_DEBUG "") -foreach(j C CXX) - foreach(i "" _DEBUG _RELEASE) - set(CMAKE_${j}_FLAGS${i} "${CMAKE_${j}_FLAGS${i}} ${_${j}FLAGS${i}}") - endforeach() - set(CMAKE_${j}_FLAGS "${CMAKE_${j}_FLAGS} ${_${j}FLAGS}") -endforeach() - -foreach(j "" _DEBUG _RELEASE) - foreach(i MODULE EXE SHARED) - set(CMAKE_${i}_LINKER_FLAGS${j} "${_LDFLAGS${j}} ${CMAKE_${i}_LINKER_FLAGS${j}}") - endforeach() -endforeach() - -set(CMAKE_STATIC_LINKER_FLAGS "${_LDFLAGS_STATIC} ${CMAKE_STATIC_LINKER_FLAGS}") -set(CMAKE_STATIC_LINKER_FLAGS_RELEASE "${_LDFLAGS_STATIC_RELEASE} ${CMAKE_STATIC_LINKER_FLAGS_RELEASE}") -set(CMAKE_STATIC_LINKER_FLAGS_DEBUG "${_LDFLAGS_STATIC_DEBUG} ${CMAKE_STATIC_LINKER_FLAGS_DEBUG}") - set(CMAKE_RC_FLAGS "-nologo -DWIN32") if(NOT CMAKE_INSTALL_PREFIX) set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/install" CACHE PATH "" FORCE) set(CMAKE_BUILD_TYPE "RELEASE" CACHE STRING "" FORCE) - set(CMAKE_CXX_FLAGS_RELEASE " " CACHE STRING "" FORCE) - set(CMAKE_C_FLAGS_RELEASE " " CACHE STRING "" FORCE) - set(CMAKE_CXX_FLAGS " " CACHE STRING "" FORCE) - set(CMAKE_C_FLAGS " " CACHE STRING "" FORCE) + + set(CMAKE_STATIC_LINKER_FLAGS "${_LDFLAGS_STATIC} ${CMAKE_STATIC_LINKER_FLAGS}" CACHE STRING "" FORCE) + set(CMAKE_STATIC_LINKER_FLAGS_RELEASE "${_LDFLAGS_STATIC_RELEASE} ${CMAKE_STATIC_LINKER_FLAGS_RELEASE}" CACHE STRING "" FORCE) + set(CMAKE_STATIC_LINKER_FLAGS_DEBUG "${_LDFLAGS_STATIC_DEBUG} ${CMAKE_STATIC_LINKER_FLAGS_DEBUG}" CACHE STRING "" FORCE) + + foreach(j C CXX) + foreach(i "" _DEBUG _RELEASE) + set(CMAKE_${j}_FLAGS${i} "${_${j}FLAGS${i}}" CACHE STRING "" FORCE) + endforeach() + set(CMAKE_${j}_FLAGS "${_${j}FLAGS}" CACHE STRING "" FORCE) + endforeach() + + foreach(j "" _DEBUG _RELEASE) + foreach(i MODULE EXE SHARED) + set(CMAKE_${i}_LINKER_FLAGS${j} "${_LDFLAGS${j}}" CACHE STRING "" FORCE) + endforeach() + endforeach() endif() include("${CMAKE_CURRENT_LIST_DIR}/opentrack-policy.cmake") -- cgit v1.2.3