}
}
- msvc = 2017
run_vcvars = true
extra_asmflags = []
}
}
declare_args() {
- windk = exec_script("find_windk.py", [ "$msvc" ], "trim string")
+ windk = exec_script("find_windk.py", [ ], "trim string")
}
declare_args() {
- msvc_root = exec_script("find_msvc_root.py", [ "$msvc", windk ], "trim string")
+ msvc_root = exec_script("find_msvc_root.py", [ windk ], "trim string")
+ win_kits = "$windk/../../../Windows Kits"
}
if (host_os == "win") {
include_dirs = [ ]
lib_dirs = [ ]
- if (msvc == 2015) {
- win_kits = "$windk/../Windows Kits"
- } else if (msvc == 2017) {
- win_kits = "$windk/../../../Windows Kits"
- }
include_dirs += [
"$msvc_root/include",
"$win_kits/10/Include/10.0.10240.0/ucrt",
"$win_kits/10/Include/10.0.10240.0/shared",
"$win_kits/10/Include/10.0.10240.0/winrt",
]
+ _is_store = ""
+ if (is_winrt) {
+ _is_store = "/store"
+ }
lib_dirs += [
+ "$msvc_root/lib/$target_cpu$_is_store",
"$win_kits/10/lib/10.0.10240.0/ucrt/$target_cpu",
"$win_kits/10/lib/10.0.10240.0/um/$target_cpu",
]
- if (msvc == 2015) {
- if (target_cpu == "x86") {
- lib_dirs += [ "$msvc_root/lib" ]
- } else if (target_cpu == "arm") {
- lib_dirs += [ "$msvc_root/lib/arm" ]
- } else {
- lib_dirs += [ "$msvc_root/lib/amd64" ]
- }
- } else if (msvc == 2017) {
- lib_dirs += [ "$msvc_root/lib/$target_cpu" ]
- }
} else {
cflags += [
"-fstrict-aliasing",
env_setup = ""
env_setup_end = ""
- if (target_cpu != "x64") {
- _target = "amd64_" + target_cpu
- if (msvc == 2015) {
- _vcvarsall = "$msvc_root/vcvarsall.bat"
- } else if (msvc == 2017) {
- _vcvarsall = "$msvc_root/../../../Auxiliary/Build/vcvarsall.bat"
- }
- if (run_vcvars) {
- env_setup = "cmd /c \"set __VSCMD_ARG_NO_LOGO=1 && set VSCMD_START_DIR=%CD% && \"$_vcvarsall\" $_target && "
- env_setup_end = "\""
- } else {
- print("Be sure to run")
- print("\"$_vcvarsall\" $_target")
- print("to set up your environment before running ninja.")
- }
- } else if (msvc == 2015) {
+
+ if (target_cpu == "x64") {
_target = "amd64"
+ } else {
+ _target = "amd64_" + target_cpu
}
- if (msvc == 2015) {
- bin = "$msvc_root/bin/$_target"
- } else if (msvc == 2017) {
- bin = "$msvc_root/bin/HostX64/$target_cpu"
+ if (is_winrt) {
+ _target += " store"
+ }
+
+ _vcvarsall = "$msvc_root/../../../Auxiliary/Build/vcvarsall.bat"
+ if (run_vcvars) {
+ env_setup = "cmd /c \"set __VSCMD_ARG_NO_LOGO=1 && set VSCMD_START_DIR=%CD% && \"$_vcvarsall\" $_target && "
+ env_setup_end = "\""
+ } else {
+ print("Be sure to run")
+ print("\"$_vcvarsall\" $_target")
+ print("to set up your environment before running ninja.")
}
+ bin = "$msvc_root/bin/HostX64/$target_cpu"
tool("asm") {
_ml = "ml"
import os
import sys
-msvc = int(sys.argv[1])
-
editions = [
'Community',
'Professional',
'Enterprise',
]
-if msvc == 2015:
- # just assume it is installed to the default location
- print 'C:/Program Files (x86)/Microsoft Visual Studio 14.0'
-else:
- # try each of the editions
- root = 'C:/Program Files (x86)/Microsoft Visual Studio/2017/'
- for edition in editions:
- if os.path.exists(root + edition):
- print root + edition
- sys.exit(0)
+# try each of the editions
+root = 'C:/Program Files (x86)/Microsoft Visual Studio/2017/'
+for edition in editions:
+ if os.path.exists(root + edition):
+ print root + edition
+ sys.exit(0)