summaryrefslogtreecommitdiffstats
path: root/Modules/FortranCInterface/Detect.cmake
Commit message (Collapse)AuthorAgeFilesLines
* Modules: Drop redundant check logging to CMakeOutput.log and CMakeError.logBrad King2023-01-181-4/+2
| | | | | | | | | | `try_compile` and `try_run` now automatically log checks using them to `CMakeConfigureLog.yaml`. Add `LOG_DESCRIPTION` arguments to some `try_compile` calls to replace the description previously written to the old logs. Issue: #23200
* Modules: Use new keyword-dispatched try_compile signatureMatthew Woehlke2022-09-161-4/+4
| | | | | | Modify modules that ship with CMake and use the project flavor of try_compile to use the new signature added by commit 56ae40cc59 (try_compile: Add PROJECT keyword-dispatched signature, 2022-09-14).
* FortranCInterface: Add support for LLVMFlang manglingGilles Gouaillardet2022-09-091-3/+3
| | | | | | | | | | | | | | | | | | | The following `module.f90` file module mymodule contains subroutine mysub() end subroutine end module when compiled with `flang-new` (from LLVM 15.0.0) generate the `_QMmymodulePmysub` symbol. $ flang-new -c module.f90 $ nm module.o 0000000000000000 T _QMmymodulePmysub This commit fixes the regular expressions accordingly.
* FortranCInterface: Fix mangling detection for x86_64 on arm64 macOSBrad King2022-02-111-0/+10
| | | | Fixes: #23218
* FortranCInterface: Fix regression in timestamp checkSeth R Johnson2021-10-011-2/+1
| | | | | | | | | Since commit d7c8030541 (FortranCInterface: Fix misuse of IS_NEWER_THAN in timestamp check, 2021-02-21, v3.21.0-rc1~631^2~3), FortranCInterface checks for `Output.cmake.in` in the build tree instead of the source tree as before. This caused it to always re-run the detection. Fixes: #22709
* FortranCInterface: Fix misuse of IS_NEWER_THAN in timestamp checkCraig Scott2021-02-221-8/+11
| | | | | | | When using a file system which only has second resolution timestamps, there is a reasonably high likelihood of timestamps being the same. The IS_NEWER_THAN test returns true when timestamps are the same, so don't redo detection when they match exactly.
* FortranCInterface: Honor CMAKE_EXE_LINKER_FLAGS under CMP0056Brad King2020-11-101-0/+10
| | | | | | | | | | Policy CMP0056 determines whether `CMAKE_EXE_LINKER_FLAGS` are passed into the test project used by the source-file signature of `try_compile`. That affects how implicit link directories are detected, so we need to also honor the policy for the source-directory signature of `try_compile` used in FortranCInterface in order to get matching link directories. Fixes: #21408
* FortranCInterface: Fix broken search for test exe when cross-compilingBrad King2020-02-271-8/+2
| | | | | | | | | Previously the `find_program` call we used to locate the test executable but that can be broken by `CMAKE_FIND_ROOT_PATH_MODE_PROGRAM`. Instead teach the test project to write a file with the location of the executable it builds. Load that file to get the exact location. Fixes: #20390
* Refactor: Use added message types in various modulesAlex Turbov2019-11-021-2/+4
| | | | Co-Authored-By: Craig Scott <craig.scott@crascit.com>
* FortranCInt: Pass CONFIG flags to try_compileChristian Pfeiffer2017-05-061-1/+4
| | | | | | This change ensures that Intel Fortran's /libs: in CMAKE_Fortran_FLAGS and Visual C++'s /MT or /MD in the CMAKE_C_FLAGS_RELEASE do not conflict with each other.
* FortranCInterface: Fix support for VS with Intel toolsetBrad King2017-02-011-1/+2
| | | | | | | | | | | | | | | When using a Visual Studio generator with an Intel toolset, such as -T "Intel C++ Compiler XE 14.0" the generated FortranCInterface mangling detection project may fail to build due to `devenv` not working with the `/project ALL_BUILD` option. This seems to be a bug in `devenv` or the Intel VS integration. Work around the problem by building with `/project FortranCInterface` instead. We only need to build this executable and its dependencies within the detection test project anyway. Fixes: #16519
* Simplify CMake per-source license noticesBrad King2016-09-271-10/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Per-source copyright/license notice headers that spell out copyright holder names and years are hard to maintain and often out-of-date or plain wrong. Precise contributor information is already maintained automatically by the version control tool. Ultimately it is the receiver of a file who is responsible for determining its licensing status, and per-source notices are merely a convenience. Therefore it is simpler and more accurate for each source to have a generic notice of the license name and references to more detailed information on copyright holders and full license terms. Our `Copyright.txt` file now contains a list of Contributors whose names appeared source-level copyright notices. It also references version control history for more precise information. Therefore we no longer need to spell out the list of Contributors in each source file notice. Replace CMake per-source copyright/license notice headers with a short description of the license and links to `Copyright.txt` and online information available from "https://cmake.org/licensing". The online URL also handles cases of modules being copied out of our source into other projects, so we can drop our notices about replacing links with full license text. Run the `Utilities/Scripts/filter-notices.bash` script to perform the majority of the replacements mechanically. Manually fix up shebang lines and trailing newlines in a few files. Manually update the notices in a few files that the script does not handle.
* Use a more reliable regex for extracting binary INFO stringsChuck Atkins2014-09-031-1/+1
| | | | | | | A few different regular expressions were being used in various places to extract info strings from binaries. This uses a consistent regex amongst all of them now. This also fixes the broken ABI detection for Cray compilers.
* Clean up usage of if(... MATCHES regex) followed string(REGEX REPLACE regex)Rolf Eike Beer2014-04-141-3/+2
| | | | | | The matches have already been calculated and can simply be taken from CMAKE_MATCH_n variables. This avoids multiple compilations of the same or very similar regular expressions.
* FortranCInterface: Fix cross-compiling Linux to MinGW (#14358)Michel Zou2013-08-141-1/+1
| | | | | | | | | After building the test binary tell find_program to search for it with the ${CMAKE_EXECUTABLE_SUFFIX} so that the .exe can be found. Since find_program is normally used to locate host tools while cross-compiling it needs this hint to find the target binary. Suggested-by: Denis Barbier <bouzim@gmail.com>
* Remove CMake-language block-end command argumentsKitware Robot2012-08-131-1/+1
| | | | | | | | | | | | | | | | | Ancient versions of CMake required else(), endif(), and similar block termination commands to have arguments matching the command starting the block. This is no longer the preferred style. Run the following shell code: for c in else endif endforeach endfunction endmacro endwhile; do echo 's/\b'"$c"'\(\s*\)(.\+)/'"$c"'\1()/' done >convert.sed && git ls-files -z -- bootstrap '*.cmake' '*.cmake.in' '*CMakeLists.txt' | egrep -z -v '^(Utilities/cm|Source/kwsys/)' | egrep -z -v 'Tests/CMakeTests/While-Endwhile-' | xargs -0 sed -i -f convert.sed && rm convert.sed
* FortranCInterface: Support '=' in language flagsBrad King2009-12-151-2/+2
| | | | | | | | The commit "FortranCInterface: Honor language flags in checks" taught the FortranCInterface module to pass C and Fortran flags into its detection and verification checks. We improve on the change to allow the '=' character in the language flags. This requires passing the cache entry type with the -D options.
* FortranCInterface: Honor language flags in checksBrad King2009-11-191-0/+3
| | | | | | | We pass CMAKE_C_FLAGS, CMAKE_CXX_FLAGS, and CMAKE_Fortran_FLAGS through try_compile() for the FortranCInterface Detect and Verify projects. This honors user-specified compiler flags for each language, thus supporting flags that affect the Fortran mangling.
* Convert CMake non-find modules to BSD LicenseBrad King2009-09-281-0/+11
| | | | | | | This adds copyright/license notification blocks CMake's non-find modules. Most of the modules had no notices at all. Some had notices referring to the BSD license already. This commit normalizes existing notices and adds missing notices.
* Create FortranCInterface_VERIFY functionBrad King2009-08-241-0/+4
| | | | | | | This function builds a simple test project using a combination of Fortran and C (and optionally C++) to verify that the compilers are compatible. The idea is to help projects report very early to users that the compilers specified cannot mix languages.
* Teach FortranCInterface to load outside resultsBrad King2009-08-241-0/+165
We split the main detection logic into a Detect.cmake support module and load it only when detection results are not already available. This allows results computed by the main project to be used in try-compile projects without recomputing them. The call to try_compile() need only to pass FortranCInterface_BINARY_DIR through the CMAKE_FLAGS option.