Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update vendored CMakeRC to latest commit #436

Merged
merged 3 commits into from
Nov 17, 2023
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
8 changes: 4 additions & 4 deletions 3rdparty/catch2.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
set(_dir "${CMAKE_CURRENT_SOURCE_DIR}/catch2")

if(YCM_DOWNLOAD_3RDPARTY)
set(_files extras/Catch.cmake ab6c7375be9a8e71ee84c6f8537113f9f47daf99
extras/CatchAddTests.cmake ab6c7375be9a8e71ee84c6f8537113f9f47daf99
extras/ParseAndAddCatchTests.cmake ab6c7375be9a8e71ee84c6f8537113f9f47daf99
LICENSE.txt ab6c7375be9a8e71ee84c6f8537113f9f47daf99)
set(_files extras/Catch.cmake b54f8d387479caeffb8da540c65dff40e649dd91
extras/CatchAddTests.cmake 75e59b4c924d7233bc947cad05fb4ee86a784eec
extras/ParseAndAddCatchTests.cmake 021c11738cad3f2139e09b2bb252a44d357bfd34
LICENSE.txt 3cba29011be2b9d59f6204d6fa0a386b1b2dbd90)
set(_ref v3.2.1)
_ycm_download(3rdparty-catch2
"Catch2 (C++ Automated Test Cases in a Header) git repository"
Expand Down
2 changes: 1 addition & 1 deletion 3rdparty/catch2/README.Catch2
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Some of the files in this folder and its subfolder come from the Catch2 git
repository (ref v2.13.4):
repository (ref v3.2.1):

https://github.com/catchorg/Catch2/

Expand Down
4 changes: 2 additions & 2 deletions 3rdparty/cmrc.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
set(_dir "${CMAKE_CURRENT_SOURCE_DIR}/cmrc")

if(YCM_DOWNLOAD_3RDPARTY)
set(_files CMakeRC.cmake 15109e38dddefce15028a0d0563557b2dc72446a
set(_files CMakeRC.cmake 6f82bf951d9d32c610892b1315ad588dbfc2f8de
LICENSE.txt 053245749bccc40304ec4d9d0a47aea0b1c9f8f6)
set(_ref f26f6e35a859b0ba28818dbcc0ed9b3880881cf4)
set(_ref 952ffddba731fc110bd50409e8d2b8a06abbd237)

_ycm_download(3rdparty-cmrc
"CMakeRC (A Standalone CMake-Based C++ Resource Compiler) git repository"
Expand Down
35 changes: 27 additions & 8 deletions 3rdparty/cmrc/CMakeRC.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ endif()

set(_version 2.0.0)

cmake_minimum_required(VERSION 3.3)
cmake_minimum_required(VERSION 3.12)
include(CMakeParseArguments)

if(COMMAND cmrc_add_resource_library)
Expand Down Expand Up @@ -77,6 +77,10 @@ set(hpp_content [==[
#include <system_error>
#include <type_traits>

#if !(defined(__EXCEPTIONS) || defined(__cpp_exceptions) || defined(_CPPUNWIND) || defined(CMRC_NO_EXCEPTIONS))
#define CMRC_NO_EXCEPTIONS 1
#endif

namespace cmrc { namespace detail { struct dummy; } }

#define CMRC_DECLARE(libid) \
Expand Down Expand Up @@ -243,15 +247,15 @@ public:
return !(*this == rhs);
}

iterator operator++() noexcept {
auto cp = *this;
iterator& operator++() noexcept {
++_base_iter;
return cp;
return *this;
}

iterator& operator++(int) noexcept {
iterator operator++(int) noexcept {
auto cp = *this;
++_base_iter;
return *this;
return cp;
}
};

Expand Down Expand Up @@ -339,7 +343,12 @@ public:
file open(const std::string& path) const {
auto entry_ptr = _get(path);
if (!entry_ptr || !entry_ptr->is_file()) {
#ifdef CMRC_NO_EXCEPTIONS
fprintf(stderr, "Error no such file or directory: %s\n", path.c_str());
abort();
#else
throw std::system_error(make_error_code(std::errc::no_such_file_or_directory), path);
#endif
}
auto& dat = entry_ptr->as_file();
return file{dat.begin_ptr, dat.end_ptr};
Expand All @@ -362,10 +371,20 @@ public:
directory_iterator iterate_directory(const std::string& path) const {
auto entry_ptr = _get(path);
if (!entry_ptr) {
#ifdef CMRC_NO_EXCEPTIONS
fprintf(stderr, "Error no such file or directory: %s\n", path.c_str());
abort();
#else
throw std::system_error(make_error_code(std::errc::no_such_file_or_directory), path);
#endif
}
if (!entry_ptr->is_directory()) {
#ifdef CMRC_NO_EXCEPTIONS
fprintf(stderr, "Error not a directory: %s\n", path.c_str());
abort();
#else
throw std::system_error(make_error_code(std::errc::not_a_directory), path);
#endif
}
return entry_ptr->as_directory().begin();
}
Expand All @@ -387,7 +406,7 @@ endif()
file(GENERATE OUTPUT "${cmrc_hpp}" CONTENT "${hpp_content}" CONDITION ${_generate})

add_library(cmrc-base INTERFACE)
target_include_directories(cmrc-base INTERFACE "${CMRC_INCLUDE_DIR}")
target_include_directories(cmrc-base INTERFACE $<BUILD_INTERFACE:${CMRC_INCLUDE_DIR}>)
# Signal a basic C++11 feature to require C++11.
target_compile_features(cmrc-base INTERFACE cxx_nullptr)
set_property(TARGET cmrc-base PROPERTY INTERFACE_CXX_EXTENSIONS OFF)
Expand Down Expand Up @@ -566,7 +585,7 @@ function(cmrc_add_resources name)
endif()
get_filename_component(dirpath "${ARG_PREFIX}${relpath}" DIRECTORY)
_cmrc_register_dirs("${name}" "${dirpath}")
get_filename_component(abs_out "${libdir}/intermediate/${relpath}.cpp" ABSOLUTE)
get_filename_component(abs_out "${libdir}/intermediate/${ARG_PREFIX}${relpath}.cpp" ABSOLUTE)
# Generate a symbol name relpath the file's character array
_cm_encode_fpath(sym "${relpath}")
# Get the symbol name for the parent directory
Expand Down
2 changes: 1 addition & 1 deletion 3rdparty/cmrc/README.CMakeRC
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Some of the files in this folder and its subfolder come from the CMakeRC git
repository (ref f26f6e35a859b0ba28818dbcc0ed9b3880881cf4):
repository (ref 952ffddba731fc110bd50409e8d2b8a06abbd237):

https://github.com/vector-of-bool/cmrc/

Expand Down
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## [Unreleased Patch]

### Changed

* Update CMakeRC to latest version as of November 2023 (https://github.com/robotology/ycm/pull/436).

### Deprecated

Deprecate `OpenCV_LIBRARIES` library set by `find_package(OpenCV)`, downstream users should just use `OpenCV_LIBS` as set by official OpenCV CMake config files (https://github.com/robotology/ycm/pull/434).
* Deprecate `OpenCV_LIBRARIES` library set by `find_package(OpenCV)`, downstream users should just use `OpenCV_LIBS` as set by official OpenCV CMake config files (https://github.com/robotology/ycm/pull/434).

### Removed

Expand Down
Loading