@@ -129,12 +129,17 @@ endforeach()
129
129
130
130
if (WIN32 )
131
131
if (MSVC )
132
- # Enforce size-based optimization and link time code generation
133
- # on MSVC (~30% smaller binaries in experiments). /bigobj is needed
134
- # for bigger binding projects due to the limit to 64k addressable sections
135
- # /MP enables multithreaded builds (relevant when there are many files).
136
- set_target_properties (example PROPERTIES COMPILE_FLAGS "/Os /GL /MP /bigobj" )
137
- set_target_properties (example PROPERTIES LINK_FLAGS "/LTCG" )
132
+ # /bigobj is needed for bigger binding projects due to the limit to 64k
133
+ # addressable sections. /MP enables multithreaded builds (relevant when
134
+ # there are many files).
135
+ set_target_properties (example PROPERTIES COMPILE_FLAGS "/MP /bigobj " )
136
+
137
+ if (NOT ${U_CMAKE_BUILD_TYPE} MATCHES DEBUG)
138
+ # Enforce size-based optimization and link time code generation on MSVC
139
+ # (~30% smaller binaries in experiments).
140
+ set_target_properties (example APPEND_STRING PROPERTY COMPILE_FLAGS "/Os /GL " )
141
+ set_target_properties (example APPEND_STRING PROPERTY LINK_FLAGS "/LTCG " )
142
+ endif ()
138
143
endif ()
139
144
140
145
# .PYD file extension on Windows
@@ -151,7 +156,7 @@ elseif (UNIX)
151
156
# conflicting Python instances are active at the same time (even when they
152
157
# are of the same version).
153
158
154
- # Windows is not affected by this issue since it handles DLL imports
159
+ # Windows is not affected by this issue since it handles DLL imports
155
160
# differently. The solution for Linux and Mac OS is simple: we just don't
156
161
# link against the Python library. The resulting shared library will have
157
162
# missing symbols, but that's perfectly fine -- they will be resolved at
0 commit comments