Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

android cmake: ignore symlinks to match toolchain machine name #100

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions android.toolchain.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,16 @@ macro( __LIST_FILTER listvar regex )
endif()
endmacro()

macro( __FILE_LIST_FILTER_SYMLINKS basedir listvar )
if( ${listvar} )
foreach( __val ${${listvar}} )
if( IS_SYMLINK "${basedir}/${__val}" )
list( REMOVE_ITEM ${listvar} "${__val}" )
endif()
endforeach()
endif()
endmacro()

macro( __INIT_VARIABLE var_name )
set( __test_path 0 )
foreach( __var ${ARGN} )
Expand Down Expand Up @@ -318,6 +328,7 @@ macro( __DETECT_TOOLCHAIN_MACHINE_NAME _var _root )
if( EXISTS "${_root}" )
file( GLOB __gccExePath RELATIVE "${_root}/bin/" "${_root}/bin/*-gcc${TOOL_OS_SUFFIX}" )
__LIST_FILTER( __gccExePath "^[.].*" )
__FILE_LIST_FILTER_SYMLINKS( "${_root}/bin/" __gccExePath )
list( LENGTH __gccExePath __gccExePathsCount )
if( NOT __gccExePathsCount EQUAL 1 AND NOT _CMAKE_IN_TRY_COMPILE )
message( WARNING "Could not determine machine name for compiler from ${_root}" )
Expand Down