diff --git a/packager/common.gypi b/packager/common.gypi index 07181e51ea..04824c2781 100644 --- a/packager/common.gypi +++ b/packager/common.gypi @@ -52,6 +52,8 @@ # the current code page. It typically happens when compiling # the code in CJK environment if there is non-ASCII characters # in the file. + 4251, # Warnings about private std::string in Status in a shared + # library config on Windows. ], }, { # We do not have control over non-shaka code. Disable some warnings to diff --git a/packager/file/file.gyp b/packager/file/file.gyp index 2c280a66a7..9a842ee707 100644 --- a/packager/file/file.gyp +++ b/packager/file/file.gyp @@ -43,6 +43,14 @@ '../third_party/curl/curl.gyp:libcurl', '../version/version.gyp:version', ], + 'conditions': [ + ['libpackager_type == "shared_library"', { + 'defines': [ + 'SHARED_LIBRARY_BUILD', + 'SHAKA_IMPLEMENTATION', + ], + }], + ], }, { 'target_name': 'file_unittest', diff --git a/packager/file/file.h b/packager/file/file.h index 7854cb768c..5c2f42b57e 100644 --- a/packager/file/file.h +++ b/packager/file/file.h @@ -13,6 +13,7 @@ #include "packager/base/macros.h" #include "packager/file/public/buffer_callback_params.h" +#include "packager/status.h" namespace shaka { @@ -24,7 +25,7 @@ extern const char* kHttpFilePrefix; const int64_t kWholeFile = -1; /// Define an abstract file interface. -class File { +class SHAKA_EXPORT File { public: /// Open the specified file. /// This is a file factory method, it opens a proper file automatically diff --git a/packager/packager.gyp b/packager/packager.gyp index 8b11f0bf2c..c82f38aef4 100644 --- a/packager/packager.gyp +++ b/packager/packager.gyp @@ -100,12 +100,16 @@ ], 'dependencies': [ 'base/base.gyp:base', - 'file/file.gyp:file', 'libpackager', 'third_party/gflags/gflags.gyp:gflags', 'tools/license_notice.gyp:license_notice', ], 'conditions': [ + ['libpackager_type == "shared_library"', { + 'defines': [ + 'SHARED_LIBRARY_BUILD', + ], + }], ['profiling==1', { 'dependencies': [ 'base/allocator/allocator.gyp:allocator', @@ -135,6 +139,13 @@ 'sources': [ 'packager_test.cc', ], + 'conditions': [ + ['libpackager_type == "shared_library"', { + 'defines': [ + 'SHARED_LIBRARY_BUILD', + ], + }], + ], 'dependencies': [ 'libpackager', 'testing/gmock.gyp:gmock',