summaryrefslogtreecommitdiff
path: root/xmake/modules/core
diff options
context:
space:
mode:
authorruki <[email protected]>2020-07-04 23:52:15 +0800
committerruki <[email protected]>2020-07-04 23:52:15 +0800
commit22229713a006394d0bb5d70865850bad60898f00 (patch)
tree3cd65734f56637e650f312d04418658c8550d689 /xmake/modules/core
parentb131172723bd99c7df027e7244fc9d0cee8fffa8 (diff)
add gfortran compiler
Diffstat (limited to 'xmake/modules/core')
-rw-r--r--xmake/modules/core/tools/dmd.lua28
-rw-r--r--xmake/modules/core/tools/gfortran.lua22
2 files changed, 26 insertions, 24 deletions
diff --git a/xmake/modules/core/tools/dmd.lua b/xmake/modules/core/tools/dmd.lua
index 378c68642..2d8fe8f44 100644
--- a/xmake/modules/core/tools/dmd.lua
+++ b/xmake/modules/core/tools/dmd.lua
@@ -38,8 +38,6 @@ end
-- make the optimize flag
function nf_optimize(self, level)
-
- -- the maps
local maps =
{
fast = "-O"
@@ -48,42 +46,30 @@ function nf_optimize(self, level)
, smallest = "-O -release -boundscheck=off"
, aggressive = "-O -release -inline -boundscheck=off"
}
-
- -- make it
return maps[level]
end
-- make the strip flag
function nf_strip(self, level)
-
- -- the maps
local maps =
{
debug = "-L-S"
, all = "-L-s"
}
-
- -- make it
return maps[level]
end
-- make the symbol flag
function nf_symbol(self, level)
-
- -- the maps
local maps =
{
debug = "-g -debug"
}
-
- -- make it
return maps[level]
end
-- make the warning flag
function nf_warning(self, level)
-
- -- the maps
local maps =
{
none = "-d"
@@ -93,22 +79,16 @@ function nf_warning(self, level)
, everything = "-w -wi"
, error = "-de"
}
-
- -- make it
return maps[level]
end
-- make the vector extension flag
function nf_vectorext(self, extension)
-
- -- the maps
local maps =
{
avx = "-mcpu=avx"
, avx2 = "-mcpu=avx"
}
-
- -- make it
return maps[extension]
end
@@ -171,17 +151,17 @@ function link(self, objectfiles, targetkind, targetfile, flags)
end
-- make the compile arguments list
-function compargv(self, sourcefiles, objectfile, flags)
- return self:program(), table.join("-c", flags, "-of" .. objectfile, sourcefiles)
+function compargv(self, sourcefile, objectfile, flags)
+ return self:program(), table.join("-c", flags, "-of" .. objectfile, sourcefile)
end
-- compile the source file
-function compile(self, sourcefiles, objectfile, dependinfo, flags)
+function compile(self, sourcefile, objectfile, dependinfo, flags)
-- ensure the object directory
os.mkdir(path.directory(objectfile))
-- compile it
- os.runv(compargv(self, sourcefiles, objectfile, flags))
+ os.runv(compargv(self, sourcefile, objectfile, flags))
end
diff --git a/xmake/modules/core/tools/gfortran.lua b/xmake/modules/core/tools/gfortran.lua
new file mode 100644
index 000000000..16a6dfdb6
--- /dev/null
+++ b/xmake/modules/core/tools/gfortran.lua
@@ -0,0 +1,22 @@
+--!A cross-platform build utility based on Lua
+--
+-- Licensed under the Apache License, Version 2.0 (the "License");
+-- you may not use this file except in compliance with the License.
+-- You may obtain a copy of the License at
+--
+-- http://www.apache.org/licenses/LICENSE-2.0
+--
+-- Unless required by applicable law or agreed to in writing, software
+-- distributed under the License is distributed on an "AS IS" BASIS,
+-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+-- See the License for the specific language governing permissions and
+-- limitations under the License.
+--
+-- Copyright (C) 2015-2020, TBOOX Open Source Group.
+--
+-- @author ruki
+-- @file gfortran.lua
+--
+
+-- inherit gcc
+inherit("gcc")