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 Jun 9, 2020
1 parent be6f096 commit 72fbd81
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 @@ -69,7 +69,7 @@ add_subdirectory(trantor)
target_link_libraries(${PROJECT_NAME} PUBLIC trantor)

if(NOT WIN32)
target_link_libraries(${PROJECT_NAME} PRIVATE dl)
target_link_libraries(${PROJECT_NAME} PRIVATE dl $<$<PLATFORM_ID:SunOS>:socket>)
else(NOT WIN32)
target_link_libraries(${PROJECT_NAME} PRIVATE shlwapi)
endif(NOT WIN32)
Expand Down
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ if [ -f /bin/ninja ]; then
make_program=ninja
cmake_gen='-G Ninja'
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[] =
" _ \n"
" __| |_ __ ___ __ _ ___ _ __ \n"
Expand All @@ -27,7 +26,7 @@ static const char banner[] =
" \\__,_|_| \\___/ \\__, |\\___/|_| |_|\n"
" |___/ \n";

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 @@ -104,7 +104,7 @@ void SharedLibManager::managerLibs()
void *oldHandle = nullptr;
if (dlMap_.find(filename) != dlMap_.end())
{
#ifdef __linux__
#if defined __linux__ || defined __sun
if (st.st_mtim.tv_sec >
dlMap_[filename].mTime.tv_sec)
#elif defined _WIN32
Expand Down Expand Up @@ -166,7 +166,7 @@ void SharedLibManager::managerLibs()
dlStat.handle =
compileAndLoadLib(srcFile, oldHandle);
}
#ifdef __linux__
#if defined __linux__ || defined __sun
dlStat.mTime = st.st_mtim;
#elif defined _WIN32
dlStat.mTime.tv_sec = st.st_mtime;
Expand Down Expand Up @@ -234,7 +234,7 @@ void *SharedLibManager::compileAndLoadLib(const std::string &sourceFile,
bool SharedLibManager::shouldCompileLib(const std::string &soFile,
const struct stat &sourceStat)
{
#ifdef __linux__
#if defined __linux__ || defined __sun
auto sourceModifiedTime = sourceStat.st_mtim.tv_sec;
#elif defined _WIN32
auto sourceModifiedTime = sourceStat.st_mtime;
Expand All @@ -249,7 +249,7 @@ bool SharedLibManager::shouldCompileLib(const std::string &soFile,
return true;
}

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

0 comments on commit 72fbd81

Please sign in to comment.