Commit 91d9e9bd authored by Vladislav Vaintroub's avatar Vladislav Vaintroub

MDEV-27813 Windows, compiling : RelWithDebInfo should use /Ob2

Fixed inlining flags. Remove /Ob1 added by CMake for RelWithDebInfo.
(the actual compiler default is /Ob2 if optimizations are enabled)

Allow to define custom /Ob flag with new variable MSVC_INLINE, if desired
parent 7c6ec0a5
......@@ -169,8 +169,20 @@ IF(MSVC)
IF((NOT "${${flag}}" MATCHES "/Zi") AND (NOT "${${flag}}" MATCHES "/Z7"))
STRING(APPEND ${flag} " /Zi")
ENDIF()
# Remove inlining flags, added by CMake, if any.
# Compiler default is fine.
STRING(REGEX REPLACE "/Ob[0-3]" "" "${flag}" "${${flag}}" )
ENDFOREACH()
# Allow to overwrite the inlining flag
SET(MSVC_INLINE "" CACHE STRING
"MSVC Inlining option, either empty, or one of /Ob0,/Ob1,/Ob2,/Ob3")
IF(MSVC_INLINE MATCHES "/Ob[0-3]")
ADD_COMPILE_OPTIONS(${MSVC_INLINE})
ELSEIF(NOT(MSVC_INLINE STREQUAL ""))
MESSAGE(FATAL_ERROR "Invalid option for MSVC_INLINE")
ENDIF()
IF(WITH_ASAN OR WITH_UBSAN)
# Workaround something Linux specific
SET(SECURITY_HARDENED 0 CACHE INTERNAL "" FORCE)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment