summaryrefslogtreecommitdiff
path: root/buildscripts
diff options
context:
space:
mode:
authorMark Benvenuto <mark.benvenuto@mongodb.com>2023-04-17 16:35:56 -0400
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2023-04-19 16:56:51 +0000
commit1c098f8ef65d3ed088b8d29fb0a36ed5ba72f2cd (patch)
tree33fa781c75e17b9c671f6ab5ded3c168148e8852 /buildscripts
parentc502b2f1154cdf064e890811d3cbe057e8c75214 (diff)
downloadmongo-1c098f8ef65d3ed088b8d29fb0a36ed5ba72f2cd.tar.gz
SERVER-75847 Optimize includes in IDL generated files
Diffstat (limited to 'buildscripts')
-rw-r--r--buildscripts/idl/idl/generator.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/buildscripts/idl/idl/generator.py b/buildscripts/idl/idl/generator.py
index 26792609546..93ddb01dcc6 100644
--- a/buildscripts/idl/idl/generator.py
+++ b/buildscripts/idl/idl/generator.py
@@ -3026,11 +3026,13 @@ class _CppSourceFileWriter(_CppFileWriterBase):
self.write_empty_line()
# Generate mongo includes third
- header_list = [
- 'mongo/bson/bsonobjbuilder.h', 'mongo/db/auth/authorization_contract.h',
- 'mongo/db/commands.h', 'mongo/idl/command_generic_argument.h',
- 'mongo/util/overloaded_visitor.h'
- ]
+ header_list = ['mongo/util/overloaded_visitor.h']
+
+ if spec.commands:
+ header_list.append('mongo/db/auth/authorization_contract.h')
+ header_list.append('mongo/idl/command_generic_argument.h')
+ elif len([s for s in spec.structs if s.is_command_reply]) > 0:
+ header_list.append('mongo/idl/command_generic_argument.h')
if spec.server_parameters:
header_list.append('mongo/db/server_parameter.h')