Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -342,21 +342,21 @@ set(private_headers
lib/src/ConfigAdapter.h
lib/src/MultipartStreamParser.h)

if (NOT WIN32)
if (NOT WIN32 AND NOT CMAKE_SYSTEM_NAME STREQUAL "iOS")
set(DROGON_SOURCES
${DROGON_SOURCES}
lib/src/SharedLibManager.cc)
set(private_headers
${private_headers}
lib/src/SharedLibManager.h)
else (NOT WIN32)
elseif(WIN32)
set(DROGON_SOURCES
${DROGON_SOURCES}
third_party/mman-win32/mman.c)
set(private_headers
${private_headers}
third_party/mman-win32/mman.h)
endif (NOT WIN32)
endif()

if (BUILD_POSTGRESQL)
# find postgres
Expand Down
12 changes: 11 additions & 1 deletion lib/inc/drogon/HttpAppFramework.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,16 @@
#include <vector>
#include <chrono>

#if defined(__APPLE__) && defined(__MACH__)
#if defined(__ENVIRONMENT_IPHONE_OS__) || \
defined(__IPHONE_OS_VERSION_MIN_REQUIRED)
// iOS
#define TARGET_OS_IOS 1
#elif defined(__MAC_OS_X_VERSION_MIN_REQUIRED)
// macOS
#endif
#endif

namespace drogon
{
// the drogon banner
Expand Down Expand Up @@ -997,7 +1007,7 @@ class DROGON_EXPORT HttpAppFramework : public trantor::NonCopyable
virtual HttpAppFramework &setFileTypes(
const std::vector<std::string> &types) = 0;

#ifndef _WIN32
#if !defined(_WIN32) && !TARGET_OS_IOS
/// Enable supporting for dynamic views loading.
/**
*
Expand Down
2 changes: 1 addition & 1 deletion lib/src/ConfigLoader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ static void loadApp(const Json::Value &app)
{
drogon::app().setMaxConnectionNumPerIP(maxConnsPerIP);
}
#ifndef _WIN32
#if !defined(_WIN32) && !TARGET_OS_IOS
// dynamic views
auto enableDynamicViews = app.get("load_dynamic_views", false).asBool();
if (enableDynamicViews)
Expand Down
6 changes: 3 additions & 3 deletions lib/src/HttpAppFrameworkImpl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ static void TERMFunction(int sig)
HttpAppFrameworkImpl::~HttpAppFrameworkImpl() noexcept
{
// Destroy the following objects before the loop destruction
#ifndef _WIN32
#if !defined(_WIN32) && !TARGET_OS_IOS
sharedLibManagerPtr_.reset();
#endif
sessionManagerPtr_.reset();
Expand Down Expand Up @@ -236,7 +236,7 @@ const std::string &HttpAppFrameworkImpl::getImplicitPage() const
{
return StaticFileRouter::instance().getImplicitPage();
}
#ifndef _WIN32
#if !defined(_WIN32) && !TARGET_OS_IOS
HttpAppFramework &HttpAppFrameworkImpl::enableDynamicViewsLoading(
const std::vector<std::string> &libPaths,
const std::string &outputPath)
Expand Down Expand Up @@ -599,7 +599,7 @@ void HttpAppFrameworkImpl::run()
LOG_INFO << "Start child process";
}

#ifndef _WIN32
#if !defined(_WIN32) && !TARGET_OS_IOS
if (!libFilePaths_.empty())
{
sharedLibManagerPtr_ =
Expand Down
4 changes: 2 additions & 2 deletions lib/src/HttpAppFrameworkImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ class HttpAppFrameworkImpl final : public HttpAppFramework
HttpAppFramework &setUploadPath(const std::string &uploadPath) override;
HttpAppFramework &setFileTypes(
const std::vector<std::string> &types) override;
#ifndef _WIN32
#if !defined(_WIN32) && !TARGET_OS_IOS
HttpAppFramework &enableDynamicViewsLoading(
const std::vector<std::string> &libPaths,
const std::string &outputPath) override;
Expand Down Expand Up @@ -709,7 +709,7 @@ class HttpAppFrameworkImpl final : public HttpAppFramework
size_t threadNum_{1};
std::unique_ptr<trantor::EventLoopThreadPool> ioLoopThreadPool_;

#ifndef _WIN32
#if !defined(_WIN32) && !TARGET_OS_IOS
std::vector<std::string> libFilePaths_;
std::string libFileOutputPath_;
std::unique_ptr<SharedLibManager> sharedLibManagerPtr_;
Expand Down
Loading