This is an automated email from the ASF dual-hosted git repository.

jerzy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-newt.git


The following commit(s) were added to refs/heads/master by this push:
     new 82d910a9 compiler: Fix pkg.source_files compiler flags
82d910a9 is described below

commit 82d910a9ffe037141a6b2364742fec363cc48830
Author: Michal Gorecki <[email protected]>
AuthorDate: Wed Jul 26 17:54:33 2023 +0200

    compiler: Fix pkg.source_files compiler flags
    
    This fixes the issue: https://github.com/apache/mynewt-newt/issues/517
---
 newt/toolchain/compiler.go | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/newt/toolchain/compiler.go b/newt/toolchain/compiler.go
index 01083956..9354206d 100644
--- a/newt/toolchain/compiler.go
+++ b/newt/toolchain/compiler.go
@@ -471,6 +471,15 @@ func (c *Compiler) includesStrings() []string {
 
 func (c *Compiler) cflagsStrings() []string {
        cflags := util.SortFields(c.info.Cflags...)
+
+       for _, lclinfo_flag := range util.SortFields(c.lclInfo.Cflags...) {
+               for _, info_flag := range cflags {
+                       if lclinfo_flag == info_flag {
+                               continue
+                       }
+               }
+               cflags = append(cflags, lclinfo_flag)
+       }
        return cflags
 }
 

Reply via email to