Browse Source

bug free

master
SisMaker 4 years ago
parent
commit
f4216855c3
1 changed files with 10 additions and 8 deletions
  1. +10
    -8
      src/rebarNpCompiler.erl

+ 10
- 8
src/rebarNpCompiler.erl View File

@ -618,13 +618,13 @@ targetType_1(".dll") -> drv;
targetType_1("") -> exe; targetType_1("") -> exe;
targetType_1(".exe") -> exe. targetType_1(".exe") -> exe.
% erlInterfaceDir(Subdir) ->
% case code:lib_dir(erl_interface, Subdir) of
% {error, bad_name} ->
% throw({error, {erl_interface, Subdir, "code:lib_dir(erl_interface)"
% "is unable to find the erl_interface library."}});
% Dir -> Dir
% end.
erlInterfaceDir(Subdir) ->
case code:lib_dir(erl_interface, Subdir) of
{error, bad_name} ->
throw({error, {erl_interface, Subdir, "code:lib_dir(erl_interface)"
"is unable to find the erl_interface library."}});
Dir -> Dir
end.
defaultEnv() -> defaultEnv() ->
Arch = os:getenv("REBAR_TARGET_ARCH"), Arch = os:getenv("REBAR_TARGET_ARCH"),
@ -665,9 +665,11 @@ defaultEnv() ->
{"ERL_CFLAGS", lists:concat( {"ERL_CFLAGS", lists:concat(
[ [
" -I\"", erlInterfaceDir(include),
"\" -I\"", filename:join(ertsDir(), "include"), "\" -I\"", filename:join(ertsDir(), "include"),
"\" " "\" "
])}, ])},
{"ERL_EI_LIBDIR", lists:concat(["\"", erlInterfaceDir(lib), "\""])},
{"ERL_LDFLAGS", " -L$ERL_EI_LIBDIR -lei"}, {"ERL_LDFLAGS", " -L$ERL_EI_LIBDIR -lei"},
{"ERLANG_ARCH", rebarUtils:wordsize()}, {"ERLANG_ARCH", rebarUtils:wordsize()},
{"ERLANG_TARGET", rebarUtils:getArch()}, {"ERLANG_TARGET", rebarUtils:getArch()},
@ -720,7 +722,7 @@ defaultEnv() ->
"$LINKER $PORT_IN_FILES $LDFLAGS $EXE_LDFLAGS /OUT:$PORT_OUT_FILE"}, "$LINKER $PORT_IN_FILES $LDFLAGS $EXE_LDFLAGS /OUT:$PORT_OUT_FILE"},
%% ERL_CFLAGS are ok as -I even though strictly it should be /I %% ERL_CFLAGS are ok as -I even though strictly it should be /I
{"win32", "ERL_LDFLAGS", {"win32", "ERL_LDFLAGS",
" /LIBPATH:$ERL_EI_LIBDIR ei.lib"},
" /LIBPATH:$ERL_EI_LIBDIR erl_interface.lib ei.lib"},
{"win32", "DRV_CFLAGS", "/Zi /Wall $ERL_CFLAGS"}, {"win32", "DRV_CFLAGS", "/Zi /Wall $ERL_CFLAGS"},
{"win32", "DRV_LDFLAGS", "/DLL $ERL_LDFLAGS"}, {"win32", "DRV_LDFLAGS", "/DLL $ERL_LDFLAGS"},
%% Provide some default Windows defines for convenience %% Provide some default Windows defines for convenience

Loading…
Cancel
Save