mirror of https://github.com/FreeRDP/FreeRDP
freerdp: fix build warnings with MSVC
This commit is contained in:
parent
03a401b8e6
commit
1307026a94
|
@ -160,10 +160,10 @@ endif()
|
||||||
|
|
||||||
if(MSVC)
|
if(MSVC)
|
||||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /Gd")
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /Gd")
|
||||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /MD")
|
#set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /MD")
|
||||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /O2")
|
#set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /O2")
|
||||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /Ob2")
|
#set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /Ob2")
|
||||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W2")
|
#set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W2")
|
||||||
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_AMD64_")
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_AMD64_")
|
||||||
else()
|
else()
|
||||||
|
|
|
@ -5,17 +5,20 @@ macro(configure_msvc_runtime)
|
||||||
if("${MSVC_RUNTIME}" STREQUAL "")
|
if("${MSVC_RUNTIME}" STREQUAL "")
|
||||||
set(MSVC_RUNTIME "dynamic")
|
set(MSVC_RUNTIME "dynamic")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Set compiler options.
|
# Set compiler options.
|
||||||
set(variables
|
set(variables
|
||||||
|
CMAKE_C_FLAGS
|
||||||
CMAKE_C_FLAGS_DEBUG
|
CMAKE_C_FLAGS_DEBUG
|
||||||
CMAKE_C_FLAGS_MINSIZEREL
|
CMAKE_C_FLAGS_MINSIZEREL
|
||||||
CMAKE_C_FLAGS_RELEASE
|
CMAKE_C_FLAGS_RELEASE
|
||||||
CMAKE_C_FLAGS_RELWITHDEBINFO
|
CMAKE_C_FLAGS_RELWITHDEBINFO
|
||||||
|
CMAKE_CXX_FLAGS
|
||||||
CMAKE_CXX_FLAGS_DEBUG
|
CMAKE_CXX_FLAGS_DEBUG
|
||||||
CMAKE_CXX_FLAGS_MINSIZEREL
|
CMAKE_CXX_FLAGS_MINSIZEREL
|
||||||
CMAKE_CXX_FLAGS_RELEASE
|
CMAKE_CXX_FLAGS_RELEASE
|
||||||
CMAKE_CXX_FLAGS_RELWITHDEBINFO
|
CMAKE_CXX_FLAGS_RELWITHDEBINFO)
|
||||||
)
|
|
||||||
if(${MSVC_RUNTIME} STREQUAL "static")
|
if(${MSVC_RUNTIME} STREQUAL "static")
|
||||||
message(STATUS "MSVC: using statically-linked runtime (/MT and /MTd).")
|
message(STATUS "MSVC: using statically-linked runtime (/MT and /MTd).")
|
||||||
foreach(variable ${variables})
|
foreach(variable ${variables})
|
||||||
|
@ -31,6 +34,25 @@ macro(configure_msvc_runtime)
|
||||||
endif()
|
endif()
|
||||||
endforeach()
|
endforeach()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
foreach(variable ${variables})
|
||||||
|
if(${variable} MATCHES "/Ob0")
|
||||||
|
string(REGEX REPLACE "/Ob0" "/Ob2" ${variable} "${${variable}}")
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
|
||||||
|
foreach(variable ${variables})
|
||||||
|
if(${variable} MATCHES "/W3")
|
||||||
|
string(REGEX REPLACE "/W3" "/W2" ${variable} "${${variable}}")
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
|
||||||
|
set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS}")
|
||||||
|
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG}")
|
||||||
|
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}")
|
||||||
|
set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_MINSIZEREL}")
|
||||||
|
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO}")
|
||||||
|
|
||||||
foreach(variable ${variables})
|
foreach(variable ${variables})
|
||||||
set(${variable} "${${variable}}" CACHE STRING "MSVC_${variable}" FORCE)
|
set(${variable} "${${variable}}" CACHE STRING "MSVC_${variable}" FORCE)
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
Loading…
Reference in New Issue