Skip to content

Commit

Permalink
Fix backward logic to work correctly on Windows (#16)
Browse files Browse the repository at this point in the history
automerged PR by conda-forge/automerge-action
  • Loading branch information
github-actions[bot] authored Oct 20, 2022
2 parents a4eee67 + 469bcef commit e91b493
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 22 deletions.
4 changes: 2 additions & 2 deletions .ci_support/osx_64_ruby2.5.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ MACOSX_DEPLOYMENT_TARGET:
c_compiler:
- clang
c_compiler_version:
- '13'
- '14'
channel_sources:
- conda-forge
channel_targets:
- conda-forge main
cxx_compiler:
- clangxx
cxx_compiler_version:
- '13'
- '14'
macos_machine:
- x86_64-apple-darwin13.4.0
ruby:
Expand Down
4 changes: 2 additions & 2 deletions .ci_support/osx_64_ruby2.6.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ MACOSX_DEPLOYMENT_TARGET:
c_compiler:
- clang
c_compiler_version:
- '13'
- '14'
channel_sources:
- conda-forge
channel_targets:
- conda-forge main
cxx_compiler:
- clangxx
cxx_compiler_version:
- '13'
- '14'
macos_machine:
- x86_64-apple-darwin13.4.0
ruby:
Expand Down
4 changes: 2 additions & 2 deletions .ci_support/osx_arm64_ruby2.5.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ MACOSX_DEPLOYMENT_TARGET:
c_compiler:
- clang
c_compiler_version:
- '13'
- '14'
channel_sources:
- conda-forge
channel_targets:
- conda-forge main
cxx_compiler:
- clangxx
cxx_compiler_version:
- '13'
- '14'
macos_machine:
- arm64-apple-darwin20.0.0
ruby:
Expand Down
4 changes: 2 additions & 2 deletions .ci_support/osx_arm64_ruby2.6.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ MACOSX_DEPLOYMENT_TARGET:
c_compiler:
- clang
c_compiler_version:
- '13'
- '14'
channel_sources:
- conda-forge
channel_targets:
- conda-forge main
cxx_compiler:
- clangxx
cxx_compiler_version:
- '13'
- '14'
macos_machine:
- arm64-apple-darwin20.0.0
ruby:
Expand Down
4 changes: 2 additions & 2 deletions .ci_support/win_64_.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
c_compiler:
- vs2017
- vs2019
channel_sources:
- conda-forge
channel_targets:
- conda-forge main
cxx_compiler:
- vs2017
- vs2019
target_platform:
- win-64
19 changes: 8 additions & 11 deletions recipe/fix-backward-install.patch
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 9f64f01..c272803 100644
index 8bd7561..9bbdc73 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -38,12 +38,7 @@ install (TARGETS backward DESTINATION ${LIB_INSTALL_DIR})
@@ -41,7 +41,9 @@ install (TARGETS backward

#===============================================================================
# Used for the installed version.
-if(APPLE)
- # On macOS, the full path to the library since DYLD_LIBRARY_PATH may not work.
- set(backward_library_name ${CMAKE_INSTALL_FULL_LIBDIR}/$<TARGET_FILE_NAME:backward>)
-else()
- set(backward_library_name $<TARGET_FILE_NAME:backward>)
-endif()
+set(backward_library_name ${CMAKE_INSTALL_FULL_LIBDIR}/$<TARGET_FILE_NAME:backward>)

# Two steps to create `ign`, First using `configure_file`, to interpolate cmake variables. Then
# use `file(GENERATE ...)` to use generator expressions
+if(NOT WIN32)
+ # If we are not on Windows specify the full path as the different ways that dlopen
+ # has to find libraries without full path may not work (while on Windows PATH should work)
# On macOS, the full path to the library since DYLD_LIBRARY_PATH may not work.
set(backward_library_name ${CMAKE_INSTALL_FULL_LIBDIR}/$<TARGET_FILE_NAME:backward>)
else()
2 changes: 1 addition & 1 deletion recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ source:
- fix-backward-install.patch

build:
number: 0
number: 1
skip: false
run_exports:
- {{ pin_subpackage(name, max_pin='x') }}
Expand Down

0 comments on commit e91b493

Please sign in to comment.