[ccan] [PATCH 9/9] configurator: DEFAULT_{COMPILER, FLAGS} for MSVC

Kevin Locke kevin at kevinlocke.name
Mon Sep 19 10:52:06 AEST 2016


When compiling with Visual Studio, use default compiler name and flags
which are likely to work with the known-available compiler.

This is also a convenience for users who may not know what arguments
cl.exe may need to compile the tests.

Signed-off-by: Kevin Locke <kevin at kevinlocke.name>
---
 tools/configurator/configurator.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/tools/configurator/configurator.c b/tools/configurator/configurator.c
index 820ccf7..4f08701 100644
--- a/tools/configurator/configurator.c
+++ b/tools/configurator/configurator.c
@@ -35,8 +35,14 @@
 #define pclose _pclose
 #endif
 
+#ifdef _MSC_VER
+#define DEFAULT_COMPILER "cl"
+#define DEFAULT_FLAGS "/nologo /Zi /W4 " \
+	"/D_CRT_NONSTDC_NO_WARNINGS /D_CRT_SECURE_NO_WARNINGS /Fe:"
+#else
 #define DEFAULT_COMPILER "cc"
 #define DEFAULT_FLAGS "-g3 -ggdb -Wall -Wundef -Wmissing-prototypes -Wmissing-declarations -Wstrict-prototypes -Wold-style-definition -o"
+#endif
 
 #define OUTPUT_FILE "configurator.out"
 #define INPUT_FILE "configuratortest.c"
-- 
2.9.3



More information about the ccan mailing list