[oe-commits] [openembedded-core] 07/32: cmake: improve CMAKE_SYSTEM_PROCESSOR assignment in nativesdk

git at git.openembedded.org git at git.openembedded.org
Sat Oct 15 09:05:52 UTC 2016


rpurdie pushed a commit to branch master
in repository openembedded-core.

commit ce24958d644f2218d5415be574a5b7e1ee8c9b2d
Author: Ross Burton <ross.burton at intel.com>
AuthorDate: Tue Oct 11 13:30:42 2016 +0100

    cmake: improve CMAKE_SYSTEM_PROCESSOR assignment in nativesdk
    
    The previous string manipulations would result in the wrong string being used
    for machines such as intel-corei7-64 as the sysroot was split at the first
    hyphen (so would result in corei7 instead of corei7-64).
    
    Change the logic so that it looks for processor-distro-os and uses the whole of
    the processor field.
    
    Signed-off-by: Ross Burton <ross.burton at intel.com>
---
 meta/recipes-devtools/cmake/cmake/OEToolchainConfig.cmake | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/meta/recipes-devtools/cmake/cmake/OEToolchainConfig.cmake b/meta/recipes-devtools/cmake/cmake/OEToolchainConfig.cmake
index 0ce6573..6518408 100644
--- a/meta/recipes-devtools/cmake/cmake/OEToolchainConfig.cmake
+++ b/meta/recipes-devtools/cmake/cmake/OEToolchainConfig.cmake
@@ -10,8 +10,10 @@ set( CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY )
 set( CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY )
 set( CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY )
 
-string(REGEX MATCH "sysroots/([a-zA-Z0-9]+)" CMAKE_SYSTEM_PROCESSOR $ENV{SDKTARGETSYSROOT})
-string(REGEX REPLACE "sysroots/" "" CMAKE_SYSTEM_PROCESSOR ${CMAKE_SYSTEM_PROCESSOR})
+# Set CMAKE_SYSTEM_PROCESSOR from the sysroot name (assuming processor-distro-os).
+if ($ENV{SDKTARGETSYSROOT} MATCHES "/sysroots/([a-zA-Z0-9_-]+)-.+-.+")
+  set(CMAKE_SYSTEM_PROCESSOR ${CMAKE_MATCH_1})
+endif()
 
 # Include the toolchain configuration subscripts
 file( GLOB toolchain_config_files "${CMAKE_TOOLCHAIN_FILE}.d/*.cmake" )

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list