[question] `transitive_headers` not working as expected
See original GitHub issueI have the following situation:
- I have a library
base
that depends on a libraryaudio
which depends on thedr_wav
library. - The
base
library includes theaudio.hpp
from theaudio
library which again includes thedr_wav.h
header.
So there is a transitive header dependency to dr_wav
from base
and also from the test_package
of the audio
library.
graph TD;
base-->audio;
audio-->dr_wav;
test_package_audio[audio test_package]-->audio;
base-. transitive_headers .->dr_wav;
test_package_audio-. transitive_headers .->dr_wav;
This works and builds fine when defining the dr_wav
requires in audio
with the transitive_headers
option: self.requires("drwav/0.13.7", transitive_headers=True)
But now I also have a test_package
for base
which depends transitively on the dr_wav.h
header:
graph TD;
base-->audio;
audio-->dr_wav;
test_package_base[base test_package]-->base;
test_package_base-. transitive_headers .->audio;
test_package_base-. transitive_headers .->dr_wav;
I enabled the transitive_headers
option also for the audio
library dependency in base
: self.requires("audio/1.0.0", transitive_headers=True)
Now the base test_package
can find the audio.hpp
header file, but not the dr_wav.h
.
I also checked the CMakeDeps
generated files in the test_package
and the drwav-release-x86_64-data.cmake
file does not include the header directory:
set(drwav_INCLUDE_DIRS_RELEASE )
set(drwav_RES_DIRS_RELEASE )
set(drwav_DEFINITIONS_RELEASE )
set(drwav_SHARED_LINK_FLAGS_RELEASE )
set(drwav_EXE_LINK_FLAGS_RELEASE )
set(drwav_OBJECTS_RELEASE )
set(drwav_COMPILE_DEFINITIONS_RELEASE )
set(drwav_COMPILE_OPTIONS_C_RELEASE )
set(drwav_COMPILE_OPTIONS_CXX_RELEASE )
set(drwav_LIB_DIRS_RELEASE "${drwav_PACKAGE_FOLDER_RELEASE}/lib")
set(drwav_BIN_DIRS_RELEASE )
set(drwav_LIBRARY_TYPE_RELEASE STATIC)
set(drwav_IS_HOST_WINDOWS_RELEASE 0)
set(drwav_LIBS_RELEASE dr_wav)
set(drwav_SYSTEM_LIBS_RELEASE )
set(drwav_FRAMEWORK_DIRS_RELEASE )
set(drwav_FRAMEWORKS_RELEASE )
set(drwav_BUILD_DIRS_RELEASE )
set(drwav_NO_SONAME_MODE_RELEASE FALSE)
Am I missing something or could this even be a bug? I would expect transitive headers to be transitive over more than one dependency.
- I’ve read the CONTRIBUTING guide.
EDIT:
Implementation of minimal example from above can be found here: https://github.com/Linux13524/conan-transitive-headers
Issue Analytics
- State:
- Created 10 months ago
- Comments:9 (5 by maintainers)
Top GitHub Comments
Thanks for reporting @Linux13524, the fix: https://github.com/conan-io/conan/pull/12508 was merged and will be in next beta to be released soon.
Thanks to you @Linux13524 ! Testing and giving feedback for the 2.0 is really appreciated!