mirror of
https://github.com/Kitware/CMake.git
synced 2026-02-22 15:10:20 -06:00
Currently cmake is only setting CMAKE_Fortran_IMPLICIT_INCLUDE_DIRECTORIES the first time it runs (the implicit includes parser is only run when the cache variables are initially populated). It is left unset during additional runs. This behavior is both confusing and inconsistent. Modify CMakeFortranCompiler.cmake.in to preserve the value of CMAKE_Fortran_IMPLICIT_INCLUDE_DIRECTORIES so that cmake's Fortran behavior matches C and CXX (i.e. CMAKE_Fortran_IMPLICIT_INCLUDE_DIRECTORIES retains its value across runs). The implicit includes variable may not be as useful for Fortran as it is for C and CXX, but we do want cmake to be consistent in how it is handled. Adjust CMakeParseImplicitIncludeInfo to parse verbose Fortran output for Cray and XL compiler IDs (GNU and clang were already ok since they use the same verbose output format as they do with C/CXX). Allow Tests/RunCMake/ParseImplicitIncludeInfo/data/CMakeLists.txt to generate test inputs for Fortran too, and add some sample Fortran input files for the Tests/RunCMake/ParseImplicitIncludeInfo test.
26 lines
1.2 KiB
Plaintext
26 lines
1.2 KiB
Plaintext
This directory contains sample input files for the implicit include
|
|
directories parser for testing. For each configuration there is one
|
|
".input" file and one ".output" file.
|
|
|
|
To generate ".input" files for a system, create a temporary build
|
|
directory and chdir to it. Then run cmake pointing to this directory.
|
|
The CMakeLists.txt file here will generate ".input" files in your
|
|
build directory. The default set of languages is C and CXX. This
|
|
can be changed with -DLANGUAGES=language_list. For example:
|
|
-DLANGUAGES=Fortran will generate Fortran parser input.
|
|
|
|
The ".output" files should be generated by hand from the input files.
|
|
The test will compare the parser output to the manually generated
|
|
".output" file. The two should match.
|
|
|
|
For compilers that support "-nostdinc"-like flags, you can generate
|
|
a test for this with a command like:
|
|
cmake -DUNAME=netbsd_nostdinc \
|
|
-DCMAKE_C_FLAGS=-nostdinc -DCMAKE_CXX_FLAGS=-nostdinc .
|
|
|
|
Here is an example for testing the XL compiler with both -I and nostdinc:
|
|
|
|
env CC=xlc CXX=xlC cmake -DUNAME=linux_nostdinc_i \
|
|
-DCMAKE_C_FLAGS='-qnostdinc -I/tmp/ii/test_c' \
|
|
-DCMAKE_CXX_FLAGS='-qnostdinc -I/tmp/ii/test_c -I/tmp/ii/test_cxx' .
|