@@ -523,26 +523,28 @@ if(CPPTRACE_UNWIND_WITH_LIBUNWIND)
523
523
endif ()
524
524
endif ()
525
525
if (NOT libunwind_FOUND)
526
- # set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS ON)
527
- # set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB32_PATHS ON)
528
- find_path (LIBUNWIND_INCLUDE_DIRS NAMES "libunwind.h" )
529
- find_library (LIBUNWIND NAMES unwind libunwind libunwind8 libunwind.so.8 REQUIRED PATHS "/usr/lib/x86_64-linux-gnu/" )
530
- if (LIBUNWIND)
531
- set (libunwind_FOUND TRUE )
532
- endif ()
533
- if (NOT libunwind_FOUND)
534
- # message(FATAL_ERROR "Unable to locate libunwind")
535
- # Try to link with it if it's where it should be
536
- # This path can be entered if libunwind was installed via the system package manager, sometimes. I probably messed
537
- # up the find_library above.
538
- set (LIBUNWIND_LDFLAGS "-lunwind" )
539
- endif ()
540
- if (NOT LIBUNWIND_LDFLAGS)
541
- set (LIBUNWIND_LDFLAGS "${LIBUNWIND} " )
526
+ if (NOT APPLE )
527
+ # set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS ON)
528
+ # set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB32_PATHS ON)
529
+ find_path (LIBUNWIND_INCLUDE_DIRS NAMES "libunwind.h" )
530
+ find_library (LIBUNWIND NAMES unwind libunwind libunwind8 libunwind.so.8 REQUIRED PATHS "/usr/lib/x86_64-linux-gnu/" )
531
+ if (LIBUNWIND)
532
+ set (libunwind_FOUND TRUE )
533
+ endif ()
534
+ if (NOT libunwind_FOUND)
535
+ # message(FATAL_ERROR "Unable to locate libunwind")
536
+ # Try to link with it if it's where it should be
537
+ # This path can be entered if libunwind was installed via the system package manager, sometimes. I probably messed
538
+ # up the find_library above.
539
+ set (LIBUNWIND_LDFLAGS "-lunwind" )
540
+ endif ()
541
+ if (NOT LIBUNWIND_LDFLAGS)
542
+ set (LIBUNWIND_LDFLAGS "${LIBUNWIND} " )
543
+ endif ()
544
+ target_compile_options (${target_name} PRIVATE ${LIBUNWIND_CFLAGS_OTHER} )
545
+ target_include_directories (${target_name} PRIVATE ${LIBUNWIND_INCLUDE_DIRS} )
546
+ target_link_libraries (${target_name} PRIVATE ${LIBUNWIND_LDFLAGS} )
542
547
endif ()
543
- target_compile_options (${target_name} PRIVATE ${LIBUNWIND_CFLAGS_OTHER} )
544
- target_include_directories (${target_name} PRIVATE ${LIBUNWIND_INCLUDE_DIRS} )
545
- target_link_libraries (${target_name} PRIVATE ${LIBUNWIND_LDFLAGS} )
546
548
target_compile_definitions (${target_name} PUBLIC CPPTRACE_UNWIND_WITH_LIBUNWIND UNW_LOCAL_ONLY)
547
549
endif ()
548
550
endif ()
0 commit comments