build version move to generated store
authorChris Koeritz <fred@gruntose.com>
Mon, 20 Nov 2017 00:04:57 +0000 (19:04 -0500)
committerChris Koeritz <fred@gruntose.com>
Mon, 20 Nov 2017 00:04:57 +0000 (19:04 -0500)
nucleus/tools/clam_tools/write_build_config.cpp
scripts/clam/cpp/variables.def

index 4afed778ac91223bc51ba5b1d1047a20bda871d4..b8bfd80c1ee8c8d647c0a3ffb16067fdf741bbca 100644 (file)
@@ -245,8 +245,8 @@ int write_build_config::execute()
   // find our storage area for the build headers.  we know a couple build
   // configurations by now, but this should really be coming out of a config
   // file instead.
-  astring library_directory = repodir + "/nucleus/library";
-  if (!filename(library_directory).good()) {
+  astring genstore_directory = environment::get("FEISTY_MEOW_GENERATED_STORE");
+  if (!filename(genstore_directory).good()) {
     non_continuable_error(static_class_name(), func,
         astring("failed to locate the library folder storing the generated files."));
   }
@@ -254,10 +254,8 @@ int write_build_config::execute()
   // these are very specific paths, but they really are where we expect to
   // see the headers.
 
-  astring cfg_header_filename = library_directory + "/"
-      "__build_configuration.h";
-  astring ver_header_filename = library_directory + "/"
-      "__build_version.h";
+  astring cfg_header_filename = genstore_directory + "/__build_configuration.h";
+  astring ver_header_filename = genstore_directory + "/__build_version.h";
 
   // open the ini file for reading.
   byte_filer ini(fname, "r");
@@ -380,6 +378,17 @@ int write_build_config::execute()
     LOG(astring("failed writing output file ") + ver_header_filename);
   }
 
+  // now make a copy into the library folder, for when we release a production version.
+  astring library_directory = repodir + "/nucleus/library";
+  astring cfg_header_copy = library_directory + "/__build_configuration.h";
+  astring ver_header_copy = library_directory + "/__build_version.h";
+  if (!write_output_file(cfg_header_copy, cfg_accumulator)) {
+    LOG(astring("skipping copy due to read-only issue on output file: ") + cfg_header_copy);
+  }
+  if (!write_output_file(ver_header_copy, ver_accumulator)) {
+    LOG(astring("skipping copy due to read-only issue on output file: ") + ver_header_copy);
+  }
+
   return 0;
 }
 
index 60fcc7bc6bd43b30784cc53eddbabfd5e367f638..bcf70032cbce858f142a5ee62cdcae88c728ad05 100644 (file)
@@ -228,7 +228,8 @@ export DYNAMIC_LIBRARY_DIR = $(TARGETS_STORE)
 export STATIC_LIBRARY_DIR = $(TARGETS_STORE)
 
 # "HEADER_SEARCH_PATH" is where the class interface files are to be found.
-#HEADER_SEARCH_PATH =
+# we add the generated store folder for the build version file.
+HEADER_SEARCH_PATH = $(FEISTY_MEOW_GENERATED_STORE)
 
 # "HOOPLE_HEADERS" are locations where the HOOPLE headers can be found.
 ifeq "$(HOOPLE_HEADERS)" ""