Skip to content

Commit

Permalink
Replace dpkg-architecture by gcc -print-multiarch.
Browse files Browse the repository at this point in the history
Silent the error on cmake if the flag is not present. Checking the
content of the OUTPUT_VARIABLE for empty should be enough to detect
errors on multiarch detection.
  • Loading branch information
j-rivero committed Apr 29, 2014
1 parent c1c02af commit dcbc8f3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion cmake/catkin_generate_environment.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@ function(catkin_generate_environment)
set(CATKIN_MULTIARCH_LIB_DESTINATION "'${CATKIN_GLOBAL_LIB_DESTINATION}'")
set(CATKIN_MULTIARCH_PKGCONFIG_DESTINATION "os.path.join('${CATKIN_GLOBAL_LIB_DESTINATION}', 'pkgconfig')")
if (UNIX)
execute_process(COMMAND dpkg-architecture -qDEB_HOST_MULTIARCH
execute_process(COMMAND gcc -print-multiarch
OUTPUT_VARIABLE CATKIN_MULTIARCH
OUTPUT_STRIP_TRAILING_WHITESPACE
ERROR_QUIET
)
if (NOT "${CATKIN_MULTIARCH}" STREQUAL "")
set(CATKIN_MULTIARCH_LIB_DESTINATION "['${CATKIN_GLOBAL_LIB_DESTINATION}', os.path.join('${CATKIN_GLOBAL_LIB_DESTINATION}', '${CATKIN_MULTIARCH}')]")
Expand Down
4 changes: 2 additions & 2 deletions python/catkin/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,10 +248,10 @@ def isolation_print_command(cmd, path=None, add_env=None):
)


def get_multiarch(build_dir):
def get_multiarch():
# this function returns the suffix for lib directories on supported systems or an empty string
out, err = subprocess.Popen(
'dpkg-architecture -qDEB_HOST_MULTIARCH',
'gcc -print-multiarch',
stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True).communicate()
return out.strip()

Expand Down

0 comments on commit dcbc8f3

Please sign in to comment.