Skip to content

Commit

Permalink
Set $ORIGIN in RUNPATH in linux binaries (microsoft#3743)
Browse files Browse the repository at this point in the history
RUNPATH is by default set to the folder where the binary is located at build time. This makes locally reproducing issues cumbersome for Linux. Also, if the build and test runner machine have different folder structure, our tests won't run due to this issue.
  • Loading branch information
csujedihy authored Jul 7, 2023
1 parent a851929 commit bf54efb
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/core/unittest/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ add_executable(msquiccoretest ${SOURCES})
target_include_directories(msquiccoretest PRIVATE ${PROJECT_SOURCE_DIR}/src/core)

set_property(TARGET msquiccoretest PROPERTY FOLDER "${QUIC_FOLDER_PREFIX}tests")
set_property(TARGET msquiccoretest APPEND PROPERTY BUILD_RPATH "$ORIGIN")

target_link_libraries(msquiccoretest msquic)

Expand Down
1 change: 1 addition & 0 deletions src/platform/unittest/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ add_executable(msquicplatformtest ${SOURCES})
target_include_directories(msquicplatformtest PRIVATE ${PROJECT_SOURCE_DIR}/src/core)

set_property(TARGET msquicplatformtest PROPERTY FOLDER "${QUIC_FOLDER_PREFIX}tests")
set_property(TARGET msquicplatformtest APPEND PROPERTY BUILD_RPATH "$ORIGIN")

target_link_libraries(msquicplatformtest msquic)

Expand Down
1 change: 1 addition & 0 deletions src/test/bin/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ add_executable(msquictest ${SOURCES})
target_include_directories(msquictest PRIVATE ${PROJECT_SOURCE_DIR}/src/test)

set_property(TARGET msquictest PROPERTY FOLDER "${QUIC_FOLDER_PREFIX}tests")
set_property(TARGET msquictest APPEND PROPERTY BUILD_RPATH "$ORIGIN")

target_link_libraries(msquictest msquic testlib)

Expand Down
1 change: 1 addition & 0 deletions src/tools/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ function(add_quic_tool)
target_link_libraries(${targetname} logging base_link)

set_property(TARGET ${targetname} PROPERTY FOLDER "${QUIC_FOLDER_PREFIX}tools")
set_property(TARGET ${targetname} APPEND PROPERTY BUILD_RPATH "$ORIGIN")
endfunction()

function(quic_tool_warnings)
Expand Down

0 comments on commit bf54efb

Please sign in to comment.