diff options
author | sbc <sbc@chromium.org> | 2016-01-07 11:47:05 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-01-07 19:48:58 +0000 |
commit | b54fa117fb6e19784a5c80d06bf28073bdb1a01c (patch) | |
tree | 6d3a3d5b9def1405df2fc25d403bdb8535d58fcd | |
parent | 5632bf5e2836df74ca4d92e98c05540d6b4e62f2 (diff) | |
download | chromium_src-b54fa117fb6e19784a5c80d06bf28073bdb1a01c.zip chromium_src-b54fa117fb6e19784a5c80d06bf28073bdb1a01c.tar.gz chromium_src-b54fa117fb6e19784a5c80d06bf28073bdb1a01c.tar.bz2 |
[NaCl SDK] Don't include gtest/gmock in library form
These are designed to be built from source into
each project that uses them.
The change also remove gtest/gmock from the default
include path which allows different versions to be
used, for example, in webports.
A corresponding change to webports will be required:
https://codereview.chromium.org/1555913002
Fix host_vc.mk such that it uses SRC_TO_OBJ to derive
object file name (i.e. fix http://crbug/569091).
CQ_EXTRA_TRYBOTS=tryserver.chromium.linux:linux_nacl_sdk;tryserver.chromium.mac:mac_nacl_sdk;tryserver.chromium.win:win_nacl_sdk
BUG=569091
Review URL: https://codereview.chromium.org/1559463002
Cr-Commit-Position: refs/heads/master@{#368128}
14 files changed, 119 insertions, 196 deletions
diff --git a/native_client_sdk/src/build_tools/build_projects.py b/native_client_sdk/src/build_tools/build_projects.py index f1a76c2..1646d6b 100755 --- a/native_client_sdk/src/build_tools/build_projects.py +++ b/native_client_sdk/src/build_tools/build_projects.py @@ -148,7 +148,7 @@ def UpdateProjects(pepperdir, project_tree, toolchains, if clobber: buildbot_common.RemoveDir(dirpath) buildbot_common.MakeDir(dirpath) - targets = [desc['NAME'] for desc in projects] + targets = [desc['NAME'] for desc in projects if 'TARGETS' in desc] deps = GetDeps(projects) # Generate master make for this branch of projects diff --git a/native_client_sdk/src/build_tools/parse_dsc.py b/native_client_sdk/src/build_tools/parse_dsc.py index 3d862de..8d4e9f2 100755 --- a/native_client_sdk/src/build_tools/parse_dsc.py +++ b/native_client_sdk/src/build_tools/parse_dsc.py @@ -42,6 +42,7 @@ DSC_FORMAT = { 'linker-script'], True), 'SOURCES': (list, '', True), + 'EXTRA_SOURCES': (list, '', False), 'CFLAGS': (list, '', False), 'CFLAGS_GCC': (list, '', False), 'CXXFLAGS': (list, '', False), diff --git a/native_client_sdk/src/build_tools/sdk_files.list b/native_client_sdk/src/build_tools/sdk_files.list index a7676e5..7a39a23 100644 --- a/native_client_sdk/src/build_tools/sdk_files.list +++ b/native_client_sdk/src/build_tools/sdk_files.list @@ -61,11 +61,6 @@ include/GLES2/* include/glibc/bits/* include/glibc/rpc/netdb.h include/glibc/sys/mount.h -include/gmock/* -include/gmock/internal/* -include/gtest/* -include/gtest/internal/* -include/gtest/internal/src/* include/json/* include/KHR/* include/mac/sys/mount.h @@ -98,8 +93,6 @@ include/sdk_util/* [win]include/win/* include/win/poll.h include/win/sys/poll.h -[linux,mac]lib/${PLATFORM}_host/Debug/libgmock.a -[linux,mac]lib/${PLATFORM}_host/Debug/libgtest.a [linux,mac]lib/${PLATFORM}_host/Debug/libjsoncpp.a [linux,mac]lib/${PLATFORM}_host/Debug/libnacl_io.a [linux,mac]lib/${PLATFORM}_host/Debug/libppapi.a @@ -113,8 +106,6 @@ include/win/sys/poll.h [linux,mac]lib/${PLATFORM}_host/Debug/libppapi_simple_cpp_real.a [linux,mac]lib/${PLATFORM}_host/Debug/libppapi_simple_real.a [linux,mac]lib/${PLATFORM}_host/Debug/libsdk_util.a -[linux,mac]lib/${PLATFORM}_host/Release/libgmock.a -[linux,mac]lib/${PLATFORM}_host/Release/libgtest.a [linux,mac]lib/${PLATFORM}_host/Release/libjsoncpp.a [linux,mac]lib/${PLATFORM}_host/Release/libnacl_io.a [linux,mac]lib/${PLATFORM}_host/Release/libppapi.a @@ -128,8 +119,6 @@ include/win/sys/poll.h [linux,mac]lib/${PLATFORM}_host/Release/libppapi_simple_cpp_real.a [linux,mac]lib/${PLATFORM}_host/Release/libppapi_simple_real.a [linux,mac]lib/${PLATFORM}_host/Release/libsdk_util.a -[win]lib/${PLATFORM}_x86_32_host/Debug/gmock.lib -[win]lib/${PLATFORM}_x86_32_host/Debug/gtest.lib [win]lib/${PLATFORM}_x86_32_host/Debug/jsoncpp.lib [win]lib/${PLATFORM}_x86_32_host/Debug/ppapi.lib [win]lib/${PLATFORM}_x86_32_host/Debug/ppapi_cpp.lib @@ -137,8 +126,6 @@ include/win/sys/poll.h [win]lib/${PLATFORM}_x86_32_host/Debug/ppapi_gles2.lib [win]lib/${PLATFORM}_x86_32_host/Debug/pthread.lib [win]lib/${PLATFORM}_x86_32_host/Debug/sdk_util.lib -[win]lib/${PLATFORM}_x86_32_host/Release/gmock.lib -[win]lib/${PLATFORM}_x86_32_host/Release/gtest.lib [win]lib/${PLATFORM}_x86_32_host/Release/jsoncpp.lib [win]lib/${PLATFORM}_x86_32_host/Release/ppapi.lib [win]lib/${PLATFORM}_x86_32_host/Release/ppapi_cpp.lib @@ -147,8 +134,6 @@ include/win/sys/poll.h [win]lib/${PLATFORM}_x86_32_host/Release/pthread.lib [win]lib/${PLATFORM}_x86_32_host/Release/sdk_util.lib lib/clang-newlib_arm/Debug/liberror_handling.a -lib/clang-newlib_arm/Debug/libgmock.a -lib/clang-newlib_arm/Debug/libgtest.a lib/clang-newlib_arm/Debug/libjsoncpp.a lib/clang-newlib_arm/Debug/libnacl_io.a lib/clang-newlib_arm/Debug/libppapi_cpp.a @@ -160,8 +145,6 @@ lib/clang-newlib_arm/Debug/libppapi_simple_cpp_real.a lib/clang-newlib_arm/Debug/libppapi_simple_real.a lib/clang-newlib_arm/Debug/libsdk_util.a lib/clang-newlib_arm/Release/liberror_handling.a -lib/clang-newlib_arm/Release/libgmock.a -lib/clang-newlib_arm/Release/libgtest.a lib/clang-newlib_arm/Release/libjsoncpp.a lib/clang-newlib_arm/Release/libnacl_io.a lib/clang-newlib_arm/Release/libppapi_cpp.a @@ -173,8 +156,6 @@ lib/clang-newlib_arm/Release/libppapi_simple_cpp_real.a lib/clang-newlib_arm/Release/libppapi_simple_real.a lib/clang-newlib_arm/Release/libsdk_util.a lib/clang-newlib_x86_32/Debug/liberror_handling.a -lib/clang-newlib_x86_32/Debug/libgmock.a -lib/clang-newlib_x86_32/Debug/libgtest.a lib/clang-newlib_x86_32/Debug/libjsoncpp.a lib/clang-newlib_x86_32/Debug/libnacl_io.a lib/clang-newlib_x86_32/Debug/libppapi_cpp.a @@ -186,8 +167,6 @@ lib/clang-newlib_x86_32/Debug/libppapi_simple_cpp_real.a lib/clang-newlib_x86_32/Debug/libppapi_simple_real.a lib/clang-newlib_x86_32/Debug/libsdk_util.a lib/clang-newlib_x86_32/Release/liberror_handling.a -lib/clang-newlib_x86_32/Release/libgmock.a -lib/clang-newlib_x86_32/Release/libgtest.a lib/clang-newlib_x86_32/Release/libjsoncpp.a lib/clang-newlib_x86_32/Release/libnacl_io.a lib/clang-newlib_x86_32/Release/libppapi_cpp.a @@ -199,8 +178,6 @@ lib/clang-newlib_x86_32/Release/libppapi_simple_cpp_real.a lib/clang-newlib_x86_32/Release/libppapi_simple_real.a lib/clang-newlib_x86_32/Release/libsdk_util.a lib/clang-newlib_x86_64/Debug/liberror_handling.a -lib/clang-newlib_x86_64/Debug/libgmock.a -lib/clang-newlib_x86_64/Debug/libgtest.a lib/clang-newlib_x86_64/Debug/libjsoncpp.a lib/clang-newlib_x86_64/Debug/libnacl_io.a lib/clang-newlib_x86_64/Debug/libppapi_cpp.a @@ -212,8 +189,6 @@ lib/clang-newlib_x86_64/Debug/libppapi_simple_cpp_real.a lib/clang-newlib_x86_64/Debug/libppapi_simple_real.a lib/clang-newlib_x86_64/Debug/libsdk_util.a lib/clang-newlib_x86_64/Release/liberror_handling.a -lib/clang-newlib_x86_64/Release/libgmock.a -lib/clang-newlib_x86_64/Release/libgtest.a lib/clang-newlib_x86_64/Release/libjsoncpp.a lib/clang-newlib_x86_64/Release/libnacl_io.a lib/clang-newlib_x86_64/Release/libppapi_cpp.a @@ -224,10 +199,6 @@ lib/clang-newlib_x86_64/Release/libppapi_simple_cpp.a lib/clang-newlib_x86_64/Release/libppapi_simple_cpp_real.a lib/clang-newlib_x86_64/Release/libppapi_simple_real.a lib/clang-newlib_x86_64/Release/libsdk_util.a -lib/glibc_arm/Debug/libgmock.a -lib/glibc_arm/Debug/libgmock.so -lib/glibc_arm/Debug/libgtest.a -lib/glibc_arm/Debug/libgtest.so lib/glibc_arm/Debug/libjsoncpp.a lib/glibc_arm/Debug/libjsoncpp.so lib/glibc_arm/Debug/libnacl_io.a @@ -248,10 +219,6 @@ lib/glibc_arm/Debug/libppapi_simple_real.a lib/glibc_arm/Debug/libppapi_simple_real.so lib/glibc_arm/Debug/libsdk_util.a lib/glibc_arm/Debug/libsdk_util.so -lib/glibc_arm/Release/libgmock.a -lib/glibc_arm/Release/libgmock.so -lib/glibc_arm/Release/libgtest.a -lib/glibc_arm/Release/libgtest.so lib/glibc_arm/Release/libjsoncpp.a lib/glibc_arm/Release/libjsoncpp.so lib/glibc_arm/Release/libnacl_io.a @@ -272,10 +239,6 @@ lib/glibc_arm/Release/libppapi_simple_real.a lib/glibc_arm/Release/libppapi_simple_real.so lib/glibc_arm/Release/libsdk_util.a lib/glibc_arm/Release/libsdk_util.so -lib/glibc_x86_32/Debug/libgmock.a -lib/glibc_x86_32/Debug/libgmock.so -lib/glibc_x86_32/Debug/libgtest.a -lib/glibc_x86_32/Debug/libgtest.so lib/glibc_x86_32/Debug/libjsoncpp.a lib/glibc_x86_32/Debug/libjsoncpp.so lib/glibc_x86_32/Debug/libnacl_io.a @@ -296,10 +259,6 @@ lib/glibc_x86_32/Debug/libppapi_simple_real.a lib/glibc_x86_32/Debug/libppapi_simple_real.so lib/glibc_x86_32/Debug/libsdk_util.a lib/glibc_x86_32/Debug/libsdk_util.so -lib/glibc_x86_32/Release/libgmock.a -lib/glibc_x86_32/Release/libgmock.so -lib/glibc_x86_32/Release/libgtest.a -lib/glibc_x86_32/Release/libgtest.so lib/glibc_x86_32/Release/libjsoncpp.a lib/glibc_x86_32/Release/libjsoncpp.so lib/glibc_x86_32/Release/libnacl_io.a @@ -320,10 +279,6 @@ lib/glibc_x86_32/Release/libppapi_simple_real.a lib/glibc_x86_32/Release/libppapi_simple_real.so lib/glibc_x86_32/Release/libsdk_util.a lib/glibc_x86_32/Release/libsdk_util.so -lib/glibc_x86_64/Debug/libgmock.a -lib/glibc_x86_64/Debug/libgmock.so -lib/glibc_x86_64/Debug/libgtest.a -lib/glibc_x86_64/Debug/libgtest.so lib/glibc_x86_64/Debug/libjsoncpp.a lib/glibc_x86_64/Debug/libjsoncpp.so lib/glibc_x86_64/Debug/libnacl_io.a @@ -344,10 +299,6 @@ lib/glibc_x86_64/Debug/libppapi_simple_real.a lib/glibc_x86_64/Debug/libppapi_simple_real.so lib/glibc_x86_64/Debug/libsdk_util.a lib/glibc_x86_64/Debug/libsdk_util.so -lib/glibc_x86_64/Release/libgmock.a -lib/glibc_x86_64/Release/libgmock.so -lib/glibc_x86_64/Release/libgtest.a -lib/glibc_x86_64/Release/libgtest.so lib/glibc_x86_64/Release/libjsoncpp.a lib/glibc_x86_64/Release/libjsoncpp.so lib/glibc_x86_64/Release/libnacl_io.a @@ -368,8 +319,6 @@ lib/glibc_x86_64/Release/libppapi_simple_real.a lib/glibc_x86_64/Release/libppapi_simple_real.so lib/glibc_x86_64/Release/libsdk_util.a lib/glibc_x86_64/Release/libsdk_util.so -lib/pnacl/Debug/libgmock.a -lib/pnacl/Debug/libgtest.a lib/pnacl/Debug/libjsoncpp.a lib/pnacl/Debug/libnacl_io.a lib/pnacl/Debug/libppapi_cpp.a @@ -380,8 +329,6 @@ lib/pnacl/Debug/libppapi_simple_cpp.a lib/pnacl/Debug/libppapi_simple_cpp_real.a lib/pnacl/Debug/libppapi_simple_real.a lib/pnacl/Debug/libsdk_util.a -lib/pnacl/Release/libgmock.a -lib/pnacl/Release/libgtest.a lib/pnacl/Release/libjsoncpp.a lib/pnacl/Release/libnacl_io.a lib/pnacl/Release/libppapi_cpp.a diff --git a/native_client_sdk/src/doc/sdk/release-notes.rst b/native_client_sdk/src/doc/sdk/release-notes.rst index a68fa7e..460d723 100644 --- a/native_client_sdk/src/doc/sdk/release-notes.rst +++ b/native_client_sdk/src/doc/sdk/release-notes.rst @@ -7,6 +7,12 @@ Release Notes The dates in the following release notes denote when Chrome and the NaCl SDK reached canary status. The stable release is typically 6 weeks later. +Chrome/Pepper 49 +================ + +* gtest/gmock no longer shipped as prebuilt libraries. This is in-line with + normal gtest/gmock usage guidelines. Projects wishing to use gtest/gmock must + now add explict include paths and compile gtest-all.cc locally. Chrome/Pepper 45 (10 July 2015) ================================ diff --git a/native_client_sdk/src/examples/tutorial/testing/example.dsc b/native_client_sdk/src/examples/tutorial/testing/example.dsc index 284ec46..07f1fbc 100644 --- a/native_client_sdk/src/examples/tutorial/testing/example.dsc +++ b/native_client_sdk/src/examples/tutorial/testing/example.dsc @@ -6,7 +6,9 @@ 'NAME' : 'testing', 'TYPE' : 'main', 'SOURCES' : ['testing.cc'], - 'LIBS' : ['ppapi_simple_cpp', 'ppapi_cpp', 'ppapi', 'gtest', 'nacl_io', 'pthread'], + 'LIBS' : ['ppapi_simple_cpp', 'ppapi_cpp', 'ppapi', 'nacl_io', 'pthread'], + 'INCLUDES': ['../../../src/gtest/include', '../../../src/gtest'], + 'EXTRA_SOURCES' : ['../../../src/gtest/src/gtest-all.cc'], 'CXXFLAGS': ['-Wno-sign-compare'] } ], diff --git a/native_client_sdk/src/libraries/gmock/library.dsc b/native_client_sdk/src/libraries/gmock/library.dsc index 0a268a2..71c5c47 100644 --- a/native_client_sdk/src/libraries/gmock/library.dsc +++ b/native_client_sdk/src/libraries/gmock/library.dsc @@ -1,64 +1,38 @@ { - 'SEARCH': [ - '../../../../testing/gmock/include/gmock', - '../../../../testing/gmock/include/gmock/internal', - '../../../../testing/gmock/src', - ], - 'TARGETS': [ - { - 'NAME' : 'gmock', - 'TYPE' : 'lib', - 'SOURCES' : [ - 'gmock.cc', - 'gmock-matchers.cc', - 'gmock-cardinalities.cc', - 'gmock-internal-utils.cc', - 'gmock-spec-builders.cc', - ], # gmock-spec-builders.cc:248: error: enumeration value ‘FAIL’ not handled in switch - 'CXXFLAGS': ['-Wno-switch-enum'], - 'DEPS': ['gtest'], - } + #'CXXFLAGS': ['-Wno-switch-enum'], + 'SEARCH': [ + '../../../../testing/gmock', ], - 'HEADERS': [ - { - 'FILES': [ - 'gmock-actions.h', - 'gmock-cardinalities.h', - 'gmock-generated-actions.h', - 'gmock-generated-actions.h.pump', - 'gmock-generated-function-mockers.h', - 'gmock-generated-function-mockers.h.pump', - 'gmock-generated-matchers.h', - 'gmock-generated-matchers.h.pump', - 'gmock-generated-nice-strict.h', - 'gmock-generated-nice-strict.h.pump', - 'gmock.h', - 'gmock-matchers.h', - 'gmock-more-actions.h', - 'gmock-more-matchers.h', - 'gmock-spec-builders.h', - ], - 'DEST': 'include/gmock', - }, - { - 'FILES': [ - 'gmock-generated-internal-utils.h', - 'gmock-generated-internal-utils.h.pump', - 'gmock-internal-utils.h', - 'gmock-port.h', - ], - 'DEST': 'include/gmock/internal', - }, - { - 'FILES': [ - 'gmock.h', - 'gmock-generated-actions.h', - 'gmock-matchers.h', - 'gmock-port.h', - ], - 'DEST': 'include/gmock/internal/custom', - }, + 'DATA': [ + 'src/gmock.cc', + 'src/gmock-all.cc', + 'src/gmock-matchers.cc', + 'src/gmock-cardinalities.cc', + 'src/gmock-internal-utils.cc', + 'src/gmock-spec-builders.cc', + 'include/gmock/gmock-actions.h', + 'include/gmock/gmock-cardinalities.h', + 'include/gmock/gmock-generated-actions.h', + 'include/gmock/gmock-generated-actions.h.pump', + 'include/gmock/gmock-generated-function-mockers.h', + 'include/gmock/gmock-generated-function-mockers.h.pump', + 'include/gmock/gmock-generated-matchers.h', + 'include/gmock/gmock-generated-matchers.h.pump', + 'include/gmock/gmock-generated-nice-strict.h', + 'include/gmock/gmock-generated-nice-strict.h.pump', + 'include/gmock/gmock.h', + 'include/gmock/gmock-matchers.h', + 'include/gmock/gmock-more-actions.h', + 'include/gmock/gmock-more-matchers.h', + 'include/gmock/gmock-spec-builders.h', + 'include/gmock/internal/gmock-generated-internal-utils.h', + 'include/gmock/internal/gmock-generated-internal-utils.h.pump', + 'include/gmock/internal/gmock-internal-utils.h', + 'include/gmock/internal/gmock-port.h', + 'include/gmock/internal/custom/gmock-generated-actions.h', + 'include/gmock/internal/custom/gmock-matchers.h', + 'include/gmock/internal/custom/gmock-port.h', ], 'DEST': 'src', 'NAME': 'gmock', diff --git a/native_client_sdk/src/libraries/gtest/library.dsc b/native_client_sdk/src/libraries/gtest/library.dsc index a22b7f4..41667f2 100644 --- a/native_client_sdk/src/libraries/gtest/library.dsc +++ b/native_client_sdk/src/libraries/gtest/library.dsc @@ -1,80 +1,43 @@ { 'SEARCH': [ - '.', - '../../../../testing/gtest/include/gtest', - '../../../../testing/gtest/include/gtest/internal', - '../../../../testing/gtest/src', + '../../../../testing/gtest', ], - 'TARGETS': [ - { - 'NAME' : 'gtest', - 'TYPE' : 'lib', - 'SOURCES' : [ - 'gtest.cc', - 'gtest-death-test.cc', - 'gtest-filepath.cc', - 'gtest-port.cc', - 'gtest-printers.cc', - 'gtest-test-part.cc', - 'gtest-typed-test.cc', - ], - 'INCLUDES': [ - # See comment below about gtest-internal-inl.h - '$(NACL_SDK_ROOT)/include/gtest/internal', - ], - } - ], - 'HEADERS': [ - { - 'FILES': [ - 'gtest-death-test.h', - 'gtest.h', - 'gtest-message.h', - 'gtest-param-test.h', - 'gtest_pred_impl.h', - 'gtest-printers.h', - 'gtest_prod.h', - 'gtest-spi.h', - 'gtest-test-part.h', - 'gtest-typed-test.h', - ], - 'DEST': 'include/gtest', - }, - { - 'FILES': [ - 'gtest-death-test-internal.h', - 'gtest-filepath.h', - 'gtest-internal.h', - 'gtest-linked_ptr.h', - 'gtest-param-util-generated.h', - 'gtest-param-util.h', - 'gtest-port-arch.h', - 'gtest-port.h', - 'gtest-string.h', - 'gtest-tuple.h', - 'gtest-type-util.h', - ], - 'DEST': 'include/gtest/internal', - }, - { - 'FILES': [ - 'gtest.h', - 'gtest-port.h', - 'gtest-printers.h', - ], - 'DEST': 'include/gtest/internal/custom', - }, - { - # This is cheesy, but gtest.cc includes "src/gtest-internal-inl.h". Since - # gtest is not installed in the SDK, I don't really care about the - # directory layout. - # TODO(binji): If we decide to include gtest, put this file in a better - # spot. - 'FILES': [ - 'gtest-internal-inl.h', - ], - 'DEST': 'include/gtest/internal/src', - }, + 'DATA': [ + 'src/gtest.cc', + 'src/gtest_main.cc', + 'src/gtest-death-test.cc', + 'src/gtest-all.cc', + 'src/gtest-filepath.cc', + 'src/gtest-port.cc', + 'src/gtest-printers.cc', + 'src/gtest-test-part.cc', + 'src/gtest-typed-test.cc', + 'src/gtest-internal-inl.h', + 'include/gtest/gtest.h', + 'include/gtest/gtest-death-test.h', + 'include/gtest/gtest.h', + 'include/gtest/gtest-message.h', + 'include/gtest/gtest-param-test.h', + 'include/gtest/gtest_pred_impl.h', + 'include/gtest/gtest-printers.h', + 'include/gtest/gtest_prod.h', + 'include/gtest/gtest-spi.h', + 'include/gtest/gtest-test-part.h', + 'include/gtest/gtest-typed-test.h', + 'include/gtest/internal/gtest-death-test-internal.h', + 'include/gtest/internal/gtest-filepath.h', + 'include/gtest/internal/gtest-internal.h', + 'include/gtest/internal/gtest-linked_ptr.h', + 'include/gtest/internal/gtest-param-util-generated.h', + 'include/gtest/internal/gtest-param-util.h', + 'include/gtest/internal/gtest-port-arch.h', + 'include/gtest/internal/gtest-port.h', + 'include/gtest/internal/gtest-string.h', + 'include/gtest/internal/gtest-tuple.h', + 'include/gtest/internal/gtest-type-util.h', + 'include/gtest/internal/custom/gtest.h', + 'include/gtest/internal/custom/gtest-port.h', + 'include/gtest/internal/custom/gtest-printers.h', ], 'DEST': 'src', 'NAME': 'gtest', diff --git a/native_client_sdk/src/resources/Makefile.example.template b/native_client_sdk/src/resources/Makefile.example.template index aef08ef..750af9d 100644 --- a/native_client_sdk/src/resources/Makefile.example.template +++ b/native_client_sdk/src/resources/Makefile.example.template @@ -52,7 +52,8 @@ CHROME_ARGS += --allow-nacl-socket-api=localhost [[ExpandDict('LIBS', targets[0].get('LIBS', []))]] [[for target in targets:]] -[[ source_list = (s for s in sorted(target['SOURCES']) if not s.endswith('.h'))]] +[[ source_list = sorted(target['SOURCES'] + target.get('EXTRA_SOURCES', []))]] +[[ source_list = (s for s in source_list if not s.endswith('.h'))]] [[ source_list = ' \\\n '.join(source_list)]] [[ sources = target['NAME'] + '_SOURCES']] [[ cflags = target['NAME'] + '_CFLAGS']] diff --git a/native_client_sdk/src/tests/nacl_io_socket_test/example.dsc b/native_client_sdk/src/tests/nacl_io_socket_test/example.dsc index ec4379b..3c2bb3a 100644 --- a/native_client_sdk/src/tests/nacl_io_socket_test/example.dsc +++ b/native_client_sdk/src/tests/nacl_io_socket_test/example.dsc @@ -11,7 +11,12 @@ 'echo_server.h', ], 'DEPS': ['ppapi_simple_cpp', 'nacl_io'], - 'LIBS': ['ppapi_simple_cpp', 'ppapi_cpp', 'gmock', 'ppapi', 'gtest', 'nacl_io', 'pthread'], + 'LIBS': ['ppapi_simple_cpp', 'ppapi_cpp', 'ppapi', 'nacl_io', 'pthread'], + 'EXTRA_SOURCES' : ['../../src/gtest/src/gtest-all.cc'], + 'INCLUDES': [ + '../../src/gtest/include', + '../../src/gtest' + ], 'CXXFLAGS': ['-Wno-sign-compare'] } ], diff --git a/native_client_sdk/src/tests/nacl_io_socket_test/socket_test.cc b/native_client_sdk/src/tests/nacl_io_socket_test/socket_test.cc index c7ce99a..c13ae0f 100644 --- a/native_client_sdk/src/tests/nacl_io_socket_test/socket_test.cc +++ b/native_client_sdk/src/tests/nacl_io_socket_test/socket_test.cc @@ -15,7 +15,6 @@ #include <string> #include "echo_server.h" -#include "gmock/gmock.h" #include "gtest/gtest.h" #include "nacl_io/kernel_intercept.h" #include "nacl_io/kernel_proxy.h" diff --git a/native_client_sdk/src/tests/nacl_io_test/example.dsc b/native_client_sdk/src/tests/nacl_io_test/example.dsc index 0a1055d..ee48428 100644 --- a/native_client_sdk/src/tests/nacl_io_test/example.dsc +++ b/native_client_sdk/src/tests/nacl_io_test/example.dsc @@ -62,14 +62,25 @@ 'tty_test.cc', ], 'DEPS': ['ppapi_simple_cpp', 'nacl_io'], - 'LIBS': ['ppapi_simple_cpp', 'ppapi_cpp', 'gmock', 'nacl_io', 'ppapi', 'gtest', 'pthread'], - 'INCLUDES': ["."], + 'LIBS': ['ppapi_simple_cpp', 'ppapi_cpp', 'nacl_io', 'ppapi', 'pthread'], + 'INCLUDES': [ + '.', + '../../src/gtest/include', + '../../src/gtest', + '../../src/gmock/include', + '../../src/gmock' + ], + 'EXTRA_SOURCES' : [ + '../../src/gtest/src/gtest-all.cc', + '../../src/gmock/src/gmock-all.cc' + ], 'CXXFLAGS': ['-Wno-sign-compare'], } ], 'DATA': [ 'example.js' ], + 'DEST': 'tests', 'NAME': 'nacl_io_test', 'TITLE': 'NaCl IO test', diff --git a/native_client_sdk/src/tests/sdk_util_test/example.dsc b/native_client_sdk/src/tests/sdk_util_test/example.dsc index 334d1da..46cf7d1 100644 --- a/native_client_sdk/src/tests/sdk_util_test/example.dsc +++ b/native_client_sdk/src/tests/sdk_util_test/example.dsc @@ -11,7 +11,17 @@ 'string_util_test.cc', ], 'DEPS': ['ppapi_simple_cpp', 'sdk_util', 'nacl_io'], - 'LIBS': ['ppapi_simple_cpp', 'ppapi_cpp', 'gmock', 'nacl_io', 'ppapi', 'gtest', 'pthread'], + 'LIBS': ['ppapi_simple_cpp', 'ppapi_cpp', 'nacl_io', 'ppapi', 'pthread'], + 'INCLUDES': [ + '../../src/gtest/include', + '../../src/gtest', + '../../src/gmock/include', + '../../src/gmock' + ], + 'EXTRA_SOURCES' : [ + '../../src/gtest/src/gtest-all.cc', + '../../src/gmock/src/gmock-all.cc' + ], 'CXXFLAGS': ['-Wno-sign-compare'] } ], diff --git a/native_client_sdk/src/tools/common.mk b/native_client_sdk/src/tools/common.mk index c3227985..f43ed63 100644 --- a/native_client_sdk/src/tools/common.mk +++ b/native_client_sdk/src/tools/common.mk @@ -379,12 +379,16 @@ endif # # Convert a source path to a object file path. +# If source path is absolute then just use the basename of for the object +# file name (absolute sources paths with the same basename are not allowed). +# For relative paths use the full path to the source in the object file path +# name. # # $1 = Source Name # $2 = Arch suffix # define SRC_TO_OBJ -$(OUTDIR)/$(basename $(subst ..,__,$(1)))$(2).o +$(if $(filter /%,$(1)), $(OUTDIR)/$(basename $(notdir $(1)))$(2).o, $(OUTDIR)/$(basename $(subst ..,__,$(1)))$(2).o) endef diff --git a/native_client_sdk/src/tools/host_vc.mk b/native_client_sdk/src/tools/host_vc.mk index 0890bc4..9755c55 100644 --- a/native_client_sdk/src/tools/host_vc.mk +++ b/native_client_sdk/src/tools/host_vc.mk @@ -77,7 +77,7 @@ $(STAMPDIR)/$(1).stamp: $(LIBDIR)/$(OSNAME)_x86_32_host/$(CONFIG)/$(1).lib @echo "TOUCHED $$@" > $(STAMPDIR)/$(1).stamp all:$(LIBDIR)/$(OSNAME)_x86_32_host/$(CONFIG)/$(1).lib -$(LIBDIR)/$(OSNAME)_x86_32_host/$(CONFIG)/$(1).lib: $(foreach src,$(2),$(OUTDIR)/$(basename $(src)).o) +$(LIBDIR)/$(OSNAME)_x86_32_host/$(CONFIG)/$(1).lib: $(foreach src,$(2),$(call SRC_TO_OBJ,$(src))) $(MKDIR) -p $$(dir $$@) $(call LOG,LIB,$$@,$(HOST_LIB) /OUT:$$@ $$^ $(WIN_LDFLAGS)) endef @@ -111,7 +111,7 @@ endef # $6 = VC Linker Switches # define LINK_RULE -$(call LINKER_RULE,$(OUTDIR)/$(1)$(HOST_EXT),$(foreach src,$(2),$(OUTDIR)/$(basename $(src)).o),$(3),$(4),$(LIB_PATHS),$(6)) +$(call LINKER_RULE,$(OUTDIR)/$(1)$(HOST_EXT),$(foreach src,$(2),$(call SRC_TO_OBJ,$(src))),$(3),$(4),$(LIB_PATHS),$(6)) endef |