summaryrefslogtreecommitdiffstats
path: root/autoconf/msc.lua
diff options
context:
space:
mode:
authorerorcun <erorcunerorcun@hotmail.com.tr>2021-08-15 20:24:20 +0200
committererorcun <erorcunerorcun@hotmail.com.tr>2021-08-16 20:06:52 +0200
commite0ecbeee39e605cf2ee06e3632f4931d03606ce7 (patch)
tree36569421f31878d57a24cc3d279a2831f8173b04 /autoconf/msc.lua
parentFix impossible bullets & turn speed on heavy guns (diff)
downloadre3-e0ecbeee39e605cf2ee06e3632f4931d03606ce7.tar
re3-e0ecbeee39e605cf2ee06e3632f4931d03606ce7.tar.gz
re3-e0ecbeee39e605cf2ee06e3632f4931d03606ce7.tar.bz2
re3-e0ecbeee39e605cf2ee06e3632f4931d03606ce7.tar.lz
re3-e0ecbeee39e605cf2ee06e3632f4931d03606ce7.tar.xz
re3-e0ecbeee39e605cf2ee06e3632f4931d03606ce7.tar.zst
re3-e0ecbeee39e605cf2ee06e3632f4931d03606ce7.zip
Diffstat (limited to '')
-rw-r--r--autoconf/msc.lua62
1 files changed, 62 insertions, 0 deletions
diff --git a/autoconf/msc.lua b/autoconf/msc.lua
new file mode 100644
index 00000000..b96a82ec
--- /dev/null
+++ b/autoconf/msc.lua
@@ -0,0 +1,62 @@
+---
+-- Autoconfiguration.
+-- Copyright (c) 2016 Blizzard Entertainment
+---
+local p = premake
+local msc = p.tools.msc
+
+-- "parameters" is unused, matter of fact this file is unused - re3
+function msc.try_compile(cfg, text, parameters)
+
+ return nil
+--[[
+ -- write the text to a temporary file.
+ local cppFile = path.join(cfg.objdir, "temp.cpp")
+ if not io.writefile(cppFile, text) then
+ return nil
+ end
+
+ -- write out a batch file.
+ local batch = p.capture(function ()
+ p.outln('@echo off')
+ p.outln('SET mypath=%~dp0')
+ p.outln('pushd %mypath%')
+
+ local map = {
+ vs2010 = 'VS100COMNTOOLS',
+ vs2012 = 'VS110COMNTOOLS',
+ vs2013 = 'VS120COMNTOOLS',
+ vs2015 = 'VS140COMNTOOLS',
+ vs2017 = 'VS141COMNTOOLS',
+ vs2019 = 'VS142COMNTOOLS',
+ }
+
+ local a = map[_ACTION]
+ if a then
+ a = path.translate(os.getenv(a), '/')
+ a = path.join(a, '../../VC/vcvarsall.bat')
+
+ if cfg.platform == 'x86' then
+ p.outln('call "' .. a .. '" > NUL')
+ else
+ p.outln('call "' .. a .. '" amd64 > NUL')
+ end
+
+ p.outln('cl.exe /nologo temp.cpp > NUL')
+ else
+ error('Unsupported Visual Studio version: ' .. _ACTION)
+ end
+ end)
+
+ local batchFile = path.join(cfg.objdir, "compile.bat")
+ if not io.writefile(batchFile, batch) then
+ return nil
+ end
+
+ if os.execute(batchFile) then
+ return path.join(cfg.objdir, "temp.exe")
+ else
+ return nil
+ end
+--]]
+end