Commit 0cc33b9c authored by binji@chromium.org's avatar binji@chromium.org

[NaCl SDK] Don't copy .h files to src in SDK.

build_sdk.py: Also added --libraries to build only libraries.
generate_make.py: Added HEADERS tag and HEADERS_DEST to .dsc file to allow a 
library to specify public headers and a place to install them.

BUG=none
TEST=none
R=noelallen@chromium.org
NOTRY=true


Review URL: https://chromiumcodereview.appspot.com/10823016

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@148455 0039d316-1c4b-4281-b951-d872f2087c98
parent 4b8003cd
...@@ -749,6 +749,7 @@ def main(args): ...@@ -749,6 +749,7 @@ def main(args):
if options.only_examples: if options.only_examples:
BuildStepCopyExamples(pepperdir, toolchains) BuildStepCopyExamples(pepperdir, toolchains)
BuildStepBuildLibraries(pepperdir, platform)
BuildStepBuildExamples(pepperdir, platform) BuildStepBuildExamples(pepperdir, platform)
if options.test_examples: if options.test_examples:
BuildStepTestExamples(pepperdir, platform, pepper_ver) BuildStepTestExamples(pepperdir, platform, pepper_ver)
......
...@@ -63,7 +63,7 @@ def SetVar(varname, values): ...@@ -63,7 +63,7 @@ def SetVar(varname, values):
return out return out
def GenerateCopyList(desc): def GenerateSourceCopyList(desc):
sources = [] sources = []
# Add sources for each target # Add sources for each target
for target in desc['TARGETS']: for target in desc['TARGETS']:
...@@ -271,6 +271,10 @@ DSC_FORMAT = { ...@@ -271,6 +271,10 @@ DSC_FORMAT = {
'LDFLAGS': (list, '', False), 'LDFLAGS': (list, '', False),
'LIBS' : (list, '', False) 'LIBS' : (list, '', False)
}, True), }, True),
'HEADERS': (list, {
'FILES': (list, '', True),
'DEST': (str, '', True),
}, False),
'SEARCH': (list, '', False), 'SEARCH': (list, '', False),
'POST': (str, '', False), 'POST': (str, '', False),
'PRE': (str, '', False), 'PRE': (str, '', False),
...@@ -451,6 +455,17 @@ def LoadProject(filename, toolchains): ...@@ -451,6 +455,17 @@ def LoadProject(filename, toolchains):
return desc return desc
def FindAndCopyFiles(src_files, root, search_dirs, dst_dir):
buildbot_common.MakeDir(dst_dir)
for src_name in src_files:
src_file = FindFile(src_name, root, search_dirs)
if not src_file:
ErrorMsgFunc('Failed to find: ' + src_name)
return None
dst_file = os.path.join(dst_dir, src_name)
buildbot_common.CopyFile(src_file, dst_file)
def ProcessProject(srcroot, dstroot, desc, toolchains): def ProcessProject(srcroot, dstroot, desc, toolchains):
name = desc['NAME'] name = desc['NAME']
out_dir = os.path.join(dstroot, desc['DEST'], name) out_dir = os.path.join(dstroot, desc['DEST'], name)
...@@ -458,14 +473,14 @@ def ProcessProject(srcroot, dstroot, desc, toolchains): ...@@ -458,14 +473,14 @@ def ProcessProject(srcroot, dstroot, desc, toolchains):
srcdirs = desc.get('SEARCH', ['.', '..']) srcdirs = desc.get('SEARCH', ['.', '..'])
# Copy sources to example directory # Copy sources to example directory
sources = GenerateCopyList(desc) sources = GenerateSourceCopyList(desc)
for src_name in sources: FindAndCopyFiles(sources, srcroot, srcdirs, out_dir)
src_file = FindFile(src_name, srcroot, srcdirs)
if not src_file: # Copy public headers to the include directory.
ErrorMsgFunc('Failed to find: ' + src_name) for headers_set in desc.get('HEADERS', []):
return None headers = headers_set['FILES']
dst_file = os.path.join(out_dir, src_name) header_out_dir = os.path.join(dstroot, headers_set['DEST'])
buildbot_common.CopyFile(src_file, dst_file) FindAndCopyFiles(headers, srcroot, srcdirs, header_out_dir)
if IsNexe(desc): if IsNexe(desc):
template=os.path.join(SCRIPT_DIR, 'template.mk') template=os.path.join(SCRIPT_DIR, 'template.mk')
......
...@@ -42,7 +42,7 @@ WIN_CC?=cl.exe ...@@ -42,7 +42,7 @@ WIN_CC?=cl.exe
WIN_CXX?=cl.exe WIN_CXX?=cl.exe
WIN_LINK?=link.exe WIN_LINK?=link.exe
WIN_LIB?=lib.exe WIN_LIB?=lib.exe
WIN_CCFLAGS=/I$(NACL_SDK_ROOT)/include -D WIN32 -D _WIN32 WIN_CCFLAGS=/I$(NACL_SDK_ROOT)/include /I$(NACL_SDK_ROOT)/include/win -D WIN32 -D _WIN32
WIN_LDFLAGS=/LIBPATH:$(NACL_SDK_ROOT)/lib/win_x86_32_host WIN_LDFLAGS=/LIBPATH:$(NACL_SDK_ROOT)/lib/win_x86_32_host
""" """
......
...@@ -12,70 +12,35 @@ ...@@ -12,70 +12,35 @@
'NAME' : 'ppapi_cpp', 'NAME' : 'ppapi_cpp',
'TYPE' : 'lib', 'TYPE' : 'lib',
'SOURCES' : [ 'SOURCES' : [
'module_embedder.h',
'ppp_entrypoints.cc', 'ppp_entrypoints.cc',
'array_output.cc', 'array_output.cc',
'array_output.h',
'audio.cc', 'audio.cc',
'audio.h',
'audio_config.cc', 'audio_config.cc',
'audio_config.h',
'completion_callback.h',
'core.cc', 'core.cc',
'core.h',
'file_io.cc', 'file_io.cc',
'file_io.h',
'file_ref.cc', 'file_ref.cc',
'file_ref.h',
'file_system.cc', 'file_system.cc',
'file_system.h',
'fullscreen.cc', 'fullscreen.cc',
'fullscreen.h',
'graphics_2d.cc', 'graphics_2d.cc',
'graphics_2d.h',
'graphics_3d.cc', 'graphics_3d.cc',
'graphics_3d.h',
'graphics_3d_client.cc', 'graphics_3d_client.cc',
'graphics_3d_client.h',
'image_data.cc', 'image_data.cc',
'image_data.h',
'input_event.cc', 'input_event.cc',
'input_event.h',
'instance.cc', 'instance.cc',
'instance.h',
'instance_handle.cc', 'instance_handle.cc',
'instance_handle.h',
'lock.cc', 'lock.cc',
'lock.h',
'logging.h',
'module.cc', 'module.cc',
'module.h',
'module_impl.h',
'mouse_cursor.cc', 'mouse_cursor.cc',
'mouse_cursor.h',
'mouse_lock.cc', 'mouse_lock.cc',
'mouse_lock.h',
'output_traits.h',
'point.h',
'rect.cc', 'rect.cc',
'rect.h',
'resource.cc', 'resource.cc',
'resource.h',
'size.h',
'url_loader.cc', 'url_loader.cc',
'url_loader.h',
'url_request_info.cc', 'url_request_info.cc',
'url_request_info.h',
'url_response_info.cc', 'url_response_info.cc',
'url_response_info.h',
'var.cc', 'var.cc',
'var.h',
'var_array_buffer.cc', 'var_array_buffer.cc',
'var_array_buffer.h',
'view.cc', 'view.cc',
'view.h',
'websocket.cc', 'websocket.cc',
'websocket.h',
# Utility sources. # Utility sources.
......
...@@ -7,7 +7,6 @@ ...@@ -7,7 +7,6 @@
'TYPE' : 'lib', 'TYPE' : 'lib',
'SOURCES' : [ 'SOURCES' : [
'gl2ext_ppapi.c', 'gl2ext_ppapi.c',
'gl2ext_ppapi.h',
'gles2.c' 'gles2.c'
], ],
} }
......
...@@ -4,10 +4,13 @@ ...@@ -4,10 +4,13 @@
{ {
'NAME' : 'pthread', 'NAME' : 'pthread',
'TYPE' : 'lib', 'TYPE' : 'lib',
'SOURCES' : [ 'SOURCES' : ['pthread.c'],
'pthread.c', }
'pthread.h' ],
], 'HEADERS': [
{
'FILES': ['pthread.h'],
'DEST': 'include/win',
} }
], ],
'DEST': 'src', 'DEST': 'src',
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment