[haiku-commits] haiku: hrev52262 - build/jam

  • From: waddlesplash <waddlesplash@xxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Tue, 21 Aug 2018 20:56:11 -0400 (EDT)

hrev52262 adds 1 changeset to branch 'master'
old head: e4fac182002018b5bdad5c478aa80d1b845a05ff
new head: d37ae8656890f523b97293f026c4246f7d723b45
overview: 
https://git.haiku-os.org/haiku/log/?qt=range&q=d37ae8656890+%5Ee4fac1820020

----------------------------------------------------------------------------

d37ae8656890: LocaleRules: Add a second version of the catalog extraction 
actions.
  
  Clang behaves slightly differently than GCC and allows us to steamroll
  some errors we don't care about that GCC does not.

                              [ Augustin Cavalier <waddlesplash@xxxxxxxxx> ]

----------------------------------------------------------------------------

Revision:    hrev52262
Commit:      d37ae8656890f523b97293f026c4246f7d723b45
URL:         https://git.haiku-os.org/haiku/commit/?id=d37ae8656890
Author:      Augustin Cavalier <waddlesplash@xxxxxxxxx>
Date:        Wed Aug 22 00:52:41 2018 UTC

----------------------------------------------------------------------------

1 file changed, 17 insertions(+), 2 deletions(-)
build/jam/LocaleRules | 19 +++++++++++++++++--

----------------------------------------------------------------------------

diff --git a/build/jam/LocaleRules b/build/jam/LocaleRules
index e2d5cef3df..8dde3bab3d 100644
--- a/build/jam/LocaleRules
+++ b/build/jam/LocaleRules
@@ -66,8 +66,13 @@ rule ExtractCatalogEntries target : sources : signature : 
regexp
        local subdir = [ on $(signature) return $(HAIKU_CATALOGS_SUBDIR) ] ;
        MakeLocate $(target) : [ FDirName $(HAIKU_CATALOGS_OBJECT_DIR) 
$(subdir) ] ;
        Depends $(target) : $(sources) <build>collectcatkeys ;
-       LocalClean clean : $(target).pre ;
-       ExtractCatalogEntries1 $(target) : <build>collectcatkeys $(sources) ;
+       if $(HAIKU_CC_IS_CLANG_$(TARGET_PACKAGING_ARCH)) = 1 {
+               # Clang emits preprocessed source even if some included headers 
were not
+               # found, so we can treat a return code of 1 from it as not an 
error.
+               ExtractCatalogEntries2 $(target) : <build>collectcatkeys 
$(sources) ;
+       } else {
+               ExtractCatalogEntries1 $(target) : <build>collectcatkeys 
$(sources) ;
+       }
 }
 
 actions ExtractCatalogEntries1
@@ -79,6 +84,16 @@ actions ExtractCatalogEntries1
        $(RM) "$(1)".pre
 }
 
+actions ExtractCatalogEntries2
+{
+       $(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR)
+       $(CC) -E $(CCDEFS) -DB_COLLECTING_CATKEYS $(HDRS) "$(2[2-])" > 
"$(1)".pre \
+               || true
+       $(2[1]) $(HAIKU_CATALOG_REGEXP) -s $(HAIKU_CATALOG_SIGNATURE) \
+               -w -o "$(1)" "$(1)".pre
+       $(RM) "$(1)".pre
+}
+
 rule LinkApplicationCatalog target : sources : signature : language
 {
        # Link catalog entries from given catkey file into output compiled 
catalog


Other related posts: