Commit 2862cc66 authored by Jørgen Lind's avatar Jørgen Lind
Browse files

Build fixes for MacOS

parent 9a919c4c
......@@ -8,6 +8,9 @@ macro(BuildAWSSDK)
list(APPEND AWS_DLLS_LIST "bin/aws-checksums.dll")
list(APPEND AWS_DLLS_LIST "bin/aws-cpp-sdk-core.dll")
list(APPEND AWS_DLLS_LIST "bin/aws-cpp-sdk-s3.dll")
elseif (APPLE)
list(APPEND AWS_LIBS_LIST "lib/libaws-cpp-sdk-core.dylib")
list(APPEND AWS_LIBS_LIST "lib/libaws-cpp-sdk-s3.dylib")
else()
list(APPEND AWS_LIBS_LIST "lib/libaws-cpp-sdk-core.so")
list(APPEND AWS_LIBS_LIST "lib/libaws-cpp-sdk-s3.so")
......@@ -19,6 +22,7 @@ macro(BuildAWSSDK)
if (WIN32)
list(APPEND aws-cpp-sdk_EXTERNAL_LIBS "winhttp")
elseif (APPLE)
else()
list(APPEND aws-cpp-sdk_EXTERNAL_LIBS "crypto")
list(APPEND aws-cpp-sdk_EXTERNAL_LIBS "curl")
......
......@@ -96,6 +96,8 @@ install(TARGETS openvds
DESTINATION lib${LIB_TOOLSET_DIR}
RUNTIME
DESTINATION bin${LIB_TOOLSET_DIR}
FRAMEWORK
DESTINATION framework
PUBLIC_HEADER
DESTINATION include/OpenVDS
PRIVATE_HEADER
......
......@@ -80,18 +80,18 @@ namespace OpenVDS
static void callback(const Aws::S3::S3Client *client, const Aws::S3::Model::GetObjectRequest& objreq, const Aws::S3::Model::GetObjectOutcome &getObjectOutcome, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&awsContext, std::shared_ptr<AsyncCallerContext> context)
{
std::unique_lock<std::mutex> lock(context->mutex);
auto or = context->back;
if (!or)
auto objReq = context->back;
if (!objReq)
return;
NotifyAll notify(or->m_waitForFinish);
or->m_done = true;
NotifyAll notify(objReq->m_waitForFinish);
objReq->m_done = true;
if (!getObjectOutcome.IsSuccess())
{
auto s3error = getObjectOutcome.GetError();
or->m_error.code = int(s3error.GetResponseCode());
or->m_error.string = (s3error.GetExceptionName() + " : " + s3error.GetMessage()).c_str();
or->m_handler->handleError(or->m_error);
objReq->m_error.code = int(s3error.GetResponseCode());
objReq->m_error.string = (s3error.GetExceptionName() + " : " + s3error.GetMessage()).c_str();
objReq->m_handler->handleError(objReq->m_error);
return;
}
......@@ -103,7 +103,7 @@ namespace OpenVDS
std::vector<uint8_t> data;
data.resize(content_length);
retrieved_object.read((char *)&data[0], content_length);
or->m_handler->handleData(std::move(data));
objReq->m_handler->handleData(std::move(data));
}
}
......
......@@ -129,7 +129,9 @@ public:
if (isPopulate)
{
#ifdef LINUX
iFlags |= MAP_POPULATE;
#endif
}
m_pxBaseAddress = mmap(NULL, m_nNumberOfBytes, PROT_READ, iFlags, iFD, nAdjustedOffset);
......@@ -310,8 +312,13 @@ bool File::write(const void* pxData, int64_t nOffset, int32_t nLength, IOError &
bool File::flush()
{
#ifdef LINUX
int fd = (int)(intptr_t)_pxPlatformHandle;
return syncfs(fd) == 0;
#else
sync();
return true;
#endif
}
FileView *File::createFileView(int64_t nPos, int64_t nSize, bool isPopulate, IOError &error)
......
......@@ -21,6 +21,8 @@
#include <unordered_map>
#include <Math/Vector.h>
#include <string>
namespace OpenVDS
{
struct MetadataKey
......@@ -39,7 +41,7 @@ template<>
struct hash<OpenVDS::MetadataKey>
{
std::size_t operator()(const OpenVDS::MetadataKey &k) const
{
{
size_t const h1= std::hash<std::string>()(k.category);
size_t const h2= std::hash<std::string>()(k.name);
return h1 ^ (h2 << 1);
......
......@@ -17,7 +17,7 @@
#include <cstdint>
#include <OpenVDS/openvds_export.h>
#include "DimensionGroup.h"
#include <VDS/DimensionGroup.h>
namespace OpenVDS
{
......
......@@ -15,6 +15,8 @@
** limitations under the License.
****************************************************************************/
#include <cstddef>
namespace SEGY
{
......
......@@ -39,7 +39,7 @@ TEST(SEGYScanTest, scan)
GTEST_SKIP();
#else
return;
#endif|
#endif
}
file.open(fileName, false, false, false, error);
......
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