Skip to content

Commit

Permalink
Add support for Solaris
Browse files Browse the repository at this point in the history
Tested on illumos distribution OmniOS Community Edition.
  • Loading branch information
vedranmiletic committed Aug 23, 2022
1 parent f582a16 commit e7a3b7d
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ target_link_libraries(${PROJECT_NAME} PUBLIC trantor)
if(${CMAKE_SYSTEM_NAME} STREQUAL "Haiku")
target_link_libraries(${PROJECT_NAME} PRIVATE network)
elseif (NOT WIN32 AND NOT ${CMAKE_SYSTEM_NAME} STREQUAL "OpenBSD")
target_link_libraries(${PROJECT_NAME} PRIVATE dl)
target_link_libraries(${PROJECT_NAME} PRIVATE dl $<$<PLATFORM_ID:SunOS>:socket>)
elseif (WIN32)
target_link_libraries(${PROJECT_NAME} PRIVATE shlwapi)
endif ()
Expand Down
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ if [ -f /bin/ninja ]; then
make_program=ninja
cmake_gen='-GNinja'
else
make_flags="$make_flags -j$parallel"
make_flags="$make_flags -j $parallel"
fi

if [ "$1" = "-t" ]; then
Expand Down
3 changes: 1 addition & 2 deletions drogon_ctl/version.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#include <trantor/net/Resolver.h>
#include <iostream>

using namespace drogon_ctl;
static const char banner[] =
R"( _
__| |_ __ ___ __ _ ___ _ __
Expand All @@ -28,7 +27,7 @@ static const char banner[] =
|___/
)";

void version::handleCommand(std::vector<std::string> &parameters)
void drogon_ctl::version::handleCommand(std::vector<std::string> &parameters)
{
std::cout << banner << std::endl;
std::cout << "A utility for drogon" << std::endl;
Expand Down
8 changes: 4 additions & 4 deletions lib/src/SharedLibManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ void SharedLibManager::managerLibs()
void *oldHandle = nullptr;
if (dlMap_.find(filename) != dlMap_.end())
{
#if defined __linux__ || defined __HAIKU__
#if defined __linux__ || defined __HAIKU__ || defined __sun
if (st.st_mtim.tv_sec >
dlMap_[filename].mTime.tv_sec)
#elif defined _WIN32
Expand Down Expand Up @@ -168,7 +168,7 @@ void SharedLibManager::managerLibs()
dlStat.handle =
compileAndLoadLib(srcFile, oldHandle);
}
#if defined __linux__ || defined __HAIKU__
#if defined __linux__ || defined __HAIKU__ || defined __sun
dlStat.mTime = st.st_mtim;
#elif defined _WIN32
dlStat.mTime.tv_sec = st.st_mtime;
Expand Down Expand Up @@ -236,7 +236,7 @@ void *SharedLibManager::compileAndLoadLib(const std::string &sourceFile,
bool SharedLibManager::shouldCompileLib(const std::string &soFile,
const struct stat &sourceStat)
{
#if defined __linux__ || defined __HAIKU__
#if defined __linux__ || defined __HAIKU__ || defined __sun
auto sourceModifiedTime = sourceStat.st_mtim.tv_sec;
#elif defined _WIN32
auto sourceModifiedTime = sourceStat.st_mtime;
Expand All @@ -251,7 +251,7 @@ bool SharedLibManager::shouldCompileLib(const std::string &soFile,
return true;
}

#if defined __linux__ || defined __HAIKU__
#if defined __linux__ || defined __HAIKU__ || defined __sun
auto soModifiedTime = soStat.st_mtim.tv_sec;
#elif defined _WIN32
auto soModifiedTime = soStat.st_mtime;
Expand Down

0 comments on commit e7a3b7d

Please sign in to comment.