-
Notifications
You must be signed in to change notification settings - Fork 37
[support-o_nif_cc] Support o_nif_cc gpb_opt #163
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,7 +12,7 @@ | |
| ]}. | ||
|
|
||
| {deps, [ | ||
| {'gpb', "~> 4.0"} | ||
| {'gpb', "~> 4.19.7"} | ||
| ]}. | ||
|
|
||
| {dialyzer, [ | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,6 +6,7 @@ | |
| -define(DEFAULT_PROTO_DIR, "proto"). | ||
| -define(DEFAULT_OUT_ERL_DIR, "src"). | ||
| -define(DEFAULT_OUT_HRL_DIR, "include"). | ||
| -define(DEFAULT_OUT_NIF_DIR, "prv"). | ||
|
|
||
| %% =================================================================== | ||
| %% Public API | ||
|
|
@@ -30,10 +31,17 @@ compile(AppInfo, State) -> | |
| TargetHrlDir = filename:join([AppOutDir, | ||
| proplists:get_value(o_hrl, GpbOpts0, | ||
| ?DEFAULT_OUT_HRL_DIR)]), | ||
| TargetNifDir = filename:join([AppOutDir, | ||
| proplists:get_value(o_nif_cc, GpbOpts0, | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. does this mean that people not interested in NIF generation will get it anyway?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not really, by default the NIF generation would be off
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What they would get is the
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yeah, if it can be avoided that would be best, always good to avoid unexpected things |
||
| ?DEFAULT_OUT_NIF_DIR)]), | ||
|
|
||
|
|
||
| rebar_api:debug("making sure that target erl dir ~p exists", [TargetErlDir]), | ||
| ok = ensure_dir(TargetErlDir), | ||
| rebar_api:debug("making sure that target hrl dir ~p exists", [TargetHrlDir]), | ||
| ok = ensure_dir(TargetHrlDir), | ||
| rebar_api:debug("making sure that target nif dir ~p exists", [TargetNifDir]), | ||
| ok = ensure_dir(TargetHrlDir), | ||
tak30 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| rebar_api:debug("reading proto files from ~p, generating \".erl\" to ~p " | ||
| "and \".hrl\" to ~p", | ||
| [SourceDirs, TargetErlDir, TargetHrlDir]), | ||
|
|
@@ -61,7 +69,9 @@ compile(AppInfo, State) -> | |
| proto_include_paths(AppDir, Protos, | ||
| default_include_opts(AppDir, DepsDir, | ||
| target_erl_opt(TargetErlDir, | ||
| target_hrl_opt(TargetHrlDir, GpbOpts0))))), | ||
| target_hrl_opt(TargetHrlDir, | ||
| target_nif_opt(TargetNifDir, GpbOpts0) | ||
| ))))), | ||
|
|
||
| compile(Protos, TargetErlDir, GpbOpts, Protos), | ||
| ok. | ||
|
|
@@ -230,6 +240,10 @@ target_erl_opt(Dir, Opts) -> | |
| target_hrl_opt(Dir, Opts) -> | ||
| lists:keystore(o_hrl, 1, Opts, {o_hrl, Dir}). | ||
|
|
||
| -spec target_nif_opt(string(), proplists:proplist()) -> proplists:proplist(). | ||
| target_nif_opt(Dir, Opts) -> | ||
| lists:keystore(o_nif_cc, 1, Opts, {o_nif_cc, Dir}). | ||
|
|
||
| -spec remove_plugin_opts(proplists:proplists()) -> proplists:proplist(). | ||
| remove_plugin_opts(Opts) -> | ||
| remove_plugin_opts(Opts, [recursive, ipath]). | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.