File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change 25
25
with :
26
26
submodules : recursive
27
27
- name : Build with IDF-${{ matrix.idf_ver }}
28
- env :
29
- EXPECTED_WARNING : " \" _GNU_SOURCE\" redefined"
30
28
shell : bash
31
29
run : |
32
30
. ${IDF_PATH}/export.sh
Original file line number Diff line number Diff line change @@ -82,3 +82,11 @@ idf_component_register(SRCS ${m_srcs}
82
82
83
83
target_compile_definitions (${COMPONENT_LIB} PRIVATE "WITH_BROKER" )
84
84
target_compile_options (${COMPONENT_LIB} PRIVATE "-Wno-format" )
85
+
86
+ # Some mosquittos source unconditionally define `_GNU_SOURCE` which collides with IDF build system
87
+ # producing warning: "_GNU_SOURCE" redefined
88
+ # This workarounds this issue by undefining the macro for the selected files
89
+ set (sources_that_define_gnu_source ${m_lib_dir} /net_mosq.c ${m_src_dir} /loop.c ${m_src_dir} /mux_poll.c )
90
+ foreach (offending_src ${sources_that_define_gnu_source} )
91
+ set_source_files_properties (${offending_src} PROPERTIES COMPILE_OPTIONS "-U_GNU_SOURCE" )
92
+ endforeach ()
You can’t perform that action at this time.
0 commit comments