mirror of
https://github.com/espressif/esp-protocols.git
synced 2025-06-25 09:21:32 +02:00
fix(mosq): Fix clean compilation addressing _GNU_SOURCE redefined
This commit is contained in:
2
.github/workflows/mosq__build.yml
vendored
2
.github/workflows/mosq__build.yml
vendored
@ -25,8 +25,6 @@ jobs:
|
||||
with:
|
||||
submodules: recursive
|
||||
- name: Build with IDF-${{ matrix.idf_ver }}
|
||||
env:
|
||||
EXPECTED_WARNING: "\"_GNU_SOURCE\" redefined"
|
||||
shell: bash
|
||||
run: |
|
||||
. ${IDF_PATH}/export.sh
|
||||
|
@ -82,3 +82,11 @@ idf_component_register(SRCS ${m_srcs}
|
||||
|
||||
target_compile_definitions(${COMPONENT_LIB} PRIVATE "WITH_BROKER")
|
||||
target_compile_options(${COMPONENT_LIB} PRIVATE "-Wno-format")
|
||||
|
||||
# Some mosquittos source unconditionally define `_GNU_SOURCE` which collides with IDF build system
|
||||
# producing warning: "_GNU_SOURCE" redefined
|
||||
# This workarounds this issue by undefining the macro for the selected files
|
||||
set(sources_that_define_gnu_source ${m_lib_dir}/net_mosq.c ${m_src_dir}/loop.c ${m_src_dir}/mux_poll.c)
|
||||
foreach(offending_src ${sources_that_define_gnu_source})
|
||||
set_source_files_properties(${offending_src} PROPERTIES COMPILE_OPTIONS "-U_GNU_SOURCE")
|
||||
endforeach()
|
||||
|
Reference in New Issue
Block a user