From d32550f7b80c53e2aa4a80dbdcc80ccac57e849a Mon Sep 17 00:00:00 2001 From: Stefano Date: Fri, 20 Jan 2023 14:04:30 +0100 Subject: [PATCH 1/3] Adding suggestion from #64 --- include/matioCpp/impl/MultiDimensionalArray.tpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/matioCpp/impl/MultiDimensionalArray.tpp b/include/matioCpp/impl/MultiDimensionalArray.tpp index 5367ccd5..c45be05c 100644 --- a/include/matioCpp/impl/MultiDimensionalArray.tpp +++ b/include/matioCpp/impl/MultiDimensionalArray.tpp @@ -65,7 +65,7 @@ matioCpp::MultiDimensionalArray::MultiDimensionalArray(const std::string &nam } template -matioCpp::MultiDimensionalArray::MultiDimensionalArray(const std::string &name, const std::vector::index_type> &dimensions) +matioCpp::MultiDimensionalArray::MultiDimensionalArray(const std::string &name, const std::vector::index_type> &dimensions) { matioCpp::MultiDimensionalArray::index_type totalElements = 1; for (matioCpp::MultiDimensionalArray::index_type dim : dimensions) @@ -88,7 +88,7 @@ matioCpp::MultiDimensionalArray::MultiDimensionalArray(const std::string &nam } template -matioCpp::MultiDimensionalArray::MultiDimensionalArray(const std::string &name, const std::vector::index_type> &dimensions, matioCpp::MultiDimensionalArray::const_pointer inputVector) +matioCpp::MultiDimensionalArray::MultiDimensionalArray(const std::string &name, const std::vector::index_type> &dimensions, matioCpp::MultiDimensionalArray::const_pointer inputVector) { for (matioCpp::MultiDimensionalArray::index_type dim : dimensions) { @@ -316,13 +316,13 @@ typename matioCpp::MultiDimensionalArray::value_type matioCpp::MultiDimension } template -typename matioCpp::MultiDimensionalArray::reference matioCpp::MultiDimensionalArray::operator[](const std::vector::index_type> &el) +typename matioCpp::MultiDimensionalArray::reference matioCpp::MultiDimensionalArray::operator[](const std::vector::index_type> &el) { return data()[rawIndexFromIndices(el)]; } template -typename matioCpp::MultiDimensionalArray::value_type matioCpp::MultiDimensionalArray::operator[](const std::vector::index_type> &el) const +typename matioCpp::MultiDimensionalArray::value_type matioCpp::MultiDimensionalArray::operator[](const std::vector::index_type> &el) const { return data()[rawIndexFromIndices(el)]; } From 29021a733fb03284a21e39b6b8736d8f676157a3 Mon Sep 17 00:00:00 2001 From: Stefano Date: Fri, 20 Jan 2023 14:51:37 +0100 Subject: [PATCH 2/3] Attempt to fix conda in Linux As in https://github.com/robotology/idyntree-yarp-tools/pull/42 --- .github/workflows/conda-forge-ci.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/conda-forge-ci.yml b/.github/workflows/conda-forge-ci.yml index 8339092f..27572dd5 100644 --- a/.github/workflows/conda-forge-ci.yml +++ b/.github/workflows/conda-forge-ci.yml @@ -23,9 +23,8 @@ jobs: - uses: conda-incubator/setup-miniconda@v2 with: - mamba-version: "*" - channels: conda-forge,defaults - channel-priority: true + miniforge-variant: Mambaforge + miniforge-version: latest - name: Dependencies shell: bash -l {0} From 3cff03d6745c236a9526fa52ff483764791fb3c6 Mon Sep 17 00:00:00 2001 From: Stefano Date: Fri, 20 Jan 2023 14:04:47 +0100 Subject: [PATCH 3/3] Testing on Windows with /permissive- flag --- .github/workflows/conda-forge-ci.yml | 2 +- CMakeLists.txt | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/conda-forge-ci.yml b/.github/workflows/conda-forge-ci.yml index 27572dd5..59e4a30a 100644 --- a/.github/workflows/conda-forge-ci.yml +++ b/.github/workflows/conda-forge-ci.yml @@ -48,7 +48,7 @@ jobs: run: | mkdir -p build cd build - cmake -G"Visual Studio 16 2019" -DBUILD_TESTING:BOOL=ON -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} .. + cmake -G"Visual Studio 16 2019" -DBUILD_TESTING:BOOL=ON -DDISABLE_PERMISSIVE:BOOL=ON -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} .. - name: Build shell: bash -l {0} diff --git a/CMakeLists.txt b/CMakeLists.txt index 0091c288..3bf2ea07 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -31,6 +31,9 @@ set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) # installation directories. if(MSVC) set(CMAKE_DEBUG_POSTFIX "d") + + option(DISABLE_PERMISSIVE "Add the /permissive- flag to MSVC" OFF) + mark_as_advanced(DISABLE_PERMISSIVE) endif() # Build position independent code. @@ -188,6 +191,12 @@ if (Eigen3_FOUND) endif() target_compile_features(matioCpp PUBLIC cxx_std_14) +if(DISABLE_PERMISSIVE) + message(STATUS "Adding /permissive- flag.") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /permissive-") + set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /permissive-") + add_compile_options(/permissive-) +endif() set_target_properties(matioCpp PROPERTIES OUTPUT_NAME matioCpp