Kaido Kert | da45c04 | 2022-05-09 11:08:54 -0700 | [diff] [blame] | 1 | # Copyright 2021 The Cobalt Authors. All Rights Reserved. |
| 2 | # |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | # you may not use this file except in compliance with the License. |
| 5 | # You may obtain a copy of the License at |
| 6 | # |
| 7 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 9 | # Unless required by applicable law or agreed to in writing, software |
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | # See the License for the specific language governing permissions and |
| 13 | # limitations under the License. |
| 14 | |
| 15 | import("//build/config/win/visual_studio_version.gni") |
| 16 | |
| 17 | config("platform_configuration") { |
| 18 | configs = [ |
| 19 | "//starboard/build/config/sabi", |
| 20 | "//starboard/win/shared/platform_configuration", |
| 21 | ] |
| 22 | |
| 23 | ldflags = [ "/SUBSYSTEM:CONSOLE" ] |
| 24 | libs = [ |
| 25 | "shell32.lib", |
| 26 | "winmm.lib", |
| 27 | "gdi32.lib", |
| 28 | "dbghelp.lib", |
| 29 | "user32.lib", |
| 30 | "shlwapi.lib", |
| 31 | "mfplat.lib", |
| 32 | "mfuuid.lib", |
| 33 | "windowsapp.lib", |
| 34 | ] |
| 35 | |
| 36 | include_dirs = [ |
| 37 | "$wdk_include_path", |
| 38 | "$msvc_path/atlmfc/include", |
| 39 | ] |
| 40 | |
| 41 | ldflags += [ |
| 42 | "/DYNAMICBASE", |
| 43 | |
| 44 | # TODO: SubSystem is hardcoded in |
| 45 | # win/sources_template.vcxproj. This will have the exe behave in the |
| 46 | # expected way in MSVS: when it's run without debug (Ctrl+F5), it |
| 47 | # will pause after finish; when debugging (F5) it will not pause |
| 48 | # before the cmd window disappears. |
| 49 | # Currently the value is ignored by msvs_makefile.py which generates |
| 50 | # the MSVS project files (it's in "data" in GenerateOutput()). Fix |
| 51 | # it if we ever need to change SubSystem. |
| 52 | "/SUBSYSTEM:CONSOLE", |
| 53 | "/MACHINE:x64", |
| 54 | |
| 55 | # Do not generate a WinMD file. |
| 56 | "/WINMD:NO", |
| 57 | |
| 58 | # Don't send error reports to MS. |
| 59 | "/errorReport:none", |
| 60 | ] |
| 61 | |
| 62 | cflags = [ |
| 63 | # Following V8 upstream to disable narrowing conversion. |
| 64 | "/wd4838", |
| 65 | ] |
| 66 | |
| 67 | if (current_toolchain == default_toolchain) { |
| 68 | defines = [ |
| 69 | "_WIN32", |
| 70 | "WIN32", |
| 71 | "WINDOWS", |
| 72 | |
| 73 | # Enable GNU extensions to get prototypes like ffsl. |
| 74 | "_GNU_SOURCE=1", |
| 75 | ] |
| 76 | } else { |
| 77 | # Increase compiler heap limit. |
| 78 | cflags += [ "/Zm10" ] |
| 79 | } |
| 80 | } |