Make new web api safe for bootstrap build.
This commit is contained in:
parent
c424267cc1
commit
5aad7bf2d4
@ -320,6 +320,7 @@ bool cmCTest::ShouldCompressTestOutput()
|
|||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
std::string cmCTest::GetCDashVersion()
|
std::string cmCTest::GetCDashVersion()
|
||||||
{
|
{
|
||||||
|
#ifdef CMAKE_BUILD_WITH_CMAKE
|
||||||
//First query the server. If that fails, fall back to the local setting
|
//First query the server. If that fails, fall back to the local setting
|
||||||
std::string response;
|
std::string response;
|
||||||
std::string url = "http://";
|
std::string url = "http://";
|
||||||
@ -328,6 +329,9 @@ std::string cmCTest::GetCDashVersion()
|
|||||||
int res = cmSystemTools::HTTPRequest(url, cmSystemTools::HTTP_GET, response);
|
int res = cmSystemTools::HTTPRequest(url, cmSystemTools::HTTP_GET, response);
|
||||||
|
|
||||||
return res ? this->GetCTestConfiguration("CDashVersion") : response;
|
return res ? this->GetCTestConfiguration("CDashVersion") : response;
|
||||||
|
#else
|
||||||
|
return this->GetCTestConfiguration("CDashVersion");
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
|
@ -2942,6 +2942,7 @@ HTTPResponseCallback(void *ptr, size_t size, size_t nmemb, void *data)
|
|||||||
return realsize;
|
return realsize;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef CMAKE_BUILD_WITH_CMAKE
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
int cmSystemTools::HTTPRequest(std::string url, HTTPMethod method,
|
int cmSystemTools::HTTPRequest(std::string url, HTTPMethod method,
|
||||||
std::string& response,
|
std::string& response,
|
||||||
@ -2977,3 +2978,4 @@ int cmSystemTools::HTTPRequest(std::string url, HTTPMethod method,
|
|||||||
|
|
||||||
return static_cast<int>(res);
|
return static_cast<int>(res);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
@ -46,18 +46,6 @@ public:
|
|||||||
static void ExpandRegistryValues(std::string& source,
|
static void ExpandRegistryValues(std::string& source,
|
||||||
KeyWOW64 view = KeyWOW64_Default);
|
KeyWOW64 view = KeyWOW64_Default);
|
||||||
|
|
||||||
enum HTTPMethod {
|
|
||||||
HTTP_GET,
|
|
||||||
HTTP_POST
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Perform an HTTP request.
|
|
||||||
*/
|
|
||||||
static int HTTPRequest(std::string url, HTTPMethod method,
|
|
||||||
std::string& response,
|
|
||||||
std::string fields = "", int timeout = 10);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Platform independent escape spaces, unix uses backslash,
|
* Platform independent escape spaces, unix uses backslash,
|
||||||
* windows double quotes the string.
|
* windows double quotes the string.
|
||||||
@ -354,6 +342,18 @@ public:
|
|||||||
static std::string RelativePath(const char* local, const char* remote);
|
static std::string RelativePath(const char* local, const char* remote);
|
||||||
|
|
||||||
#ifdef CMAKE_BUILD_WITH_CMAKE
|
#ifdef CMAKE_BUILD_WITH_CMAKE
|
||||||
|
enum HTTPMethod {
|
||||||
|
HTTP_GET,
|
||||||
|
HTTP_POST
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Perform an HTTP request.
|
||||||
|
*/
|
||||||
|
static int HTTPRequest(std::string url, HTTPMethod method,
|
||||||
|
std::string& response,
|
||||||
|
std::string fields = "", int timeout = 10);
|
||||||
|
|
||||||
/** Remove an environment variable */
|
/** Remove an environment variable */
|
||||||
static bool UnsetEnv(const char* value);
|
static bool UnsetEnv(const char* value);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user