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 05bf26d
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 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
2 changes: 1 addition & 1 deletion drogon_ctl/version.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ static const char banner[] =
" \\__,_|_| \\___/ \\__, |\\___/|_| |_|\n"
" |___/ \n";

void version::handleCommand(std::vector<std::string> &parameters)
void drogonVersion::handleCommand(std::vector<std::string> &parameters)
{
std::cout << banner << std::endl;
std::cout << "A utility for drogon" << std::endl;
Expand Down
4 changes: 2 additions & 2 deletions drogon_ctl/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
using namespace drogon;
namespace drogon_ctl
{
class version : public DrObject<version>, public CommandHandler
class drogonVersion : public DrObject<drogonVersion>, public CommandHandler
{
public:
virtual void handleCommand(std::vector<std::string> &parameters) override;
Expand All @@ -31,7 +31,7 @@ class version : public DrObject<version>, public CommandHandler
{
return true;
}
version()
drogonVersion()
{
}
};
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 05bf26d

Please sign in to comment.