summaryrefslogtreecommitdiff
path: root/tools/minicargo
diff options
context:
space:
mode:
authorJohn Hodge <tpg@mutabah.net>2018-06-03 12:10:54 +0800
committerJohn Hodge <tpg@mutabah.net>2018-06-03 12:10:54 +0800
commit45023a8b4916de02a77abe23e2a800fc1d2e1d6a (patch)
tree8ba12fd5cb824de25a8ff208d6316d07a76f5613 /tools/minicargo
parentb99e6d0a7581c626d6c31c37487548965df05735 (diff)
downloadmrust-45023a8b4916de02a77abe23e2a800fc1d2e1d6a.tar.gz
All - Move host target auto-detection to be common between compiler and minicargo
Diffstat (limited to 'tools/minicargo')
-rw-r--r--tools/minicargo/build.cpp14
-rw-r--r--tools/minicargo/manifest.cpp2
2 files changed, 3 insertions, 13 deletions
diff --git a/tools/minicargo/build.cpp b/tools/minicargo/build.cpp
index 21d8d809..42e19552 100644
--- a/tools/minicargo/build.cpp
+++ b/tools/minicargo/build.cpp
@@ -51,18 +51,8 @@ extern int _putenv_s(const char*, const char*);
#else
# define EXESUF ""
#endif
-#ifdef _WIN32
-# ifdef _MSC_VER
-# define HOST_TARGET "x86_64-windows-msvc"
-# elif defined(__MINGW32__)
-# define HOST_TARGET "x86_64-windows-gnu"
-# else
-# endif
-#elif defined(__NetBSD__)
-# define HOST_TARGET "x86_64-unknown-netbsd"
-#else
-# define HOST_TARGET "x86_64-unknown-linux-gnu"
-#endif
+#include <target_detect.h> // tools/common/target_detect.h
+#define HOST_TARGET DEFAULT_TARGET_NAME
/// Class abstracting access to the compiler
class Builder
diff --git a/tools/minicargo/manifest.cpp b/tools/minicargo/manifest.cpp
index 6e2bf451..687c3e2a 100644
--- a/tools/minicargo/manifest.cpp
+++ b/tools/minicargo/manifest.cpp
@@ -9,7 +9,7 @@
#include <cctype> // toupper
#include "repository.h"
-
+// TODO: Extract this from the target at runtime
#ifdef _WIN32
# define TARGET_NAME "i586-windows-msvc"
# define CFG_UNIX false