aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/linkers.py
diff options
context:
space:
mode:
authorGoaLitiuM <goalitium@kapsi.fi>2018-09-12 12:17:11 +0300
committerJussi Pakkanen <jpakkane@gmail.com>2018-09-13 22:07:19 +0300
commit8fa7c29661db94b5cafac2aab53f738df2cdaf99 (patch)
tree204ca47e59338c53a98e3022b75e21ae6af1eda4 /mesonbuild/linkers.py
parente0d02e2111a39270ba225e130e8a1b2e12fc62fd (diff)
downloadmeson-8fa7c29661db94b5cafac2aab53f738df2cdaf99.zip
meson-8fa7c29661db94b5cafac2aab53f738df2cdaf99.tar.gz
meson-8fa7c29661db94b5cafac2aab53f738df2cdaf99.tar.bz2
D: Fix linker detection when static linker is missing
Fallback to using D compilers as static linkers when no suitable static linker were found.
Diffstat (limited to 'mesonbuild/linkers.py')
-rw-r--r--mesonbuild/linkers.py17
1 files changed, 12 insertions, 5 deletions
diff --git a/mesonbuild/linkers.py b/mesonbuild/linkers.py
index 93106b3..30ca5d8 100644
--- a/mesonbuild/linkers.py
+++ b/mesonbuild/linkers.py
@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-from .mesonlib import Popen_safe
+from .mesonlib import Popen_safe, is_windows
from . import mesonlib
class StaticLinker:
@@ -138,11 +138,12 @@ class ArmarLinker(ArLinker):
# armar cann't accept arguments using the @rsp syntax
return False
-class LDCLinker(StaticLinker):
-
- def __init__(self, exelist):
+class DLinker(StaticLinker):
+ def __init__(self, exelist, is_64, is_msvc):
self.exelist = exelist
- self.id = 'ldc2'
+ self.id = exelist[0]
+ self.is_64 = is_64
+ self.is_msvc = is_msvc
def can_linker_accept_rsp(self):
return mesonlib.is_windows()
@@ -163,6 +164,12 @@ class LDCLinker(StaticLinker):
return []
def get_linker_always_args(self):
+ if is_windows():
+ if self.is_64:
+ return ['-m64']
+ elif self.is_msvc and self.id == 'dmd':
+ return ['-m32mscoff']
+ return ['-m32']
return []
def get_coverage_link_args(self):