apache / mynewt-newt

An OS to build, deploy and securely manage billions of devices
https://mynewt.apache.org/
Apache License 2.0
117 stars 96 forks source link

Compiler flags not passed to build for source files specified in pkg.source_files: statement #517

Closed kasjer closed 1 year ago

kasjer commented 1 year ago

When package has source files specified by pkg.source_files: compiler flags are not passed correctly during build.

For package files specified like this:

pkg.source_files:
    - src/adc_touch.c

Other files are build with correct command line arguments and adc_touch.c has less arguments that it should Correct file:

arm-none-eabi-gcc -DAPP_NAME=demo -DAPP_demo -DARCH_NAME=cortex_m33 -DARCH_cortex_m33 -DBSP_NAME=nordic_pca10095 -DBSP_nordic_pca10095 -DCFG_TUSB_MCU=OPT_MCU_NRF5X -DLCD_ITF_INCLUDE=<nordic_pca10095_defs.h> -DLV_CONF_INCL
UDE_SIMPLE=1 -DMYNEWT=1 -DNRF5340_XXAA_APPLICATION -Og -Wall -Werror -Wno-error=uninitialized -fdata-sections -ffunction-sections -fno-common -fno-exceptions -ggdb -mcpu=cortex-m33+nodsp -mfloat-abi=hard -mfpu=fpv4-sp-d16
 -mthumb -mthumb-interwork -Ibin/targets/nordic_pca10095-display_test/generated/include

Failing file:

arm-none-eabi-gcc -DAPP_NAME=demo -DAPP_demo -DARCH_NAME=cortex_m33 -DARCH_cortex_m33 -DBSP_NAME=nordic_pca10095 -DBSP_nordic_pca10095 -DCFG_TUSB_MCU=OPT_MCU_NRF5X -DLCD_ITF_INCLUDE=<nordic_pca10095_defs.h> -DLV_CONF_INCL
UDE_SIMPLE=1 -DMYNEWT=1 -DNRF5340_XXAA_APPLICATION -mfloat-abi=hard -mfpu=fpv4-sp-d16 -Ibin/targets/nordic_pca10095-display_test/generated/include

Following options were not passed to comiler:

-Og -Wall -Werror -Wno-error=uninitialized -fdata-sections -ffunction-sections -fno-common -fno-exceptions -ggdb -mcpu=cortex-m33+nodsp

CMakeList.txt generated for same target does not have this issue though.

kasjer commented 1 year ago

@m-gorecki can you take a look at this issue

kasjer commented 1 year ago

@m-gorecki verified to work. Thank you.