Skip to content

Commit 54e9d38

Browse files
kwrobotKyleFromKitware
authored andcommitted
Refactor: Convert all instances of CMAKE_BUILD_WITH_CMAKE to CMAKE_BOOTSTRAP
1 parent ad0e44a commit 54e9d38

38 files changed

+138
-138
lines changed

Source/CPack/cpack.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#include <utility>
1212
#include <vector>
1313

14-
#if defined(_WIN32) && defined(CMAKE_BUILD_WITH_CMAKE)
14+
#if defined(_WIN32) && !defined(CMAKE_BOOTSTRAP)
1515
# include "cmsys/ConsoleBuf.hxx"
1616
#endif
1717

@@ -100,7 +100,7 @@ void cpackProgressCallback(const std::string& message, float /*unused*/)
100100
int main(int argc, char const* const* argv)
101101
{
102102
cmSystemTools::EnsureStdPipes();
103-
#if defined(_WIN32) && defined(CMAKE_BUILD_WITH_CMAKE)
103+
#if defined(_WIN32) && !defined(CMAKE_BOOTSTRAP)
104104
// Replace streambuf so we can output Unicode to console
105105
cmsys::ConsoleBuf::Manager consoleOut(std::cout);
106106
consoleOut.SetUTF8Pipes();

Source/CTest/cmCTestRunTest.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -689,7 +689,7 @@ bool cmCTestRunTest::ForkProcess(cmDuration testTimeOut, bool explicitTimeout,
689689

690690
this->TestProcess->SetTimeout(timeout);
691691

692-
#ifdef CMAKE_BUILD_WITH_CMAKE
692+
#ifndef CMAKE_BOOTSTRAP
693693
cmSystemTools::SaveRestoreEnvironment sre;
694694
#endif
695695

Source/CTest/cmCTestScriptHandler.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,7 @@ void cmCTestScriptHandler::SleepInSeconds(unsigned int secondsToWait)
495495
int cmCTestScriptHandler::RunConfigurationScript(
496496
const std::string& total_script_arg, bool pscope)
497497
{
498-
#ifdef CMAKE_BUILD_WITH_CMAKE
498+
#ifndef CMAKE_BOOTSTRAP
499499
cmSystemTools::SaveRestoreEnvironment sre;
500500
#endif
501501

Source/cmArchiveWrite.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#include <stddef.h>
1010
#include <string>
1111

12-
#if !defined(CMAKE_BUILD_WITH_CMAKE)
12+
#if defined(CMAKE_BOOTSTRAP)
1313
# error "cmArchiveWrite not allowed during bootstrap build!"
1414
#endif
1515

Source/cmCTest.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2423,7 +2423,7 @@ int cmCTest::RunCMakeAndTest(std::string* output)
24232423
cmCTestBuildAndTestHandler* handler = this->GetBuildAndTestHandler();
24242424
int retv = handler->ProcessHandler();
24252425
*output = handler->GetOutput();
2426-
#ifdef CMAKE_BUILD_WITH_CMAKE
2426+
#ifndef CMAKE_BOOTSTRAP
24272427
cmDynamicLoader::FlushCache();
24282428
#endif
24292429
if (retv != 0) {

Source/cmCommands.cxx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484
#include "cmUnsetCommand.h"
8585
#include "cmWhileCommand.h"
8686

87-
#if defined(CMAKE_BUILD_WITH_CMAKE)
87+
#if !defined(CMAKE_BOOTSTRAP)
8888
# include "cmAddCompileOptionsCommand.h"
8989
# include "cmAddLinkOptionsCommand.h"
9090
# include "cmAuxSourceDirectoryCommand.h"
@@ -210,7 +210,7 @@ void GetScriptingCommands(cmState* state)
210210
"WHILE ENDWHILE structure. Or its arguments did not "
211211
"match the opening WHILE command.");
212212

213-
#if defined(CMAKE_BUILD_WITH_CMAKE)
213+
#if !defined(CMAKE_BOOTSTRAP)
214214
state->AddBuiltinCommand(
215215
"cmake_host_system_information",
216216
cm::make_unique<cmCMakeHostSystemInformationCommand>());
@@ -301,7 +301,7 @@ void GetProjectCommands(cmState* state)
301301
cm::make_unique<cmTryCompileCommand>());
302302
state->AddBuiltinCommand("try_run", cm::make_unique<cmTryRunCommand>());
303303

304-
#if defined(CMAKE_BUILD_WITH_CMAKE)
304+
#if !defined(CMAKE_BOOTSTRAP)
305305
state->AddBuiltinCommand("add_compile_definitions",
306306
cm::make_unique<cmAddCompileDefinitionsCommand>());
307307
state->AddBuiltinCommand("add_compile_options",

Source/cmFileCommand.cxx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
#include "cm_sys_stat.h"
4848
#include "cmake.h"
4949

50-
#if defined(CMAKE_BUILD_WITH_CMAKE)
50+
#if !defined(CMAKE_BOOTSTRAP)
5151
# include "cmCurl.h"
5252
# include "cmFileLockResult.h"
5353
# include "cm_curl.h"
@@ -275,7 +275,7 @@ bool HandleReadCommand(std::vector<std::string> const& args,
275275
bool HandleHashCommand(std::vector<std::string> const& args,
276276
cmExecutionStatus& status)
277277
{
278-
#if defined(CMAKE_BUILD_WITH_CMAKE)
278+
#if !defined(CMAKE_BOOTSTRAP)
279279
if (args.size() != 3) {
280280
std::ostringstream e;
281281
e << args[0] << " requires a file name and output variable";
@@ -1426,7 +1426,7 @@ bool HandleNativePathCommand(std::vector<std::string> const& args,
14261426
return HandlePathCommand(args, ToNativePath, status);
14271427
}
14281428

1429-
#if defined(CMAKE_BUILD_WITH_CMAKE)
1429+
#if !defined(CMAKE_BOOTSTRAP)
14301430

14311431
// Stuff for curl download/upload
14321432
typedef std::vector<char> cmFileCommandVectorOfChar;
@@ -1592,7 +1592,7 @@ class cURLEasyGuard
15921592
bool HandleDownloadCommand(std::vector<std::string> const& args,
15931593
cmExecutionStatus& status)
15941594
{
1595-
#if defined(CMAKE_BUILD_WITH_CMAKE)
1595+
#if !defined(CMAKE_BOOTSTRAP)
15961596
std::vector<std::string>::const_iterator i = args.begin();
15971597
if (args.size() < 3) {
15981598
status.SetError("DOWNLOAD must be called with at least three arguments.");
@@ -1961,7 +1961,7 @@ bool HandleDownloadCommand(std::vector<std::string> const& args,
19611961
bool HandleUploadCommand(std::vector<std::string> const& args,
19621962
cmExecutionStatus& status)
19631963
{
1964-
#if defined(CMAKE_BUILD_WITH_CMAKE)
1964+
#if !defined(CMAKE_BOOTSTRAP)
19651965
if (args.size() < 3) {
19661966
status.SetError("UPLOAD must be called with at least three arguments.");
19671967
return false;
@@ -2292,7 +2292,7 @@ bool HandleGenerateCommand(std::vector<std::string> const& args,
22922292
bool HandleLockCommand(std::vector<std::string> const& args,
22932293
cmExecutionStatus& status)
22942294
{
2295-
#if defined(CMAKE_BUILD_WITH_CMAKE)
2295+
#if !defined(CMAKE_BOOTSTRAP)
22962296
// Default values
22972297
bool directory = false;
22982298
bool release = false;

Source/cmGeneratedFileStream.cxx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@
66

77
#include "cmSystemTools.h"
88

9-
#if defined(CMAKE_BUILD_WITH_CMAKE)
9+
#if !defined(CMAKE_BOOTSTRAP)
1010
# include "cm_codecvt.hxx"
1111
# include "cm_zlib.h"
1212
#endif
1313

1414
cmGeneratedFileStream::cmGeneratedFileStream(Encoding encoding)
1515
{
16-
#ifdef CMAKE_BUILD_WITH_CMAKE
16+
#ifndef CMAKE_BOOTSTRAP
1717
if (encoding != codecvt::None) {
1818
imbue(std::locale(getloc(), new codecvt(encoding)));
1919
}
@@ -32,7 +32,7 @@ cmGeneratedFileStream::cmGeneratedFileStream(std::string const& name,
3232
cmSystemTools::Error("Cannot open file for write: " + this->TempName);
3333
cmSystemTools::ReportLastSystemError("");
3434
}
35-
#ifdef CMAKE_BUILD_WITH_CMAKE
35+
#ifndef CMAKE_BOOTSTRAP
3636
if (encoding != codecvt::None) {
3737
imbue(std::locale(getloc(), new codecvt(encoding)));
3838
}
@@ -169,7 +169,7 @@ bool cmGeneratedFileStreamBase::Close()
169169
return replaced;
170170
}
171171

172-
#ifdef CMAKE_BUILD_WITH_CMAKE
172+
#ifndef CMAKE_BOOTSTRAP
173173
int cmGeneratedFileStreamBase::CompressFile(std::string const& oldname,
174174
std::string const& newname)
175175
{

Source/cmGeneratorTarget.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2526,7 +2526,7 @@ void cmGeneratorTarget::ComputeModuleDefinitionInfo(
25262526
info.WindowsExportAllSymbols =
25272527
this->Makefile->IsOn("CMAKE_SUPPORT_WINDOWS_EXPORT_ALL_SYMBOLS") &&
25282528
this->GetPropertyAsBool("WINDOWS_EXPORT_ALL_SYMBOLS");
2529-
#if defined(_WIN32) && defined(CMAKE_BUILD_WITH_CMAKE)
2529+
#if defined(_WIN32) && !defined(CMAKE_BOOTSTRAP)
25302530
info.DefFileGenerated =
25312531
info.WindowsExportAllSymbols || info.Sources.size() > 1;
25322532
#else

Source/cmGlobalGenerator.cxx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
#include "cmWorkingDirectory.h"
4545
#include "cmake.h"
4646

47-
#if defined(CMAKE_BUILD_WITH_CMAKE)
47+
#if !defined(CMAKE_BOOTSTRAP)
4848
# include "cmCryptoHash.h"
4949
# include "cmQtAutoGenGlobalInitializer.h"
5050
# include "cm_jsoncpp_value.h"
@@ -114,7 +114,7 @@ cmGlobalGenerator::~cmGlobalGenerator()
114114
this->ClearGeneratorMembers();
115115
}
116116

117-
#if defined(CMAKE_BUILD_WITH_CMAKE)
117+
#if !defined(CMAKE_BOOTSTRAP)
118118
Json::Value cmGlobalGenerator::GetJson() const
119119
{
120120
Json::Value generator = Json::objectValue;
@@ -1547,7 +1547,7 @@ bool cmGlobalGenerator::ComputeTargetDepends()
15471547

15481548
bool cmGlobalGenerator::QtAutoGen()
15491549
{
1550-
#ifdef CMAKE_BUILD_WITH_CMAKE
1550+
#ifndef CMAKE_BOOTSTRAP
15511551
cmQtAutoGenGlobalInitializer initializer(this->LocalGenerators);
15521552
return initializer.generate();
15531553
#else
@@ -2829,7 +2829,7 @@ std::set<std::string> const& cmGlobalGenerator::GetDirectoryContent(
28292829
void cmGlobalGenerator::AddRuleHash(const std::vector<std::string>& outputs,
28302830
std::string const& content)
28312831
{
2832-
#if defined(CMAKE_BUILD_WITH_CMAKE)
2832+
#if !defined(CMAKE_BOOTSTRAP)
28332833
// Ignore if there are no outputs.
28342834
if (outputs.empty()) {
28352835
return;
@@ -2859,7 +2859,7 @@ void cmGlobalGenerator::AddRuleHash(const std::vector<std::string>& outputs,
28592859

28602860
void cmGlobalGenerator::CheckRuleHashes()
28612861
{
2862-
#if defined(CMAKE_BUILD_WITH_CMAKE)
2862+
#if !defined(CMAKE_BOOTSTRAP)
28632863
std::string home = this->GetCMakeInstance()->GetHomeOutputDirectory();
28642864
std::string pfile = home;
28652865
pfile += "/CMakeFiles";
@@ -2963,7 +2963,7 @@ void cmGlobalGenerator::WriteSummary(cmGeneratorTarget* target)
29632963
file += "/Labels.txt";
29642964
std::string json_file = dir + "/Labels.json";
29652965

2966-
#ifdef CMAKE_BUILD_WITH_CMAKE
2966+
#ifndef CMAKE_BOOTSTRAP
29672967
// Check whether labels are enabled for this target.
29682968
const char* targetLabels = target->GetProperty("LABELS");
29692969
const char* directoryLabels =

Source/cmGlobalGenerator.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
#include "cmTargetDepend.h"
2626
#include "cm_codecvt.hxx"
2727

28-
#if defined(CMAKE_BUILD_WITH_CMAKE)
28+
#if !defined(CMAKE_BOOTSTRAP)
2929
# include "cmFileLockPool.h"
3030
# include "cm_jsoncpp_value.h"
3131
#endif
@@ -109,7 +109,7 @@ class cmGlobalGenerator
109109
return codecvt::None;
110110
}
111111

112-
#if defined(CMAKE_BUILD_WITH_CMAKE)
112+
#if !defined(CMAKE_BOOTSTRAP)
113113
/** Get a JSON object describing the generator. */
114114
virtual Json::Value GetJson() const;
115115
#endif
@@ -462,7 +462,7 @@ class cmGlobalGenerator
462462
const std::set<const cmGeneratorTarget*>& GetFilenameTargetDepends(
463463
cmSourceFile* sf) const;
464464

465-
#if defined(CMAKE_BUILD_WITH_CMAKE)
465+
#if !defined(CMAKE_BOOTSTRAP)
466466
cmFileLockPool& GetFileLockPool() { return FileLockPool; }
467467
#endif
468468

@@ -665,7 +665,7 @@ class cmGlobalGenerator
665665
mutable std::map<cmSourceFile*, std::set<cmGeneratorTarget const*>>
666666
FilenameTargetDepends;
667667

668-
#if defined(CMAKE_BUILD_WITH_CMAKE)
668+
#if !defined(CMAKE_BOOTSTRAP)
669669
// Pool of file locks
670670
cmFileLockPool FileLockPool;
671671
#endif

Source/cmGlobalVisualStudio7Generator.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ cmLocalGenerator* cmGlobalVisualStudio7Generator::CreateLocalGenerator(
256256
return lg;
257257
}
258258

259-
#if defined(CMAKE_BUILD_WITH_CMAKE)
259+
#if !defined(CMAKE_BOOTSTRAP)
260260
Json::Value cmGlobalVisualStudio7Generator::GetJson() const
261261
{
262262
Json::Value generator = this->cmGlobalVisualStudioGenerator::GetJson();

Source/cmGlobalVisualStudio7Generator.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class cmGlobalVisualStudio7Generator : public cmGlobalVisualStudioGenerator
2323
//! Create a local generator appropriate to this Global Generator
2424
cmLocalGenerator* CreateLocalGenerator(cmMakefile* mf) override;
2525

26-
#if defined(CMAKE_BUILD_WITH_CMAKE)
26+
#if !defined(CMAKE_BOOTSTRAP)
2727
Json::Value GetJson() const override;
2828
#endif
2929

Source/cmGlobalXCodeGenerator.cxx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,12 @@
3838

3939
struct cmLinkImplementation;
4040

41-
#if defined(CMAKE_BUILD_WITH_CMAKE) && defined(__APPLE__)
41+
#if !defined(CMAKE_BOOTSTRAP) && defined(__APPLE__)
4242
# define HAVE_APPLICATION_SERVICES
4343
# include <ApplicationServices/ApplicationServices.h>
4444
#endif
4545

46-
#if defined(CMAKE_BUILD_WITH_CMAKE)
46+
#if !defined(CMAKE_BOOTSTRAP)
4747
# include "cmXMLParser.h"
4848

4949
// parse the xml file storing the installed version of Xcode on
@@ -188,7 +188,7 @@ cmGlobalGenerator* cmGlobalXCodeGenerator::Factory::CreateGlobalGenerator(
188188
if (name != GetActualName()) {
189189
return nullptr;
190190
}
191-
#if defined(CMAKE_BUILD_WITH_CMAKE)
191+
#if !defined(CMAKE_BOOTSTRAP)
192192
cmXcodeVersionParser parser;
193193
std::string versionFile;
194194
{

Source/cmIncludeGuardCommand.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ enum IncludeGuardScope
2121
std::string GetIncludeGuardVariableName(std::string const& filePath)
2222
{
2323
std::string result = "__INCGUARD_";
24-
#ifdef CMAKE_BUILD_WITH_CMAKE
24+
#ifndef CMAKE_BOOTSTRAP
2525
result += cmSystemTools::ComputeStringMD5(filePath);
2626
#else
2727
result += cmSystemTools::MakeCidentifier(filePath);

Source/cmInstallCommand.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1268,7 +1268,7 @@ bool cmInstallCommand::HandleDirectoryMode(
12681268
bool cmInstallCommand::HandleExportAndroidMKMode(
12691269
std::vector<std::string> const& args)
12701270
{
1271-
#ifdef CMAKE_BUILD_WITH_CMAKE
1271+
#ifndef CMAKE_BOOTSTRAP
12721272
// This is the EXPORT mode.
12731273
cmInstallCommandArguments ica(this->DefaultComponentName);
12741274

Source/cmInstallExportGenerator.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#include <sstream>
88
#include <utility>
99

10-
#ifdef CMAKE_BUILD_WITH_CMAKE
10+
#ifndef CMAKE_BOOTSTRAP
1111
# include "cmExportInstallAndroidMKGenerator.h"
1212
#endif
1313
#include "cmExportInstallFileGenerator.h"
@@ -31,7 +31,7 @@ cmInstallExportGenerator::cmInstallExportGenerator(
3131
, LocalGenerator(nullptr)
3232
{
3333
if (android) {
34-
#ifdef CMAKE_BUILD_WITH_CMAKE
34+
#ifndef CMAKE_BOOTSTRAP
3535
this->EFGen = new cmExportInstallAndroidMKGenerator(this);
3636
#endif
3737
} else {

Source/cmLocalGenerator.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
#include "cmake.h"
3030
#include "cmsys/RegularExpression.hxx"
3131

32-
#if defined(CMAKE_BUILD_WITH_CMAKE)
32+
#if !defined(CMAKE_BOOTSTRAP)
3333
# define CM_LG_ENCODE_OBJECT_NAMES
3434
# include "cmCryptoHash.h"
3535
#endif

Source/cmLocalGenerator.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,7 @@ class cmLocalGenerator : public cmOutputConverter
461461
void ComputeObjectMaxPath();
462462
};
463463

464-
#if defined(CMAKE_BUILD_WITH_CMAKE)
464+
#if !defined(CMAKE_BOOTSTRAP)
465465
bool cmLocalGeneratorCheckObjectName(std::string& objName,
466466
std::string::size_type dir_len,
467467
std::string::size_type max_total_len);

Source/cmLocalUnixMakefileGenerator3.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
// Include dependency scanners for supported languages. Only the
4141
// C/C++ scanner is needed for bootstrapping CMake.
4242
#include "cmDependsC.h"
43-
#ifdef CMAKE_BUILD_WITH_CMAKE
43+
#ifndef CMAKE_BOOTSTRAP
4444
# include "cmDependsFortran.h"
4545
# include "cmDependsJava.h"
4646
#endif
@@ -1477,7 +1477,7 @@ bool cmLocalUnixMakefileGenerator3::ScanDependencies(
14771477
// TODO: Handle RC (resource files) dependencies correctly.
14781478
scanner = cm::make_unique<cmDependsC>(this, targetDir, lang, &validDeps);
14791479
}
1480-
#ifdef CMAKE_BUILD_WITH_CMAKE
1480+
#ifndef CMAKE_BOOTSTRAP
14811481
else if (lang == "Fortran") {
14821482
ruleFileStream << "# Note that incremental build could trigger "
14831483
<< "a call to cmake_copy_f90_mod on each re-build\n";

0 commit comments

Comments
 (0)