blob: 9044a50889c2e8e0e4177cb3106c33317e79dd5d [file] [log] [blame]
Nathan Harmatabf98f392016-01-07 22:58:29 +00001// Copyright 2016 The Bazel Authors. All rights reserved.
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
Thiago Farina676cb9f2016-10-06 11:00:43 +000015// global_variables.h: The global state in the blaze.cc Blaze client.
Nathan Harmatabf98f392016-01-07 22:58:29 +000016//
17
Thiago Farina676cb9f2016-10-06 11:00:43 +000018#ifndef BAZEL_SRC_MAIN_CPP_GLOBAL_VARIABLES_H_
19#define BAZEL_SRC_MAIN_CPP_GLOBAL_VARIABLES_H_
Nathan Harmatabf98f392016-01-07 22:58:29 +000020
Nathan Harmatabf98f392016-01-07 22:58:29 +000021#include <sys/types.h>
22#include <string>
23#include <vector>
24
Laszlo Csomor3b89d2d2016-11-28 14:04:27 +000025#include "src/main/cpp/util/port.h" // pid_t on Windows/MSVC
26
Nathan Harmatabf98f392016-01-07 22:58:29 +000027namespace blaze {
28
Thiago Farina676cb9f2016-10-06 11:00:43 +000029class StartupOptions;
30
Nathan Harmatabf98f392016-01-07 22:58:29 +000031struct GlobalVariables {
michajloce5e7182019-06-03 13:16:41 -070032 GlobalVariables();
Thiago Farina676cb9f2016-10-06 11:00:43 +000033
michajlof74f9fe2018-01-29 09:06:44 -080034 // Whrere to write the server's JVM's output. Default value is
35 // <output_base>/server/jvm.out.
36 std::string jvm_log_file;
37
38 // Whether or not the jvm_log_file should be opened with O_APPEND.
39 bool jvm_log_file_append;
Nathan Harmatabf98f392016-01-07 22:58:29 +000040
jingwen68c57f02018-11-21 16:17:17 -080041 // TODO(laszlocsomor) 2016-11-28: move pid_t usage out of here and wherever
Laszlo Csomor3b89d2d2016-11-28 14:04:27 +000042 // else it appears. Find some way to not have to declare a pid_t here, either
43 // by making PID handling platform-independent or some other idea.
Nathan Harmatabf98f392016-01-07 22:58:29 +000044 pid_t server_pid;
Nathan Harmatabf98f392016-01-07 22:58:29 +000045};
46
47} // namespace blaze
Thiago Farina319fd3a2016-01-14 19:42:24 +000048
Thiago Farina676cb9f2016-10-06 11:00:43 +000049#endif // BAZEL_SRC_MAIN_CPP_GLOBAL_VARIABLES_H_