Windows should distinguish between CFLAGS and CXXFLAGS
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- C
- Estrellas
- 40.4k
- Forks
- 8.1k
- Merge medio
- 2 d 13 h
- PR fusionados (30 d)
- 96
Descripción
Description
So far this is not a big problem: .c and .cpp files are passed to cl.exe (or clang-cl.exe), and the compiler figures our whether to compile as C or C++ according to the file extension. Always passing the same flags is also not an issue.
Enter newer C/C++ standards: recent versions of ICU require C++17, so ext/intl passes /std:c++17. cl.exe is still fine with this, but clang-cl.exe (18.1.8) complains about an unused argument when compiling .c files of ext/intl. Not a big deal. Now php-src requires C11, so I tried passing /std:c11. Besides hitting #17107, that generally works fine (get a warning in xxhash.h). However, when trying to build ext/intl, MSVC errors, reporting incompatible /std flags.
Thus I think we need at least a minimum support for CXXFLAGS. Full fledged support might be overkill, and likely raises issues with some external extensions. I'm not really sure how to support this, though. Ideas welcome!
Note that such support would be an issue for /MP enabled builds. Currently, these pass all source files added via a single ADD_SOURCES() call to the compiler in one go. Passing individual files basically circumvents /MP. If we split the sets (C files vs. C++ files), that would reduce the usefulness of /MP. Not a big deal for php-src, but might be some problem for external extensions.
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.
Línea de trabajo
No se nombra ningún archivo ni prueba. Empieza por rastrear el manejo de las opciones del compilador de Windows y el punto de entrada ADD_SOURCES(); determina cómo se pasan los grupos de código fuente C y C++ a cl.exe o clang-cl.exe. Se considera terminado cuando CFLAGS y CXXFLAGS pueden diferir sin /std-Flags incompatibles y se aborda la contrapartida documentada de /MP.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- c, cpp
- Área
- build-system
- Tipo de issue
- Nueva funcionalidad
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 35/100