cmake/Source/cmCoreTryCompile.h

57 lines
1.6 KiB
C
Raw Normal View History

2016-10-30 18:24:19 +01:00
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
#ifndef cmCoreTryCompile_h
#define cmCoreTryCompile_h
2017-07-20 19:35:53 +02:00
#include "cmConfigure.h" // IWYU pragma: keep
2017-04-14 19:02:05 +02:00
#include <string>
#include <vector>
#include "cmCommand.h"
2017-04-14 19:02:05 +02:00
#include "cmStateTypes.h"
/** \class cmCoreTryCompile
* \brief Base class for cmTryCompileCommand and cmTryRunCommand
*
* cmCoreTryCompile implements the functionality to build a program.
* It is the base class for cmTryCompileCommand and cmTryRunCommand.
*/
class cmCoreTryCompile : public cmCommand
{
public:
2016-07-09 11:21:54 +02:00
protected:
/**
* This is the core code for try compile. It is here so that other
* commands, such as TryRun can access the same logic without
2012-02-18 12:40:36 +02:00
* duplication.
*/
2016-07-09 11:21:54 +02:00
int TryCompileCode(std::vector<std::string> const& argv, bool isTryRun);
2012-02-18 12:40:36 +02:00
/**
* This deletes all the files created by TryCompileCode.
* This way we do not have to rely on the timing and
* dependencies of makefiles.
*/
2018-04-23 21:13:27 +02:00
void CleanupFiles(std::string const& binDir);
2012-02-18 12:40:36 +02:00
/**
* This tries to find the (executable) file created by
TryCompileCode. The result is stored in OutputFile. If nothing is found,
the error message is stored in FindErrorMessage.
*/
2016-07-09 11:21:54 +02:00
void FindOutputFile(const std::string& targetName,
2017-04-14 19:02:05 +02:00
cmStateEnums::TargetType targetType);
2012-02-18 12:40:36 +02:00
std::string BinaryDirectory;
std::string OutputFile;
std::string FindErrorMessage;
bool SrcFileSignature;
2017-04-14 19:02:05 +02:00
private:
std::vector<std::string> WarnCMP0067;
std::string LookupStdVar(std::string const& var, bool warnCMP0067);
};
#endif