-
- Downloads
Compiler flag handlers (#6415)
This adds the ability for packages to apply compiler flags in one of three ways: by injecting them into the compiler wrapper calls (the default in this PR and previously the only automated choice); exporting environment variable definitions for variables with corresponding names (e.g. CPPFLAGS=...); providing them as arguments to the build system (e.g. configure). When applying compiler flags using build system arguments, a package must implement the 'flags_to_build_system_args" function. This is provided for CMake and autotools packages, so for packages which subclass those build systems, they need only update their flag handler method specify which compiler flags should be specified as arguments to the build system. Convenience methods are provided to specify that all flags be applied in one of the 3 available ways, so a custom implementation is only required if more than one method of applying compiler flags is needed. This also removes redundant build system definitions from tutorial examples
Showing
- lib/spack/docs/packaging_guide.rst 71 additions, 65 deletionslib/spack/docs/packaging_guide.rst
- lib/spack/docs/tutorial/examples/Autotools/autotools_class.py 0 additions, 460 deletions...spack/docs/tutorial/examples/Autotools/autotools_class.py
- lib/spack/docs/tutorial/examples/Cmake/cmake_class.py 0 additions, 224 deletionslib/spack/docs/tutorial/examples/Cmake/cmake_class.py
- lib/spack/docs/tutorial/examples/Makefile/makefile_class.py 0 additions, 129 deletionslib/spack/docs/tutorial/examples/Makefile/makefile_class.py
- lib/spack/docs/tutorial/examples/PyPackage/python_package_class.py 0 additions, 399 deletions.../docs/tutorial/examples/PyPackage/python_package_class.py
- lib/spack/docs/tutorial_buildsystems.rst 4 additions, 4 deletionslib/spack/docs/tutorial_buildsystems.rst
- lib/spack/spack/build_environment.py 20 additions, 17 deletionslib/spack/spack/build_environment.py
- lib/spack/spack/build_systems/autotools.py 13 additions, 10 deletionslib/spack/spack/build_systems/autotools.py
- lib/spack/spack/build_systems/cmake.py 41 additions, 10 deletionslib/spack/spack/build_systems/cmake.py
- lib/spack/spack/package.py 41 additions, 0 deletionslib/spack/spack/package.py
- lib/spack/spack/test/cc.py 6 additions, 2 deletionslib/spack/spack/test/cc.py
- lib/spack/spack/test/flag_handlers.py 176 additions, 0 deletionslib/spack/spack/test/flag_handlers.py
Loading
Please register or sign in to comment