Skip to content

Commit

Permalink
Split BFD and LINK libs
Browse files Browse the repository at this point in the history
  • Loading branch information
certik committed Aug 26, 2020
1 parent fc2c23b commit 093882e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
14 changes: 12 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -142,17 +142,27 @@ set(WITH_EXECINFO no
CACHE BOOL "Build with execinfo support (requires glibc)")
set(WITH_UNWIND no
CACHE BOOL "Build with unwind support")
set(WITH_BFD no
CACHE BOOL "Build with BFD support")
set(WITH_LINKH no
CACHE BOOL "Build with link.h support")
set(WITH_STACKTRACE no
CACHE BOOL "Build with stacktrace support (requires binutils-dev)")
if (WITH_STACKTRACE)
if (NOT (WITH_EXECINFO OR WITH_UNWIND))
set(WITH_UNWIND yes)
endif ()
set(WITH_BFD yes)
set(WITH_LINKH yes)
set(HAVE_LFORTRAN_STACKTRACE yes)
endif()
if (WITH_BFD)
find_package(BFD REQUIRED)
find_package(LINKH REQUIRED)
set(HAVE_LFORTRAN_BFD yes)
endif()
if (WITH_LINKH)
find_package(LINKH REQUIRED)
set(HAVE_LFORTRAN_LINK yes)
set(HAVE_LFORTRAN_STACKTRACE yes)
endif()
if (WITH_EXECINFO)
find_package(EXECINFO REQUIRED)
Expand Down
7 changes: 5 additions & 2 deletions src/lfortran/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,11 @@ endif()
if (WITH_JSON)
target_link_libraries(lfortran_lib p::rapidjson)
endif()
if (WITH_STACKTRACE)
target_link_libraries(lfortran_lib p::bfd p::link)
if (WITH_BFD)
target_link_libraries(lfortran_lib p::bfd)
endif()
if (WITH_LINK)
target_link_libraries(lfortran_lib p::link)
endif()
if (WITH_EXECINFO)
target_link_libraries(lfortran_lib p::execinfo)
Expand Down

0 comments on commit 093882e

Please sign in to comment.