Skip to content

Commit 572cd13

Browse files
committed
Bug #29691691: VS2019 FAILS TO COMPILE XCOM WHEN COMPILING WITH --DEBUG
Approved-by: Tor Didriksen <[email protected]> /ZI turned to /Z7 exactly as /Zi is turned into /Z7. This is to support VS2019 compilations.
1 parent 0fc6160 commit 572cd13

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

cmake/os/Windows.cmake

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2010, 2017, Oracle and/or its affiliates. All rights reserved.
1+
# Copyright (c) 2010, 2019, Oracle and/or its affiliates. All rights reserved.
22
#
33
# This program is free software; you can redistribute it and/or modify
44
# it under the terms of the GNU General Public License as published by
@@ -87,6 +87,8 @@ IF(MSVC)
8787
# information for use with the debugger. The symbolic debugging
8888
# information includes the names and types of variables, as well as
8989
# functions and line numbers. No .pdb file is produced by the compiler.
90+
# We can't use /ZI too since it's causing __LINE__ macros to be non-
91+
# constant on visual studio and hence XCom stops building correctly.
9092
FOREACH(lang C CXX)
9193
SET(CMAKE_${lang}_FLAGS_RELEASE "${CMAKE_${lang}_FLAGS_RELEASE} /Z7")
9294
ENDFOREACH()
@@ -99,6 +101,7 @@ IF(MSVC)
99101
STRING(REPLACE "/MD" "/MT" "${flag}" "${${flag}}")
100102
ENDIF()
101103
STRING(REPLACE "/Zi" "/Z7" "${flag}" "${${flag}}")
104+
STRING(REPLACE "/ZI" "/Z7" "${flag}" "${${flag}}")
102105
SET("${flag}" "${${flag}} /EHsc")
103106
ENDFOREACH()
104107

0 commit comments

Comments
 (0)