Merge pull request #16 from brightray/windows-build
Get a basic Windows build working
This commit is contained in:
commit
df24a0a816
10 changed files with 89 additions and 9 deletions
2
brightray/.gitattributes
vendored
Normal file
2
brightray/.gitattributes
vendored
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
# Auto detect text files and perform LF normalization
|
||||||
|
* text=auto
|
4
brightray/.gitignore
vendored
4
brightray/.gitignore
vendored
|
@ -1,2 +1,6 @@
|
||||||
|
/brightray.opensdf
|
||||||
|
/brightray.sdf
|
||||||
|
/brightray.sln
|
||||||
|
/brightray.vcxproj*
|
||||||
/brightray.xcodeproj/
|
/brightray.xcodeproj/
|
||||||
/build/
|
/build/
|
||||||
|
|
|
@ -11,6 +11,15 @@ sample application written using Brightray.
|
||||||
|
|
||||||
## Development
|
## Development
|
||||||
|
|
||||||
|
### Prerequisites
|
||||||
|
|
||||||
|
* Python 2.7
|
||||||
|
* gyp
|
||||||
|
* Mac:
|
||||||
|
* Xcode
|
||||||
|
* Windows:
|
||||||
|
* Visual Studio 2010 SP1
|
||||||
|
|
||||||
### One-time setup
|
### One-time setup
|
||||||
|
|
||||||
You must previously have built and uploaded libchromiumcontent using its
|
You must previously have built and uploaded libchromiumcontent using its
|
||||||
|
|
|
@ -9,10 +9,12 @@
|
||||||
'include_dirs': [
|
'include_dirs': [
|
||||||
'.',
|
'.',
|
||||||
'<(libchromiumcontent_include_dir)',
|
'<(libchromiumcontent_include_dir)',
|
||||||
|
'<(libchromiumcontent_include_dir)/third_party/skia/include/config',
|
||||||
],
|
],
|
||||||
'direct_dependent_settings': {
|
'direct_dependent_settings': {
|
||||||
'include_dirs': [
|
'include_dirs': [
|
||||||
'<(libchromiumcontent_include_dir)',
|
'<(libchromiumcontent_include_dir)',
|
||||||
|
'<(libchromiumcontent_include_dir)/third_party/skia/include/config',
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
'sources': [
|
'sources': [
|
||||||
|
|
|
@ -31,14 +31,58 @@
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
'configurations': {
|
'configurations': {
|
||||||
|
'Common_Base': {
|
||||||
|
'abstract': 1,
|
||||||
|
'msvs_configuration_attributes': {
|
||||||
|
'OutputDirectory': '<(DEPTH)\\build\\$(ConfigurationName)',
|
||||||
|
'IntermediateDirectory': '$(OutDir)\\obj\\$(ProjectName)',
|
||||||
|
'CharacterSet': '1',
|
||||||
|
},
|
||||||
|
},
|
||||||
'Debug': {
|
'Debug': {
|
||||||
|
'inherit_from': [
|
||||||
|
'Common_Base',
|
||||||
|
],
|
||||||
'xcode_settings': {
|
'xcode_settings': {
|
||||||
'COPY_PHASE_STRIP': 'NO',
|
'COPY_PHASE_STRIP': 'NO',
|
||||||
'GCC_OPTIMIZATION_LEVEL': '0',
|
'GCC_OPTIMIZATION_LEVEL': '0',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
'Release': {
|
'Release': {
|
||||||
|
'inherit_from': [
|
||||||
|
'Common_Base',
|
||||||
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
'conditions': [
|
||||||
|
['OS=="win"', {
|
||||||
|
'target_defaults': {
|
||||||
|
'defines': [
|
||||||
|
'_WIN32_WINNT=0x0602',
|
||||||
|
'WINVER=0x0602',
|
||||||
|
'WIN32',
|
||||||
|
'_WINDOWS',
|
||||||
|
'NOMINMAX',
|
||||||
|
'PSAPI_VERSION=1',
|
||||||
|
'_CRT_RAND_S',
|
||||||
|
'CERT_CHAIN_PARA_HAS_EXTRA_FIELDS',
|
||||||
|
'WIN32_LEAN_AND_MEAN',
|
||||||
|
'_ATL_NO_OPENGL',
|
||||||
|
],
|
||||||
|
},
|
||||||
|
'msvs_settings': {
|
||||||
|
'VCCLCompilerTool': {
|
||||||
|
'AdditionalOptions': ['/MP'],
|
||||||
|
'MinimalRebuild': 'false',
|
||||||
|
'BufferSecurityCheck': 'true',
|
||||||
|
'EnableFunctionLevelLinking': 'true',
|
||||||
|
'RuntimeTypeInfo': 'false',
|
||||||
|
'WarningLevel': '4',
|
||||||
|
'WarnAsError': 'true',
|
||||||
|
'DebugInformationFormat': '3',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}],
|
||||||
|
],
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,7 +41,7 @@ private:
|
||||||
};
|
};
|
||||||
|
|
||||||
BrowserContext::BrowserContext() : resource_context_(new ResourceContext) {
|
BrowserContext::BrowserContext() : resource_context_(new ResourceContext) {
|
||||||
auto prefs_path = GetPath().Append("Preferences");
|
auto prefs_path = GetPath().Append(FILE_PATH_LITERAL("Preferences"));
|
||||||
PrefServiceBuilder builder;
|
PrefServiceBuilder builder;
|
||||||
builder.WithUserFilePrefs(prefs_path,
|
builder.WithUserFilePrefs(prefs_path,
|
||||||
JsonPrefStore::GetTaskRunnerForFile(prefs_path, content::BrowserThread::GetBlockingPool()));
|
JsonPrefStore::GetTaskRunnerForFile(prefs_path, content::BrowserThread::GetBlockingPool()));
|
||||||
|
@ -74,7 +74,7 @@ net::URLRequestContextGetter* BrowserContext::CreateRequestContext(content::Prot
|
||||||
base::FilePath BrowserContext::GetPath() {
|
base::FilePath BrowserContext::GetPath() {
|
||||||
base::FilePath path;
|
base::FilePath path;
|
||||||
CHECK(PathService::Get(base::DIR_APP_DATA, &path));
|
CHECK(PathService::Get(base::DIR_APP_DATA, &path));
|
||||||
return path.Append(GetApplicationName());
|
return path.Append(base::FilePath::FromUTF8Unsafe(GetApplicationName()));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool BrowserContext::IsOffTheRecord() const {
|
bool BrowserContext::IsOffTheRecord() const {
|
||||||
|
|
|
@ -32,7 +32,7 @@ public:
|
||||||
static void RegisterPrefs(PrefRegistrySimple*);
|
static void RegisterPrefs(PrefRegistrySimple*);
|
||||||
|
|
||||||
InspectableWebContentsImpl(content::WebContents*);
|
InspectableWebContentsImpl(content::WebContents*);
|
||||||
virtual ~InspectableWebContentsImpl() OVERRIDE;
|
virtual ~InspectableWebContentsImpl();
|
||||||
|
|
||||||
virtual InspectableWebContentsView* GetView() const OVERRIDE;
|
virtual InspectableWebContentsView* GetView() const OVERRIDE;
|
||||||
virtual content::WebContents* GetWebContents() const OVERRIDE;
|
virtual content::WebContents* GetWebContents() const OVERRIDE;
|
||||||
|
|
|
@ -123,8 +123,9 @@ net::URLRequestContext* URLRequestContextGetter::GetURLRequestContext()
|
||||||
|
|
||||||
scoped_ptr<net::URLRequestJobFactoryImpl> job_factory(
|
scoped_ptr<net::URLRequestJobFactoryImpl> job_factory(
|
||||||
new net::URLRequestJobFactoryImpl());
|
new net::URLRequestJobFactoryImpl());
|
||||||
for (auto& it : protocol_handlers_) {
|
for (auto it = protocol_handlers_.begin(),
|
||||||
bool set_protocol = job_factory->SetProtocolHandler(it.first, it.second.release());
|
end = protocol_handlers_.end(); it != end; ++it) {
|
||||||
|
bool set_protocol = job_factory->SetProtocolHandler(it->first, it->second.release());
|
||||||
DCHECK(set_protocol);
|
DCHECK(set_protocol);
|
||||||
}
|
}
|
||||||
protocol_handlers_.clear();
|
protocol_handlers_.clear();
|
||||||
|
|
|
@ -2,17 +2,35 @@
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import subprocess
|
import subprocess
|
||||||
|
import sys
|
||||||
|
|
||||||
|
|
||||||
SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
|
SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
|
||||||
|
GYP = {
|
||||||
|
'darwin': 'gyp',
|
||||||
|
'win32': 'gyp.bat',
|
||||||
|
}[sys.platform]
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
os.chdir(SOURCE_ROOT)
|
os.chdir(SOURCE_ROOT)
|
||||||
subprocess.check_call(['gyp', '--depth', '.', 'brightray.gyp'])
|
run_gyp()
|
||||||
subprocess.check_call(['xcodebuild'])
|
build()
|
||||||
|
|
||||||
|
|
||||||
|
def run_gyp():
|
||||||
|
subprocess.check_call([GYP, '--depth', '.', 'brightray.gyp'])
|
||||||
|
|
||||||
|
|
||||||
|
def build():
|
||||||
|
if sys.platform == 'darwin':
|
||||||
|
subprocess.check_call(['xcodebuild'])
|
||||||
|
return
|
||||||
|
|
||||||
|
assert sys.platform == 'win32', sys.platform
|
||||||
|
msbuild = os.path.join(os.environ['windir'], 'Microsoft.NET', 'Framework', 'v4.0.30319', 'MSBuild.exe')
|
||||||
|
subprocess.check_call([msbuild, 'brightray.sln'])
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
import sys
|
|
||||||
sys.exit(main())
|
sys.exit(main())
|
||||||
|
|
2
brightray/vendor/libchromiumcontent
vendored
2
brightray/vendor/libchromiumcontent
vendored
|
@ -1 +1 @@
|
||||||
Subproject commit e70a88f3323aaf1a24e36bd5449b3e1bab5c57a3
|
Subproject commit 4aae27b02c48decf86ad8656530d52632d6dd169
|
Loading…
Add table
Add a link
Reference in a new issue