-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCompileOptions.cpp
More file actions
41 lines (34 loc) · 1.34 KB
/
CompileOptions.cpp
File metadata and controls
41 lines (34 loc) · 1.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#include "CompileOptions.hpp"
CompileOptions CompileOptions::current;
#define GCC_VERSION_STR "4.6.3"
std::pair<std::vector<const char *>, std::vector<wxCharBuffer> >
CompileOptions::GetOptions(cbProject * project)
{
static const char * globalOptions[] =
{
"-I/usr/lib64/gcc/x86_64-pc-linux-gnu/" GCC_VERSION_STR "/include", // ugly hack (libclang)
"-I/usr/lib64/gcc/x86_64-pc-linux-gnu/" GCC_VERSION_STR "/include-fixed", // ugly hack (libclang)
"-x",
"c++"
};
static const std::size_t globalOptionsCount = sizeof(globalOptions)/sizeof(globalOptions[0]);
wxMutexLocker locker(mutex);
std::vector<wxCharBuffer> charBuffers;
std::vector<const char *> options(globalOptions, globalOptions + globalOptionsCount);
wxArrayString & prOptions = compileOptions[project];
wxCharBuffer buffer;
for (unsigned i = 0; i < prOptions.GetCount(); ++i)
{
buffer = prOptions[i].utf8_str();
options.push_back(buffer.data());
charBuffers.push_back(buffer);
}
wxArrayString & btOptions = compileOptions[activeBuildTarget[project]];
for (unsigned i = 0; i < btOptions.GetCount(); ++i)
{
buffer = btOptions[i].utf8_str();
options.push_back(buffer.data());
charBuffers.push_back(buffer);
}
return std::make_pair(options, charBuffers);
}