Skip to content

Commit 6dd494f

Browse files
#231 Compile database may content response files (#305)
* #231 Compile database may content response files - add cmake options: -DCMAKE_{ASM,C,CPP}_USE_RESPONSE_FILE_FOR_INCLUDES=OFF -DCMAKE_{ASM,C,CPP}_USE_RESPONSE_FILE_FOR_OBJECTS=OFF -DCMAKE_{ASM,C,CPP}_USE_RESPONSE_FILE_FOR_LIBRARIES=OFF * Update UserProjectConfiguration.cpp Co-authored-by: Vladislav Kalugin <[email protected]>
1 parent 920a8f6 commit 6dd494f

File tree

1 file changed

+24
-3
lines changed

1 file changed

+24
-3
lines changed

server/src/building/UserProjectConfiguration.cpp

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
#include "environment/EnvironmentPaths.h"
55
#include "tasks/ShellExecTask.h"
66
#include "utils/Copyright.h"
7-
#include "utils/FileSystemUtils.h"
87
#include "utils/ExecUtils.h"
8+
#include "utils/FileSystemUtils.h"
99
#include "utils/LogUtils.h"
1010
#include "utils/MakefileUtils.h"
1111
#include "utils/StringUtils.h"
@@ -32,6 +32,19 @@ Status UserProjectConfiguration::RunBuildDirectoryCreation(const fs::path &build
3232
return Status::OK;
3333
}
3434

35+
static const std::vector<std::string> CMAKE_MANDATORY_OPTIONS = {
36+
"-DCMAKE_ASM_USE_RESPONSE_FILE_FOR_INCLUDES=OFF",
37+
"-DCMAKE_C_USE_RESPONSE_FILE_FOR_INCLUDES=OFF",
38+
"-DCMAKE_CXX_USE_RESPONSE_FILE_FOR_INCLUDES=OFF",
39+
40+
"-DCMAKE_ASM_USE_RESPONSE_FILE_FOR_OBJECTS=OFF",
41+
"-DCMAKE_C_USE_RESPONSE_FILE_FOR_OBJECTS=OFF",
42+
"-DCMAKE_CXX_USE_RESPONSE_FILE_FOR_OBJECTS=OFF",
43+
44+
"-DCMAKE_ASM_USE_RESPONSE_FILE_FOR_LIBRARIES=OFF",
45+
"-DCMAKE_C_USE_RESPONSE_FILE_FOR_LIBRARIES=OFF",
46+
"-DCMAKE_CXX_USE_RESPONSE_FILE_FOR_LIBRARIES=OFF",
47+
};
3548

3649
Status
3750
UserProjectConfiguration::RunProjectConfigurationCommands(const fs::path &buildDirPath,
@@ -40,8 +53,16 @@ UserProjectConfiguration::RunProjectConfigurationCommands(const fs::path &buildD
4053
ProjectConfigWriter const &writer) {
4154
try {
4255
fs::path bearShPath = createBearShScript(buildDirPath);
43-
cmakeOptions.emplace_back("..");
44-
ShellExecTask::ExecutionParameters cmakeParams(Paths::getCMake(), cmakeOptions);
56+
57+
std::vector<std::string> cmakeOptionsWithMandatory = CMAKE_MANDATORY_OPTIONS;
58+
for (const std::string &op : cmakeOptions) {
59+
if (op.find("_USE_RESPONSE_FILE_FOR_") == std::string::npos) {
60+
cmakeOptionsWithMandatory.emplace_back(op);
61+
}
62+
}
63+
cmakeOptionsWithMandatory.emplace_back("..");
64+
65+
ShellExecTask::ExecutionParameters cmakeParams(Paths::getCMake(), cmakeOptionsWithMandatory);
4566
ShellExecTask::ExecutionParameters bearMakeParams(Paths::getBear(),
4667
{Paths::getMake(), MakefileUtils::threadFlag()});
4768

0 commit comments

Comments
 (0)