Skip to content

Commit

Permalink
Merge pull request #181 from ptoscano/project-name
Browse files Browse the repository at this point in the history
autogen: add project_name/PROJECT_NAME
  • Loading branch information
jeromemaloberti authored Mar 21, 2019
2 parents b40c693 + 055b067 commit 28252e8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions obuild/configure.ml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ let getDigestKV () =
let generateMlFile project file flags =
Utils.generateFile file (fun add ->
add "(* autogenerated file by obuild. do not modify *)\n";
add (sprintf "let project_name = \"%s\"\n" project.Analyze.project_file.Project.name);
add (sprintf "let project_version = \"%s\"\n" project.Analyze.project_file.Project.version);
(* TODO escape name properly *)
List.iter (fun (name, v) -> add (sprintf "let project_flag_%s = %b\n" name v)) flags;
Expand All @@ -28,6 +29,7 @@ let generateMlFile project file flags =
let generateCFile project file flags =
Utils.generateFile file (fun add ->
add "/* autogenerated file by obuild. do not modify */\n";
add (sprintf "#define PROJECT_NAME \"%s\"\n" project.Analyze.project_file.Project.name);
add (sprintf "#define PROJECT_VERSION \"%s\"\n" project.Analyze.project_file.Project.version);
(* TODO escape name properly *)
List.iter (fun (name, v) ->
Expand Down

0 comments on commit 28252e8

Please sign in to comment.