Library Targets Include Directories Broken
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 45/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Estancado
- Stack tecnológico
- cmake, cpp
- Área
- build-system
Línea de trabajo
Comienza en cmake/draco_targets.cmake, en la definición de draco_add_library y en las llamadas a target_include_directories alrededor de las líneas 226, 319 y 323. Revisa cómo se genera draco/draco_features.h y cómo se consumen los targets como subproyectos o bibliotecas instaladas. El trabajo estará terminado cuando las rutas de inclusión funcionen correctamente tanto durante la compilación como durante la instalación, y las macros de características estén disponibles para los consumidores de la biblioteca.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Hi folks, when using the draco library as a subproject, or with CMake's FetchContent/ExternalProject machinery, the draco includes are broken. This stems from the definition of the draco_add_library macro. Specifically, on line 226, the library target has the INSTALL_INTERFACE set at the include directory of the install folder. This works as intended. However, the BUILD_INTERFACE is not set at any point. Instead on lines 319 and 323 target_include_directories is called again to provide private and public directories, those these are not restricted to build time.
Now, my CMake experience does not include using macro wrappers around the typical target oriented machinery. Instead I am used to the modern CMake style of generator expressions. I worry that producing a large pull request reworking the CMake would not be accepted as it would be difficult to review.
So here is how I would address the issue: All of the library targets use the same build and install include directories. I would replace the referenced lines by the singular block:
target_include_directories(${lib_NAME} PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/src/>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/>
)
Now this doesn't address the generated draco/draco_features.h header, at least at build time. This CMake generated header defines a set of macros describing which features are supported. Instead this should be handled using the target_compile_definitions machinery. By setting these values publicly on the targets, both consumers of the installed library and the build time library will have those macros defined. The header can still be generated for backwards compatibility purposes as well.
- Lenguaje dominante
- C++
- Estrellas
- 7.5k
- Forks
- 1.1k
- Merge medio
- 23 h 57 min
- PR fusionados (30 d)
- 3
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de google/draco
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
-
documentation low priority
Dificultad 1/5 Menos de una hora Aptitud para principiantes 68/100
-
Test failures on big-endianAbierto
Dificultad 4/5 3-5 días Aptitud para principiantes 43/100
Todos los issues de google/draco
Issues similares
-
zq prints a raw SQL 'no such table: index_default' error when the index has no default indexAbiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 73/100
mattgodbolt/zindex#67 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100
NKI-AI/fastslide#105 · 2 comentarios ·
Los mantenedores suelen responder en 3 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
DarkCastleMUD/DarkCastle#283 ·
-
Toggle state is unclearAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100