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 05ce23b commit 32dc0b8
Show file tree
Hide file tree
Showing 5 changed files with 304 additions and 13 deletions.
6 changes: 5 additions & 1 deletion Sources/backward/backward.h
Original file line number Diff line number Diff line change
Expand Up @@ -3555,7 +3555,11 @@ namespace backward {
}

DWORD offset = 0;
#if defined(DEATH_TARGET_32BIT)
IMAGEHLP_LINEW lineW = { sizeof(IMAGEHLP_LINEW) };
#else
IMAGEHLP_LINEW64 lineW = { sizeof(IMAGEHLP_LINEW64) };
#endif
if (::SymGetLineFromAddrW(process, (ULONG64)t.addr, &offset, &lineW)) {
t.source.filename = Death::Utf8::FromUtf16(lineW.FileName);
t.source.line = lineW.LineNumber;
Expand Down Expand Up @@ -3945,7 +3949,7 @@ namespace backward {

template<typename IT>
void print_stacktrace(IT begin, IT end, std::ostream& os, size_t thread_id, Colorize& colorize) {
print_header(os, thread_id);
print_header(os, thread_id, colorize);
for (; begin != end; ++begin) {
print_trace(os, *begin, colorize);
}
Expand Down
8 changes: 5 additions & 3 deletions cmake/Findlibopenmpt.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -62,22 +62,24 @@ if(NOT TARGET libopenmpt::libopenmpt)
)
FetchContent_MakeAvailable(LibopenmptGit)

ncine_add_dependency(Libopenmpt STATIC)
ncine_add_dependency(Libopenmpt STATIC ALLOW_EXCEPTIONS)

set(LIBOPENMPT_INCLUDE_DIR "${libopenmptgit_SOURCE_DIR}/libopenmpt/")
set_target_properties(Libopenmpt PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES ${LIBOPENMPT_INCLUDE_DIR})

target_compile_definitions(Libopenmpt PRIVATE "LIBOPENMPT_BUILD" "MPT_CHECK_CXX_IGNORE_WARNING_FINITEMATH")

if(EMSCRIPTEN)
target_compile_definitions(Libopenmpt PRIVATE "LIBOPENMPT_BUILD" "MPT_WITH_ZLIB" "MPT_WITH_MPG123" "MPT_WITH_VORBIS" "MPT_WITH_VORBISFILE" "MPT_BUILD_WASM")
target_compile_definitions(Libopenmpt PRIVATE "MPT_WITH_ZLIB" "MPT_WITH_MPG123" "MPT_WITH_VORBIS" "MPT_WITH_VORBISFILE" "MPT_BUILD_WASM")

target_compile_options(Libopenmpt PUBLIC "SHELL:-s USE_ZLIB=1 -s USE_MPG123=1 -s USE_OGG=1 -s USE_VORBIS=1")
target_link_options(Libopenmpt PUBLIC "SHELL:-s USE_ZLIB=1 -s USE_MPG123=1 -s USE_OGG=1 -s USE_VORBIS=1")
else()
find_package(ZLIB)

# TODO: Add MPT_WITH_MPG123 and MPT_WITH_VORBIS support
target_compile_definitions(Libopenmpt PRIVATE "LIBOPENMPT_BUILD" "MPT_WITH_ZLIB")
target_compile_definitions(Libopenmpt PRIVATE "MPT_WITH_ZLIB")
endif()

set(LIBOPENMPT_SOURCES)
Expand Down
4 changes: 3 additions & 1 deletion cmake/ncine_compiler_options.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ include(CheckStructHasMember)

set(CMAKE_CXX_SCAN_FOR_MODULES OFF)

ncine_normalize_optimizations()

target_compile_definitions(${NCINE_APP} PUBLIC "NCINE_VERSION=\"${NCINE_VERSION}\"")

string(TIMESTAMP NCINE_BUILD_YEAR "%Y")
Expand Down Expand Up @@ -109,7 +111,7 @@ if(WIN32)
endif()
endif()

ncine_add_compiler_options(${NCINE_APP})
ncine_apply_compiler_options(${NCINE_APP})

if(EMSCRIPTEN)
set(EMSCRIPTEN_LINKER_OPTIONS
Expand Down
2 changes: 1 addition & 1 deletion cmake/ncine_generated_sources.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ if(WIN32)
list(APPEND GENERATED_SOURCES "${NCINE_SOURCE_DIR}/App.manifest")
endif()

if(IS_DIRECTORY ${GENERATED_INCLUDE_DIR})
if(IS_DIRECTORY ${GENERATED_INCLUDE_DIR} AND TARGET ${NCINE_APP}) # Disabled if NCINE_BUILD_ANDROID
get_filename_component(PARENT_GENERATED_INCLUDE_DIR ${GENERATED_INCLUDE_DIR} DIRECTORY)
target_include_directories(${NCINE_APP}
INTERFACE $<BUILD_INTERFACE:${PARENT_GENERATED_INCLUDE_DIR}>
Expand Down
Loading

0 comments on commit 32dc0b8

Please sign in to comment.