1 /*
2 * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
95 }
96
97 // Define set of flags shared for all targets that support debug compilation
98 def ccDebugFlags =
99 IS_DEBUG_NATIVE ? ["/MDd", "/Od", "/Zi", "/DDEBUG"] : ["/O2", "/MD", "/DNDEBUG"]
100
101 def winVsVer = Integer.parseInt(WINDOWS_VS_VER)
102 if (winVsVer >= 120) {
103 // Serialize access to PDB file for debug builds if on VS2013 or later
104 if (IS_DEBUG_NATIVE) ccDebugFlags += "/FS"
105 }
106
107
108 // Common set of flags for all modules except fxpackager
109 def ccFlags = ["/nologo", "/W3", "/EHsc", "/c",
110 "/D_STATIC_CPPLIB", "/D_DISABLE_DEPRECATE_STATIC_CPPLIB", "/DINLINE=__inline",
111 "/DUNICODE", "/D_UNICODE", "/DWIN32", "/DIAL", "/D_LITTLE_ENDIAN", "/DWIN32_LEAN_AND_MEAN",
112 "/I$JDK_HOME/include", "/I$JDK_HOME/include/win32",
113 ccDebugFlags].flatten();
114
115 def linkFlags = ["/nologo", "/dll", "/manifest", "/opt:REF", "/incremental:no"];
116 if (IS_DEBUG_NATIVE) linkFlags.add("/debug");
117
118 // Remove C++ static linking if not on VS2010
119 if (WINDOWS_VS_VER != "100") {
120 ccFlags -= ["/D_STATIC_CPPLIB", "/D_DISABLE_DEPRECATE_STATIC_CPPLIB"]
121 }
122
123 ext.WINDOWS_NATIVE_COMPILE_ENVIRONMENT = [
124 "VCINSTALLDIR" : WINDOWS_VS_VCINSTALLDIR,
125 "VSINSTALLDIR" : WINDOWS_VS_VSINSTALLDIR,
126 "DEVENVDIR" : WINDOWS_VS_DEVENVDIR,
127 "MSVCDIR" : WINDOWS_VS_MSVCDIR,
128 "VS_VER" : WINDOWS_VS_VER,
129 "PATH" : WINDOWS_VS_PATH,
130 "INCLUDE" : WINDOWS_VS_INCLUDE,
131 "LIB" : WINDOWS_VS_LIB,
132 "LIBPATH" : WINDOWS_VS_LIBPATH,
133 "DXSDK_DIR" : WINDOWS_DXSDK_DIR
134 ];
135
|
1 /*
2 * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
95 }
96
97 // Define set of flags shared for all targets that support debug compilation
98 def ccDebugFlags =
99 IS_DEBUG_NATIVE ? ["/MDd", "/Od", "/Zi", "/DDEBUG"] : ["/O2", "/MD", "/DNDEBUG"]
100
101 def winVsVer = Integer.parseInt(WINDOWS_VS_VER)
102 if (winVsVer >= 120) {
103 // Serialize access to PDB file for debug builds if on VS2013 or later
104 if (IS_DEBUG_NATIVE) ccDebugFlags += "/FS"
105 }
106
107
108 // Common set of flags for all modules except fxpackager
109 def ccFlags = ["/nologo", "/W3", "/EHsc", "/c",
110 "/D_STATIC_CPPLIB", "/D_DISABLE_DEPRECATE_STATIC_CPPLIB", "/DINLINE=__inline",
111 "/DUNICODE", "/D_UNICODE", "/DWIN32", "/DIAL", "/D_LITTLE_ENDIAN", "/DWIN32_LEAN_AND_MEAN",
112 "/I$JDK_HOME/include", "/I$JDK_HOME/include/win32",
113 ccDebugFlags].flatten();
114
115 def linkFlags = ["/nologo", "/dll", "/manifest", "/opt:REF", "/incremental:no", "/dynamicbase", "/nxcompat"];
116 if (!IS_64) linkFlags.add("/safeseh");
117 if (IS_DEBUG_NATIVE) linkFlags.add("/debug");
118
119 // Remove C++ static linking if not on VS2010
120 if (WINDOWS_VS_VER != "100") {
121 ccFlags -= ["/D_STATIC_CPPLIB", "/D_DISABLE_DEPRECATE_STATIC_CPPLIB"]
122 }
123
124 ext.WINDOWS_NATIVE_COMPILE_ENVIRONMENT = [
125 "VCINSTALLDIR" : WINDOWS_VS_VCINSTALLDIR,
126 "VSINSTALLDIR" : WINDOWS_VS_VSINSTALLDIR,
127 "DEVENVDIR" : WINDOWS_VS_DEVENVDIR,
128 "MSVCDIR" : WINDOWS_VS_MSVCDIR,
129 "VS_VER" : WINDOWS_VS_VER,
130 "PATH" : WINDOWS_VS_PATH,
131 "INCLUDE" : WINDOWS_VS_INCLUDE,
132 "LIB" : WINDOWS_VS_LIB,
133 "LIBPATH" : WINDOWS_VS_LIBPATH,
134 "DXSDK_DIR" : WINDOWS_DXSDK_DIR
135 ];
136
|