Skip to content

Commit

Permalink
Be able to use mavsdk library in debug and release mode side-by-side.
Browse files Browse the repository at this point in the history
Since it's not possible to mix debug and release msvc runtime on
windows, it's important to link against a mavsdk debug lib when
compiling the program for debug and later link against the mavsdk
release lib when deploying the program. But this did not work until now
because the name for the debug and release dll was the same. For this
purpose CMake invented the 'DEBUG_POSTFIX' property for a target.
The generated CMake files to find mavsdk are correctly filled with the
appropriate library name so no need to change anything else here.
  • Loading branch information
chehrlic committed Nov 23, 2023
1 parent 769f9a5 commit 3467929
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/mavsdk/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@ set_target_properties(mavsdk PROPERTIES
VERSION ${MAVSDK_VERSION_STRING}
SOVERSION ${MAVSDK_SOVERSION_STRING}
)
if (MSVC)
set_target_properties(mavsdk PROPERTIES
DEBUG_POSTFIX "d"
)
endif()

if (IOS)
target_link_libraries(mavsdk
Expand Down

0 comments on commit 3467929

Please sign in to comment.