Skip to content

Commit

Permalink
Fixed build
Browse files Browse the repository at this point in the history
  • Loading branch information
deathkiller committed Feb 21, 2024
1 parent e61f521 commit 12a3656
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 14 deletions.
15 changes: 8 additions & 7 deletions Sources/backward/backward.h
Original file line number Diff line number Diff line change
Expand Up @@ -3556,20 +3556,21 @@ namespace backward {

DWORD offset = 0;
#if defined(DEATH_TARGET_32BIT)
IMAGEHLP_LINEW lineW = { sizeof(IMAGEHLP_LINEW) };
// 32-bit library doesn't have SymGetLineFromAddrW() function
IMAGEHLP_LINE line = { sizeof(IMAGEHLP_LINE) };
if (::SymGetLineFromAddr(process, (ULONG64)t.addr, &offset, &line)) {
t.source.filename = line.FileName;
t.source.line = line.LineNumber;
t.source.col = offset;
}
#else
IMAGEHLP_LINEW64 lineW = { sizeof(IMAGEHLP_LINEW64) };
#endif
if (::SymGetLineFromAddrW(process, (ULONG64)t.addr, &offset, &lineW)) {
#if defined(DEATH_TARGET_32BIT)
// IMAGEHLP_LINEW structure has incorrect type
t.source.filename = Death::Utf8::FromUtf16((PWSTR)lineW.FileName);
#else
t.source.filename = Death::Utf8::FromUtf16(lineW.FileName);
#endif
t.source.line = lineW.LineNumber;
t.source.col = offset;
}
#endif

t.source.function = name;
t.object_function = name;
Expand Down
15 changes: 8 additions & 7 deletions cmake/ncine_helpers.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,15 @@ function(ncine_internal_add_compiler_flags)
endif()

if(ARGS_LANGUAGES)
set(enabled_languages "${arg_LANGUAGES}")
set(enabled_languages "${ARGS_LANGUAGES}")
else()
ncine_internal_get_enabled_languages(enabled_languages)
endif()

foreach(lang ${enabled_languages})
foreach(config ${ARGS_CONFIGS})
set(flag_var_name "CMAKE_${lang}_FLAGS_${config}")
ncine_internal_add_flags_inner(${flag_var_name} "${arg_FLAGS}" "${arg_IN_CACHE}")
ncine_internal_add_flags_inner(${flag_var_name} "${ARGS_FLAGS}" "${ARGS_IN_CACHE}")
set(${flag_var_name} "${${flag_var_name}}" PARENT_SCOPE)
endforeach()
endforeach()
Expand All @@ -77,7 +77,7 @@ function(ncine_internal_add_linker_flags)
foreach(config ${ARGS_CONFIGS})
foreach(t ${ARGS_TYPES})
set(flag_var_name "CMAKE_${t}_LINKER_FLAGS_${config}")
ncine_internal_add_flags_inner(${flag_var_name} "${arg_FLAGS}" "${arg_IN_CACHE}")
ncine_internal_add_flags_inner(${flag_var_name} "${ARGS_FLAGS}" "${ARGS_IN_CACHE}")
set(${flag_var_name} "${${flag_var_name}}" PARENT_SCOPE)
endforeach()
endforeach()
Expand Down Expand Up @@ -133,11 +133,11 @@ function(ncine_internal_remove_compiler_flags flags)

foreach(lang ${languages})
set(flag_var_name "CMAKE_${lang}_FLAGS")
ncine_internal_remove_flags_inner(${flag_var_name} "${flags}" "${arg_IN_CACHE}" ${extra_options})
ncine_internal_remove_flags_inner(${flag_var_name} "${flags}" "${ARGS_IN_CACHE}" ${extra_options})
set(${flag_var_name} "${${flag_var_name}}" PARENT_SCOPE)
foreach(config ${configs})
set(flag_var_name "CMAKE_${lang}_FLAGS_${config}")
ncine_internal_remove_flags_inner(${flag_var_name} "${flags}" "${arg_IN_CACHE}" ${extra_options})
ncine_internal_remove_flags_inner(${flag_var_name} "${flags}" "${ARGS_IN_CACHE}" ${extra_options})
set(${flag_var_name} "${${flag_var_name}}" PARENT_SCOPE)
endforeach()
endforeach()
Expand Down Expand Up @@ -182,7 +182,7 @@ function(ncine_internal_replace_compiler_flags match_string replace_string)
foreach(lang ${enabled_languages})
foreach(config ${ARGS_CONFIGS})
set(flag_var_name "CMAKE_${lang}_FLAGS_${config}")
ncine_internal_replace_flags_inner(${flag_var_name} "${match_string}" "${replace_string}" "${arg_IN_CACHE}")
ncine_internal_replace_flags_inner(${flag_var_name} "${match_string}" "${replace_string}" "${ARGS_IN_CACHE}")
set(${flag_var_name} "${${flag_var_name}}" PARENT_SCOPE)
endforeach()
endforeach()
Expand Down Expand Up @@ -223,8 +223,9 @@ function(ncine_normalize_optimizations)
IN_CACHE)
endforeach()

set(flag_value "/INCREMENTAL:NO")
ncine_internal_add_linker_flags(
FLAGS "/INCREMENTAL:NO"
FLAGS "${flag_value}"
CONFIGS RELEASE RELWITHDEBINFO MINSIZEREL
TYPES EXE SHARED MODULE # When linking static libraries, link.exe can't recognize this parameter, clang-cl will error out.
IN_CACHE)
Expand Down

0 comments on commit 12a3656

Please sign in to comment.