Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
kendryte747 committed Oct 11, 2024
1 parent fb974e5 commit 3ce1b9b
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build_cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ concurrency:

jobs:
build-cli-windows:
name: build-cli-windosw
name: build-cli-windows
runs-on: ubuntu-latest
concurrency:
group: ${{ github.repository }}-${{ github.workflow }}-Windows
Expand Down Expand Up @@ -78,7 +78,7 @@ jobs:
- name: Install Depencies
run: |
sudo apt update && sudo apt install libudev-dev
sudo apt update && sudo apt install -y libudev-dev
- name: Build for Linux
run: |
Expand Down
27 changes: 26 additions & 1 deletion src/kburn/cli/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,31 @@ set_target_properties(${PROJECT_NAME} PROPERTIES
add_subdirectory(CLI11)
target_link_libraries(${PROJECT_NAME} PRIVATE CLI11::CLI11)

if(APPLE)
# macOS-specific rpath settings
target_link_options(${PROJECT_NAME} PRIVATE
"-Wl,-rpath,@loader_path"
"-Wl,-rpath,@loader_path/../lib"
"-Wl,-rpath,@executable_path"
)
elseif(UNIX AND NOT APPLE)
# Linux-specific rpath settings
target_link_options(${PROJECT_NAME} PRIVATE
"-Wl,-rpath,$ORIGIN"
"-Wl,-rpath,$ORIGIN/../lib"
)
elseif(WIN32)

endif()

# Set RPATH for installed binaries (common for macOS and Linux)
if(NOT WIN32)
set_target_properties(${PROJECT_NAME} PROPERTIES
INSTALL_RPATH "$ORIGIN"
BUILD_WITH_INSTALL_RPATH TRUE
)
endif()

install(TARGETS ${PROJECT_NAME})

get_target_property(OUTPUT_EXE_NAME ${PROJECT_NAME} OUTPUT_NAME)
Expand All @@ -25,7 +50,7 @@ if(WIN32 AND BUILD_WITH_MINGW)
install(CODE "
execute_process(
COMMAND ${CMAKE_COMMAND} -E echo \"Running copy_dlls.sh\"
COMMAND bash \"\${CMAKE_CURRENT_SOURCE_DIR}/cli/cmake/copy_dlls.sh\"
COMMAND bash \"\${CMAKE_SOURCE_DIR}/cli/cmake/copy_dlls.sh\"
\"${OUTPUT_EXE_NAME}\" \"${TOOLCHAIN_ROOT}\" \"${CMAKE_INSTALL_PREFIX}\" \"${OBJDUMP_COMMAND}\"
RESULT_VARIABLE RESULT
COMMAND_ECHO STDOUT
Expand Down

0 comments on commit 3ce1b9b

Please sign in to comment.