Skip to content

Commit

Permalink
Trim some dependencies for Glean C++ Windows build.
Browse files Browse the repository at this point in the history
Summary: We need to trim some dependencies out of the Clang indexer for Windows, and extend cAST to support the `select` construct.

Reviewed By: dmpolukhin

Differential Revision: D56621003

fbshipit-source-id: 554547db0eead69bed74aca07f77f920872c13e6
  • Loading branch information
mpark authored and facebook-github-bot committed Apr 30, 2024
1 parent a69dada commit e56630f
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
4 changes: 2 additions & 2 deletions glean/lang/clang/action.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

#include "glean/lang/clang/action.h"

#if GLEAN_FACEBOOK
#if GLEAN_FACEBOOK && !defined(_WIN32)
#include "glean/facebook/lang/clang/logger.h"
#include "common/fbwhoami/FbWhoAmI.h"
#else
Expand All @@ -31,7 +31,7 @@ ActionLogger::ActionLogger(const std::string& name,
enabled = log;
if (enabled) {
(*logger)
#if GLEAN_FACEBOOK
#if GLEAN_FACEBOOK && !defined(_WIN32)
.setClusterRegion(facebook::FbWhoAmI::getRegion())
#endif
.setTask(task)
Expand Down
4 changes: 2 additions & 2 deletions glean/lang/clang/action.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@

#include <folly/Optional.h>

#if GLEAN_FACEBOOK
#if GLEAN_FACEBOOK && !defined(_WIN32)
namespace facebook::logger {
class GleanClangIndexerLogger;
}
#endif

namespace facebook::glean::clangx {

#if GLEAN_FACEBOOK
#if GLEAN_FACEBOOK && !defined(_WIN32)
using Logger = facebook::logger::GleanClangIndexerLogger;
#else
class Logger {
Expand Down
10 changes: 5 additions & 5 deletions glean/lang/clang/index.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#include <folly/json/json.h>
#include <folly/Range.h>

#if GLEAN_FACEBOOK
#if GLEAN_FACEBOOK && !defined(_WIN32)
#include "common/init/Init.h"
#else
#include <folly/init/Init.h>
Expand All @@ -38,7 +38,7 @@
#include "glean/cpp/glean.h"
#include "glean/cpp/sender.h"
#include "glean/cpp/filewriter.h"
#if GLEAN_FACEBOOK
#if GLEAN_FACEBOOK && !defined(_WIN32)
#include "glean/cpp/thriftsender.h"
#endif
#include "glean/interprocess/cpp/counters.h"
Expand Down Expand Up @@ -248,7 +248,7 @@ struct Config {
}
log_pfx = folly::to<std::string>(FLAGS_worker_index) + ": ";

#if GLEAN_FACEBOOK
#if GLEAN_FACEBOOK && !defined(_WIN32)
if (!FLAGS_service.empty()) {
// Full logging if we are talking to a remote service
should_log = true;
Expand Down Expand Up @@ -635,14 +635,14 @@ int getSelfRSS() {
}

int main(int argc, char **argv) {
#if GLEAN_FACEBOOK
#if GLEAN_FACEBOOK && !defined(_WIN32)
facebook::initFacebook(&argc, &argv);
#else
folly::Init init(&argc, &argv);
#endif

std::signal(SIGTERM, [](int) {
#if GLEAN_FACEBOOK
#if GLEAN_FACEBOOK && !defined(_WIN32)
LOG(CRITICAL)
#else
LOG(ERROR)
Expand Down
2 changes: 2 additions & 0 deletions glean/lang/clang/index.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,6 @@

#pragma once

#include <gflags/gflags_declare.h>

DECLARE_bool(index_on_error);

0 comments on commit e56630f

Please sign in to comment.