https://github.com/Kitware/CMake
Revision 209b896f2c5e7c12e5a75a572469517a298081b2 authored by Brad King on 17 November 2021, 15:35:12 UTC, committed by Brad King on 17 November 2021, 15:41:30 UTC
The Makefile generators use an internal `cmake -E cmake_copy_f90_mod`
tool to avoid rebuilding module consumers when the `.mod` content
changes only in a trivial way (e.g. the time it was built).  This is
done with logic specific to each vendor's module file format.  Enable
the "Intel" format support when using the IntelLLVM compiler (ifx) too.

Issue: #22922
1 parent 09ef62f
Raw File
Tip revision: 209b896f2c5e7c12e5a75a572469517a298081b2 authored by Brad King on 17 November 2021, 15:35:12 UTC
IntelLLVM: Enable Fortran module rebuild avoidance in Makefile generators
Tip revision: 209b896
cmXCOFF.h
/* Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
   file Copyright.txt or https://cmake.org/licensing for details.  */
#pragma once

#include "cmConfigure.h" // IWYU pragma: keep

#include <iosfwd>
#include <memory>
#include <string>

#include <cm/optional>
#include <cm/string_view>

#if !defined(CMake_USE_XCOFF_PARSER)
#  error "This file may be included only if CMake_USE_XCOFF_PARSER is enabled."
#endif

class cmXCOFFInternal;

/** \class cmXCOFF
 * \brief XCOFF parser.
 */
class cmXCOFF
{
public:
  enum class Mode
  {
    ReadOnly,
    ReadWrite
  };

  /** Construct with the name of the XCOFF input file to parse.  */
  cmXCOFF(const char* fname, Mode = Mode::ReadOnly);

  /** Destruct.   */
  ~cmXCOFF();

  cmXCOFF(cmXCOFF&&);
  cmXCOFF(cmXCOFF const&) = delete;
  cmXCOFF& operator=(cmXCOFF&&);
  cmXCOFF& operator=(cmXCOFF const&) = delete;

  /** Get the error message if any.  */
  std::string const& GetErrorMessage() const { return this->ErrorMessage; }

  /** Boolean conversion.  True if the XCOFF file is valid.  */
  explicit operator bool() const { return this->Valid(); }

  /** Get the LIBPATH (RPATH) parsed from the file, if any.  */
  cm::optional<cm::string_view> GetLibPath() const;

  /** Set the LIBPATH (RPATH).
      Works only if cmXCOFF was constructed with Mode::ReadWrite.  */
  bool SetLibPath(cm::string_view libPath);

  /** Remove the LIBPATH (RPATH).
      Works only if cmXCOFF was constructed with Mode::ReadWrite.  */
  bool RemoveLibPath();

private:
  friend class cmXCOFFInternal;
  bool Valid() const;
  std::unique_ptr<cmXCOFFInternal> Internal;
  std::string ErrorMessage;
};
back to top