mirror of
https://github.com/loot/libloot.git
synced 2026-07-27 14:16:01 -07:00
Append -fno-lto to CXXFLAGS
When building the first layer of the C++ wrapper, to fix undefined symbol errors when linking libloot as built by Manjaro Linux's default makepkg config.
This commit is contained in:
+7
-1
@@ -36,7 +36,13 @@ else()
|
||||
endif()
|
||||
|
||||
add_custom_target(libloot-cpp-build
|
||||
COMMAND cargo build
|
||||
# Force LTO to be disabled when building the first layer of the C++ wrapper,
|
||||
# as it may be enabled by default, and if so that leads to undefined symbols
|
||||
# in the C++ wrapper's shared library. It's not enough to just pass -fno-lto
|
||||
# when building libloot-cpp itself, it also needs to be passed when building
|
||||
# the cxx crate, as otherwise there will be missing cxxbridge symbols.
|
||||
COMMAND ${CMAKE_COMMAND} -E env --modify "CXXFLAGS=string_append: -fno-lto" --
|
||||
cargo build
|
||||
$<$<NOT:$<CONFIG:Debug>>:--release>
|
||||
$<$<AND:$<CONFIG:Debug>,$<PLATFORM_ID:Windows>>:--config>
|
||||
$<$<AND:$<CONFIG:Debug>,$<PLATFORM_ID:Windows>>:${PROJECT_SOURCE_DIR}/.cargo/msvc-debug-config.toml>
|
||||
|
||||
Reference in New Issue
Block a user