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

Add quotes to ${CPUINFO} to defend against spaces. #1244

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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 5 additions & 5 deletions lib/TH/cmake/FindARM.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ IF(CMAKE_SYSTEM_NAME MATCHES "Linux")
EXEC_PROGRAM(cat ARGS "/proc/cpuinfo" OUTPUT_VARIABLE CPUINFO)

#neon instruction can be found on the majority part of modern ARM processor
STRING(REGEX REPLACE "^.*(neon).*$" "\\1" NEON_THERE ${CPUINFO})
STRING(REGEX REPLACE "^.*(neon).*$" "\\1" NEON_THERE "${CPUINFO}")
STRING(COMPARE EQUAL "neon" "${NEON_THERE}" NEON_TRUE)
IF (NEON_TRUE)
set(NEON_FOUND true CACHE BOOL "NEON available on host")
Expand All @@ -14,7 +14,7 @@ IF(CMAKE_SYSTEM_NAME MATCHES "Linux")
ENDIF (NEON_TRUE)

# on ARMv8, neon is inherit and instead listed as 'asimd' in /proc/cpuinfo
STRING(REGEX REPLACE "^.*(asimd).*$" "\\1" ASIMD_THERE ${CPUINFO})
STRING(REGEX REPLACE "^.*(asimd).*$" "\\1" ASIMD_THERE "${CPUINFO}")
STRING(COMPARE EQUAL "asimd" "${ASIMD_THERE}" ASIMD_TRUE)
IF (ASIMD_TRUE)
set(ASIMD_FOUND true CACHE BOOL "ASIMD/NEON available on host")
Expand All @@ -23,7 +23,7 @@ IF(CMAKE_SYSTEM_NAME MATCHES "Linux")
ENDIF (ASIMD_TRUE)

#Find the processor type (for now OMAP3 or OMAP4)
STRING(REGEX REPLACE "^.*(OMAP3).*$" "\\1" OMAP3_THERE ${CPUINFO})
STRING(REGEX REPLACE "^.*(OMAP3).*$" "\\1" OMAP3_THERE "${CPUINFO}")
STRING(COMPARE EQUAL "OMAP3" "${OMAP3_THERE}" OMAP3_TRUE)
IF (OMAP3_TRUE)
set(CORTEXA8_FOUND true CACHE BOOL "OMAP3 available on host")
Expand All @@ -32,7 +32,7 @@ IF(CMAKE_SYSTEM_NAME MATCHES "Linux")
ENDIF (OMAP3_TRUE)

#Find the processor type (for now OMAP3 or OMAP4)
STRING(REGEX REPLACE "^.*(OMAP4).*$" "\\1" OMAP4_THERE ${CPUINFO})
STRING(REGEX REPLACE "^.*(OMAP4).*$" "\\1" OMAP4_THERE "${CPUINFO}")
STRING(COMPARE EQUAL "OMAP4" "${OMAP4_THERE}" OMAP4_TRUE)
IF (OMAP4_TRUE)
set(CORTEXA9_FOUND true CACHE BOOL "OMAP4 available on host")
Expand All @@ -45,7 +45,7 @@ ELSEIF(CMAKE_SYSTEM_NAME MATCHES "Darwin")
CPUINFO)

#neon instruction can be found on the majority part of modern ARM processor
STRING(REGEX REPLACE "^.*(neon).*$" "\\1" NEON_THERE ${CPUINFO})
STRING(REGEX REPLACE "^.*(neon).*$" "\\1" NEON_THERE "${CPUINFO}")
STRING(COMPARE EQUAL "neon" "${NEON_THERE}" NEON_TRUE)
IF (NEON_TRUE)
set(NEON_FOUND true CACHE BOOL "NEON available on host")
Expand Down