Skip to content

Commit

Permalink
libbfd needs libintl and zlib.
Browse files Browse the repository at this point in the history
  - Look for libintl if bdf is found.

  - We use our own zlib so link to that where needed.
  • Loading branch information
mahge committed Jan 17, 2022
1 parent 72aca4f commit 2eba653
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions OMEdit/OMEditLIB/CMakeLists.txt
Expand Up @@ -290,6 +290,7 @@ target_link_libraries(OMEditLib PUBLIC ${OPENSCENEGRAPH_LIBRARIES})

if(MINGW)
target_link_libraries(OMEditLib PUBLIC binutils::bfd)
target_link_libraries(OMEditLib PUBLIC zlib)
endif()

target_include_directories(OMEditLib PRIVATE
Expand Down
10 changes: 7 additions & 3 deletions cmake/modules/Findbinutils.cmake
Expand Up @@ -22,18 +22,22 @@ include (FindPackageHandleStandardArgs)


# handle the QUIETLY and REQUIRED arguments and set binutils_FOUND to TRUE if all listed variables are TRUE
find_package_handle_standard_args(binutils DEFAULT_MSG
LIBBFD_LIBRARY
LIBIBERTY_LIBRARY)
find_package_handle_standard_args(binutils
REQUIRED_VARS LIBBFD_LIBRARY LIBIBERTY_LIBRARY
HANDLE_COMPONENTS)

mark_as_advanced(LIBBFD_LIBRARY LIBIBERTY_LIBRARY)

if(binutils_FOUND)

find_package(Intl REQUIRED)

add_library(binutils::iberty STATIC IMPORTED)
set_target_properties(binutils::iberty PROPERTIES IMPORTED_LOCATION ${LIBIBERTY_LIBRARY})

add_library(binutils::bfd STATIC IMPORTED)
set_target_properties(binutils::bfd PROPERTIES IMPORTED_LOCATION ${LIBBFD_LIBRARY})

target_link_libraries(binutils::bfd INTERFACE binutils::iberty)
target_link_libraries(binutils::bfd INTERFACE ${Intl_LIBRARIES})
endif()

0 comments on commit 2eba653

Please sign in to comment.