Merge pull request #16 from brightray/windows-build

Get a basic Windows build working
This commit is contained in:
Adam Roben 2013-05-16 06:22:23 -07:00
commit df24a0a816
10 changed files with 89 additions and 9 deletions

2
brightray/.gitattributes vendored Normal file
View file

@ -0,0 +1,2 @@
# Auto detect text files and perform LF normalization
* text=auto

View file

@ -1,2 +1,6 @@
/brightray.opensdf
/brightray.sdf
/brightray.sln
/brightray.vcxproj*
/brightray.xcodeproj/
/build/

View file

@ -11,6 +11,15 @@ sample application written using Brightray.
## Development
### Prerequisites
* Python 2.7
* gyp
* Mac:
* Xcode
* Windows:
* Visual Studio 2010 SP1
### One-time setup
You must previously have built and uploaded libchromiumcontent using its

View file

@ -9,10 +9,12 @@
'include_dirs': [
'.',
'<(libchromiumcontent_include_dir)',
'<(libchromiumcontent_include_dir)/third_party/skia/include/config',
],
'direct_dependent_settings': {
'include_dirs': [
'<(libchromiumcontent_include_dir)',
'<(libchromiumcontent_include_dir)/third_party/skia/include/config',
],
},
'sources': [

View file

@ -31,14 +31,58 @@
],
},
'configurations': {
'Common_Base': {
'abstract': 1,
'msvs_configuration_attributes': {
'OutputDirectory': '<(DEPTH)\\build\\$(ConfigurationName)',
'IntermediateDirectory': '$(OutDir)\\obj\\$(ProjectName)',
'CharacterSet': '1',
},
},
'Debug': {
'inherit_from': [
'Common_Base',
],
'xcode_settings': {
'COPY_PHASE_STRIP': 'NO',
'GCC_OPTIMIZATION_LEVEL': '0',
},
},
'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',
},
},
}],
],
}

View file

@ -41,7 +41,7 @@ private:
};
BrowserContext::BrowserContext() : resource_context_(new ResourceContext) {
auto prefs_path = GetPath().Append("Preferences");
auto prefs_path = GetPath().Append(FILE_PATH_LITERAL("Preferences"));
PrefServiceBuilder builder;
builder.WithUserFilePrefs(prefs_path,
JsonPrefStore::GetTaskRunnerForFile(prefs_path, content::BrowserThread::GetBlockingPool()));
@ -74,7 +74,7 @@ net::URLRequestContextGetter* BrowserContext::CreateRequestContext(content::Prot
base::FilePath BrowserContext::GetPath() {
base::FilePath path;
CHECK(PathService::Get(base::DIR_APP_DATA, &path));
return path.Append(GetApplicationName());
return path.Append(base::FilePath::FromUTF8Unsafe(GetApplicationName()));
}
bool BrowserContext::IsOffTheRecord() const {

View file

@ -32,7 +32,7 @@ public:
static void RegisterPrefs(PrefRegistrySimple*);
InspectableWebContentsImpl(content::WebContents*);
virtual ~InspectableWebContentsImpl() OVERRIDE;
virtual ~InspectableWebContentsImpl();
virtual InspectableWebContentsView* GetView() const OVERRIDE;
virtual content::WebContents* GetWebContents() const OVERRIDE;

View file

@ -123,8 +123,9 @@ net::URLRequestContext* URLRequestContextGetter::GetURLRequestContext()
scoped_ptr<net::URLRequestJobFactoryImpl> job_factory(
new net::URLRequestJobFactoryImpl());
for (auto& it : protocol_handlers_) {
bool set_protocol = job_factory->SetProtocolHandler(it.first, it.second.release());
for (auto it = protocol_handlers_.begin(),
end = protocol_handlers_.end(); it != end; ++it) {
bool set_protocol = job_factory->SetProtocolHandler(it->first, it->second.release());
DCHECK(set_protocol);
}
protocol_handlers_.clear();

View file

@ -2,17 +2,35 @@
import os
import subprocess
import sys
SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
GYP = {
'darwin': 'gyp',
'win32': 'gyp.bat',
}[sys.platform]
def main():
os.chdir(SOURCE_ROOT)
subprocess.check_call(['gyp', '--depth', '.', 'brightray.gyp'])
subprocess.check_call(['xcodebuild'])
run_gyp()
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__':
import sys
sys.exit(main())

@ -1 +1 @@
Subproject commit e70a88f3323aaf1a24e36bd5449b3e1bab5c57a3
Subproject commit 4aae27b02c48decf86ad8656530d52632d6dd169