Skip to content

Commit 83c6e5a

Browse files
committed
fix clang-msvc build
1 parent cad1bcf commit 83c6e5a

File tree

5 files changed

+13
-12
lines changed

5 files changed

+13
-12
lines changed

CMakeLists.txt

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,9 @@ endif()
1111

1212
if (CCR_STANDALONE)
1313
set(CCR_DEFAULTOPT On)
14-
else()
15-
set(CCR_DEFAULTOPT Off)
16-
endif()
17-
18-
if (CCR_STANDALONE)
1914
set(CCR_EXCLUDE_FROM_ALL "")
2015
else()
16+
set(CCR_DEFAULTOPT Off)
2117
set(CCR_EXCLUDE_FROM_ALL "EXCLUDE_FROM_ALL")
2218
endif()
2319

@@ -27,8 +23,13 @@ option(CCR_ENABLE_COVERAGE "Enable compiler flags for code coverage measurements
2723

2824
set(BUILD_SHARED_LIBS Off CACHE STRING "")
2925

30-
add_compile_options(-fsanitize=address)
31-
add_link_options(-fsanitize=address)
26+
message(STATUS "CXX_COMPILER_ID: ${CMAKE_CXX_COMPILER_ID}")
27+
message(STATUS "CXX_SIMULATE_ID: ${CMAKE_CXX_SIMULATE_ID}")
28+
29+
if (NOT CMAKE_CXX_SIMULATE_ID MATCHES "MSVC")
30+
add_compile_options(-fsanitize=address)
31+
add_link_options(-fsanitize=address)
32+
endif()
3233

3334
if (CCR_BUILD_TESTS)
3435
ccr_enable_testing()

cucumber_cpp/library/api/Gherkin.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ namespace cucumber_cpp::library::api
2828
{
2929
envelope.source = {
3030
.uri = path.string(),
31-
.data = cucumber::gherkin::slurp(path),
31+
.data = cucumber::gherkin::slurp(path.string()),
3232
};
3333

3434
broadcaster.BroadcastEvent(envelope);

cucumber_cpp/library/api/RunCucumber.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ namespace cucumber_cpp::library::api
5353
.type = stepDefinition.patternType,
5454
},
5555
.source_reference = {
56-
.uri = stepDefinition.uri,
56+
.uri = stepDefinition.uri.string(),
5757
.location = cucumber::messages::location{
5858
.line = stepDefinition.line,
5959
},

cucumber_cpp/library/formatter/helper/TestCaseAttemptFormatter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ namespace cucumber_cpp::library::formatter::helper
1616
namespace
1717
{
1818
// to be moved tyo LocationHelpers.hpp
19-
std::string FormatLocation(LineAndUri obj, std::optional<std::string> cwd = std::nullopt)
19+
std::string FormatLocation(LineAndUri obj, std::optional<std::filesystem::path> cwd = std::nullopt)
2020
{
2121
std::string uri = obj.uri;
2222
if (cwd)

cucumber_cpp/library/formatter/helper/TestCaseAttemptParser.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,15 @@ namespace cucumber_cpp::library::formatter::helper
5454
{
5555
const auto& definition = supportCode.stepRegistry.GetDefinitionById(testStep.step_definition_ids->front());
5656
parsedTestStep.actionLocation = {
57-
.uri = definition.uri,
57+
.uri = definition.uri.string(),
5858
.line = definition.line,
5959
};
6060
}
6161

6262
if (testStep.pickle_step_id)
6363
{
6464
parsedTestStep.location = {
65-
.uri = pickleUri,
65+
.uri = pickleUri.string(),
6666
.line = gherkinStepMap.at(pickleStep.ast_node_ids.front()).location.line
6767
};
6868
parsedTestStep.text = pickleStep.text;

0 commit comments

Comments
 (0)