From b6ad8fe5b4adacea14831171734f954969a72e23 Mon Sep 17 00:00:00 2001 From: Adam Chlipala Date: Sun, 11 Sep 2011 11:37:26 -0400 Subject: Disable C optimization in debug mode --- src/compiler.sml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/compiler.sml b/src/compiler.sml index de6b14b4..3fbc6008 100644 --- a/src/compiler.sml +++ b/src/compiler.sml @@ -1322,11 +1322,17 @@ fun compileC {cname, oname, ename, libs, profile, debug, link = link'} = else "-L" ^ Config.lib ^ "/.. -lurweb " ^ #linkDynamic proto - val compile = Config.ccompiler ^ " " ^ Config.ccArgs ^ " " ^ Config.pthreadCflags ^ " -Wimplicit -Werror -Wno-unused-value -O3 -I " ^ Config.includ + val opt = if debug then + "" + else + " -O3" + + val compile = Config.ccompiler ^ " " ^ Config.ccArgs ^ " " ^ Config.pthreadCflags ^ " -Wimplicit -Werror -Wno-unused-value" + ^ opt ^ " -I " ^ Config.includ ^ " " ^ #compile proto ^ " -c " ^ escapeFilename cname ^ " -o " ^ escapeFilename oname - val link = Config.ccompiler ^ " -Werror -O3 -lm " ^ Config.ccArgs ^ " " ^ Config.pthreadCflags ^ " " ^ Config.pthreadLibs + val link = Config.ccompiler ^ " -Werror" ^ opt ^ " -lm " ^ Config.ccArgs ^ " " ^ Config.pthreadCflags ^ " " ^ Config.pthreadLibs ^ " " ^ lib ^ " " ^ Config.openssl ^ " " ^ escapeFilename oname ^ " -o " ^ escapeFilename ename ^ " " ^ libs val (compile, link) = -- cgit v1.2.3