Skip to content

Commit

Permalink
Remove Boost
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Carroll <[email protected]>
  • Loading branch information
mjcarroll committed Aug 31, 2021
1 parent 712bcaa commit ec7048b
Show file tree
Hide file tree
Showing 9 changed files with 446 additions and 1,233 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: macOS latest

on: [push, pull_request]

jobs:
build:
env:
PACKAGE: ignition-common4
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: Set up Homebrew
id: set-up-homebrew
uses: Homebrew/actions/setup-homebrew@master
- run: brew config

- name: Install base dependencies
run: |
brew tap osrf/simulation;
brew install --only-dependencies ${PACKAGE};
- run: mkdir build
- name: cmake
working-directory: build
run: cmake .. -DCMAKE_INSTALL_PREFIX=/usr/local/Cellar/${PACKAGE}/HEAD
- run: make
working-directory: build
- run: make test
working-directory: build
env:
CTEST_OUTPUT_ON_FAILURE: 1
- name: make install
working-directory: build
run: |
make install;
brew link ${PACKAGE};
8 changes: 7 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,15 @@ ign_create_core_library(
SOURCES ${sources}
CXX_STANDARD 17)

if (CMAKE_CXX_COMPILER_ID STREQUAL GNU)
set(CXX_FILESYSTEM_LIBRARIES stdc++fs)
else()
set(CXX_FILESYSTEM_LIBRARIES)
endif()

# Link the libraries that we always need
target_link_libraries(${PROJECT_LIBRARY_TARGET_NAME}
PRIVATE ${DL_TARGET})
PRIVATE ${DL_TARGET} ${CXX_FILESYSTEM_LIBRARIES})

# This is required by the WorkerPool::WaitForResults(const Time &_timeout)
# TODO(anyone): IGN_DEPRECATED(4). Remove this part when the method is removed
Expand Down
2 changes: 1 addition & 1 deletion src/Console.cc
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ void FileLogger::Init(const std::string &_directory,
if (isDirectory(logPath))
this->logDirectory = logPath;
else
this->logDirectory = logPath.substr(0, logPath.rfind(separator("")));
this->logDirectory = common::parentPath(logPath);

this->initialized = true;

Expand Down
80 changes: 80 additions & 0 deletions src/DirIter.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
/*
* Copyright (C) 2021 Open Source Robotics Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/

#include <filesystem>

#include "ignition/common/Filesystem.hh"

namespace fs = std::filesystem;

namespace ignition
{
namespace common
{

class DirIterPrivate
{
public: fs::directory_iterator it;
};

DirIter::DirIter():
dataPtr(std::make_unique<DirIterPrivate>())
{
this->dataPtr->it = fs::directory_iterator();
}

DirIter::DirIter(const std::string &_in):
DirIter()
{
try {
this->dataPtr->it = fs::directory_iterator(_in);
}
catch (const fs::filesystem_error &ex)
{
}
}

DirIter::~DirIter()
{
this->dataPtr.reset();
}

std::string DirIter::operator*() const
{
return this->dataPtr->it->path().string();
}

const DirIter &DirIter::operator++()
{
this->dataPtr->it++;
return *this;
}

bool DirIter::operator!=(const DirIter &_other) const
{
return (this->dataPtr->it != _other.dataPtr->it);
}

void DirIter::Next() {}

void DirIter::SetInternalEmpty() {}

void DirIter::CloseHandle() {}

} // namespace common
} // namespace ignition

Loading

0 comments on commit ec7048b

Please sign in to comment.