Skip to content

Commit

Permalink
Test library on Windows and bump up version
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonMaracine committed Apr 12, 2024
1 parent c23dfa0 commit 34f194e
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ an incomplete list of missing features of my version or differences between the
- Deprecated features as of `C++17` are missing (for good)

The code is unit-tested. Almost every public functionality is tested in its own unit. Also Valgrind is
regularly used in development to check for memory bugs. Tested on `GCC 13.2`.
regularly used in development to check for memory bugs. Tested compilation on `GCC 13.2` and `MSVC 19.39`.

If you need a specific missing feature, or need this library to work on lower versions of C++, feel free to open
up an issue.
Expand Down
2 changes: 1 addition & 1 deletion src/shared_ref/version.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

namespace sm {
inline constexpr unsigned int VERSION_MAJOR {0u};
inline constexpr unsigned int VERSION_MINOR {1u};
inline constexpr unsigned int VERSION_MINOR {2u};
inline constexpr unsigned int VERSION_PATCH {0u};
}
16 changes: 14 additions & 2 deletions tests/perf/memory/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,13 @@ add_executable(test_shared_ref

target_link_libraries(test_shared_ref PRIVATE cpp_shared_ref)

target_compile_options(test_shared_ref PRIVATE "-Wall" "-Wextra" "-Wpedantic" "-g" "-fno-inline")
if(UNIX)
target_compile_options(test_shared_ref PRIVATE "-Wall" "-Wextra" "-Wpedantic" "-g" "-fno-inline")
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
target_compile_options(test_shared_ref PRIVATE "/W4")
else()
message(WARNING "Warnings are not enabled")
endif()

target_compile_features(test_shared_ref PRIVATE cxx_std_17)
set_target_properties(test_shared_ref PROPERTIES CXX_EXTENSIONS OFF)
Expand All @@ -19,7 +25,13 @@ add_executable(test_shared_ptr
"shared_ptr.cpp"
)

target_compile_options(test_shared_ptr PRIVATE "-Wall" "-Wextra" "-Wpedantic" "-g" "-fno-inline")
if(UNIX)
target_compile_options(test_shared_ptr PRIVATE "-Wall" "-Wextra" "-Wpedantic" "-g" "-fno-inline")
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
target_compile_options(test_shared_ptr PRIVATE "/W4")
else()
message(WARNING "Warnings are not enabled")
endif()

target_compile_features(test_shared_ptr PRIVATE cxx_std_17)
set_target_properties(test_shared_ptr PROPERTIES CXX_EXTENSIONS OFF)
8 changes: 7 additions & 1 deletion tests/perf/speed/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,13 @@ add_executable(test_speed

target_link_libraries(test_speed PRIVATE cpp_shared_ref)

target_compile_options(test_speed PRIVATE "-Wall" "-Wextra" "-Wpedantic" "-O2")
if(UNIX)
target_compile_options(test_speed PRIVATE "-Wall" "-Wextra" "-Wpedantic" "-O2")
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
target_compile_options(test_speed PRIVATE "/W4")
else()
message(WARNING "Warnings are not enabled")
endif()

target_compile_features(test_speed PRIVATE cxx_std_17)
set_target_properties(test_speed PROPERTIES CXX_EXTENSIONS OFF)
8 changes: 7 additions & 1 deletion tests/unit/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,13 @@ add_executable(test_unit

target_link_libraries(test_unit PRIVATE cpp_shared_ref GTest::gtest_main)

target_compile_options(test_unit PRIVATE "-Wall" "-Wextra" "-Wpedantic" "-fno-elide-constructors")
if(UNIX)
target_compile_options(test_unit PRIVATE "-Wall" "-Wextra" "-Wpedantic" "-fno-elide-constructors")
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
target_compile_options(test_unit PRIVATE "/W4")
else()
message(WARNING "Warnings are not enabled")
endif()

target_compile_features(test_unit PRIVATE cxx_std_17)
set_target_properties(test_unit PROPERTIES CXX_EXTENSIONS OFF)

0 comments on commit 34f194e

Please sign in to comment.