Skip to content

Commit

Permalink
Fixup ci
Browse files Browse the repository at this point in the history
  • Loading branch information
z4kn4fein committed Jul 28, 2024
1 parent 3a81f92 commit b9c5795
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 16 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ if(SEMVER_BUILD_MODULE)
set_target_properties(${PROJECT_NAME} PROPERTIES
CXX_STANDARD_REQUIRED ON
CXX_EXTENSIONS OFF)
target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_20)
target_sources(${PROJECT_NAME}
PUBLIC
FILE_SET CXX_MODULES FILES module/semver.cppm)
target_include_directories(${PROJECT_NAME}
PUBLIC
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>)
target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_20)
else()
add_library(${PROJECT_NAME} INTERFACE)
target_include_directories(
Expand Down
1 change: 0 additions & 1 deletion include/semver/semver.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,6 @@ namespace semver
#ifdef __cpp_lib_format
#if __cpp_lib_format >= 201907L

SEMVER_EXPORT
template <class CharT>
struct std::formatter<semver::version, CharT> : std::formatter<std::string_view> {
template <class FormatContext>
Expand Down
13 changes: 0 additions & 13 deletions module/semver.cppm
Original file line number Diff line number Diff line change
Expand Up @@ -24,30 +24,23 @@ SOFTWARE.

module;

#ifndef SEMVER_IMPORT_STD
#include <ostream>
#include <string>
#include <regex>
#include <utility>
#include <vector>

// conditionally include <format> and its dependency <string_view> for C++20
#ifdef __cpp_lib_format
#if __cpp_lib_format >= 201907L
#include <format>
#include <string_view>
#endif
#endif
#endif

export module semver;

#define SEMVER_MODULE

#ifdef SEMVER_IMPORT_STD
import std;
#endif

#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable: 5244)
Expand All @@ -69,9 +62,3 @@ import std;
#ifdef _MSC_VER
#pragma warning(pop)
#endif

#if defined(__cpp_lib_format)
export namespace std {
using std::formatter;
}
#endif
1 change: 0 additions & 1 deletion test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ if(SEMVER_BUILD_MODULE)
set_target_properties(${PROJECT_NAME}-tests-20 PROPERTIES CXX_SCAN_FOR_MODULES ON)
set_target_properties(${PROJECT_NAME}-tests-20 PROPERTIES CXX_EXTENSIONS OFF)
target_compile_definitions(${PROJECT_NAME}-tests-20 PRIVATE SEMVER_TEST_MODULE)
target_compile_definitions(${PROJECT_NAME}-tests-20 PRIVATE SEMVER_IMPORT_STD)
endif()
set_target_properties(${PROJECT_NAME}-tests-20 PROPERTIES CXX_STANDARD 20)
target_link_libraries(${PROJECT_NAME}-tests-20 PRIVATE Catch2::Catch2WithMain ${PROJECT_NAME})
Expand Down
2 changes: 2 additions & 0 deletions test/serialization.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ TEST_CASE("Test version std::ostream <<", "[version]") {
REQUIRE(ss.str() == "5.2.3");
}

#ifndef SEMVER_TEST_MODULE
#ifdef __cpp_lib_format
#if __cpp_lib_format >= 201907L

Expand All @@ -27,3 +28,4 @@ TEST_CASE("Test version std::format formatter", "[version]") {

#endif
#endif
#endif

0 comments on commit b9c5795

Please sign in to comment.