Skip to content

Commit

Permalink
Fix building on windows without cl.exe
Browse files Browse the repository at this point in the history
  • Loading branch information
dgud committed May 17, 2013
1 parent 70b3c11 commit d410f25
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions rebar.config.script
Expand Up @@ -88,8 +88,12 @@ WinSetupGCC = fun(OpenCLDir) ->
4 -> E0;
8 -> AddConf("WIN_TARGET", "-DWIN_X64", E0)
end,
CC = case GetEnv("CC") of
false -> "gcc";
EnvCC -> EnvCC
end,

GCCConf =[{"win32", "CC" , GetEnv("CC")},
GCCConf =[{"win32", "CC" , CC},
{"win32", "DRV_CC_TEMPLATE",
"$CC -c $CFLAGS $DRV_CFLAGS $PORT_IN_FILES -o $PORT_OUT_FILE"},
{"win32", "DRV_LINK_TEMPLATE",
Expand Down Expand Up @@ -163,7 +167,7 @@ SetupWin32 = fun(OpenCLDir) ->
%% Do we want to compile with Microsoft's toolchain
case os:find_executable("cl.exe") of
false ->
os:find_executable("gcc") orelse
(os:find_executable("gcc") == false) andalso
Error("No known compiler found",[]),
WinSetupGCC(OpenCLDir);
_ ->
Expand Down

0 comments on commit d410f25

Please sign in to comment.