diff options
author | erorcun <erorcunerorcun@hotmail.com.tr> | 2021-08-15 20:24:20 +0200 |
---|---|---|
committer | erorcun <erorcunerorcun@hotmail.com.tr> | 2021-08-16 20:06:52 +0200 |
commit | e0ecbeee39e605cf2ee06e3632f4931d03606ce7 (patch) | |
tree | 36569421f31878d57a24cc3d279a2831f8173b04 /autoconf/clang.lua | |
parent | Fix impossible bullets & turn speed on heavy guns (diff) | |
download | re3-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/clang.lua | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/autoconf/clang.lua b/autoconf/clang.lua new file mode 100644 index 00000000..fdb5f405 --- /dev/null +++ b/autoconf/clang.lua @@ -0,0 +1,27 @@ +--- +-- Autoconfiguration. +-- Copyright (c) 2016 Blizzard Entertainment +--- +local p = premake +local clang = p.tools.clang + +function clang.try_compile(cfg, text, parameters) + -- 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 + + if parameters == nil then + parameters = "" + end + + local outFile = path.join(cfg.objdir, "temp.out") + + -- compile that text file. + if os.execute('clang "' .. cppFile .. '" ' .. parameters .. ' -o "' .. outFile ..'" &> /dev/null') then + return outFile + else + return nil + end +end |