cmake: fix typo in toolchain file
PATCH 1/1 cmake: fix typo in toolchain file
From: Øystein Walle <[email protected]>
--- meta/recipes-devtools/cmake/cmake/OEToolchainConfig.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-devtools/cmake/cmake/OEToolchainConfig.cmake +1 -1
@@ -1,7 +1,7 @@ set( CMAKE_SYSTEM_NAME Linux ) set( CMAKE_C_FLAGS $ENV{CFLAGS} CACHE STRING "" FORCE ) set( CMAKE_CXX_FLAGS $ENV{CXXFLAGS} CACHE STRING "" FORCE ) -set( CMAKE ASM_FLAGS ${CMAKE_C_FLAGS} CACHE STRING "" FORCE ) +set( CMAKE_ASM_FLAGS ${CMAKE_C_FLAGS} CACHE STRING "" FORCE ) set( CMAKE_LDFLAGS_FLAGS ${CMAKE_CXX_FLAGS} CACHE STRING "" FORCE ) set( CMAKE_FIND_ROOT_PATH $ENV{OECORE_TARGET_SYSROOT} $ENV{OECORE_NATIVE_SYSROOT} )
Signature · 1 line
2.14.2
meta/recipes-devtools/cmake/cmake/OEToolchainConfig.cmake line 4
Quoted 2 lines · Øystein Walle
meta/recipes-devtools/cmake/cmake/OEToolchainConfig.cmake +1
-1-set( CMAKE ASM_FLAGS ${CMAKE_C_FLAGS} CACHE STRING "" FORCE ) +set( CMAKE_ASM_FLAGS ${CMAKE_C_FLAGS} CACHE STRING "" FORCE )
Where is the typo and what is it, exactly?
Alex
Quoted 7 lines · Alexander Kanavin
meta/recipes-devtools/cmake/cmake/OEToolchainConfig.cmake line 4
Quoted 2 lines · Øystein Walle
meta/recipes-devtools/cmake/cmake/OEToolchainConfig.cmake +1
-1-set( CMAKE ASM_FLAGS ${CMAKE_C_FLAGS} CACHE STRING "" FORCE ) +set( CMAKE_ASM_FLAGS ${CMAKE_C_FLAGS} CACHE STRING "" FORCE )Where is the typo and what is it, exactly?
-set( CMAKE ASM_FLAGS ${CMAKE_C_FLAGS} CACHE STRING "" FORCE )
missing _ between CMAKE and ASM
Signature · 2 lines
Maciej Borzecki RnDity
Quoted 7 lines · Maciej Borzęcki
On Tue, Oct 10, 2017 at 2:25 PM, Alexander Kanavin
Quoted 1 line
Where is the typo and what is it, exactly?
-set( CMAKE
ASM_FLAGS${CMAKE_C_FLAGS} CACHE STRING "" FORCE )missing _ between CMAKE and ASM
Correct. As it is the code defines a variable named "CMAKE" with the contents "ASM_FLAGS ${CMAKE_C_FLAGS}". As far as CMake is concerned that is valid and so this will not generate any form of error, but may result in incorrect flags.
I can resend the patch with a better commit message if you like.
--
Øsse
Quoted 1 line · Øystein Walle
I can resend the patch with a better commit message if you like.
Yes please.
Alex
PATCH v2 1/1 cmake: fix typo in toolchain file
From: Øystein Walle <[email protected]>
The missing underscore makes CMake define a new variable named "CMAKE" with the contents "ASM_FLAGS ${CMAKE_C_FLAGS}" instead of a variable named "CMAKE_ASM_FLAGS" with contents equal to "CMAKE_C_FLAGS". It seems clear that the intention was to assign "CMAKE_ASM_FLAGS".
CMake uses variables named "CMAKE_<LANG>_FLAGS" for defining default compiler flags for a given language <LANG>. Leaving this flag unset may have unintended consequences. Not doing so is however not an error as far as CMake is concerned so it is silently accepted.
--- meta/recipes-devtools/cmake/cmake/OEToolchainConfig.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-devtools/cmake/cmake/OEToolchainConfig.cmake +1 -1
@@ -1,7 +1,7 @@ set( CMAKE_SYSTEM_NAME Linux ) set( CMAKE_C_FLAGS $ENV{CFLAGS} CACHE STRING "" FORCE ) set( CMAKE_CXX_FLAGS $ENV{CXXFLAGS} CACHE STRING "" FORCE ) -set( CMAKE ASM_FLAGS ${CMAKE_C_FLAGS} CACHE STRING "" FORCE ) +set( CMAKE_ASM_FLAGS ${CMAKE_C_FLAGS} CACHE STRING "" FORCE ) set( CMAKE_LDFLAGS_FLAGS ${CMAKE_CXX_FLAGS} CACHE STRING "" FORCE ) set( CMAKE_FIND_ROOT_PATH $ENV{OECORE_TARGET_SYSROOT} $ENV{OECORE_NATIVE_SYSROOT} )
Signature · 1 line
2.14.2
Quoted 7 lines · Øystein Walle
Quoted 6 lines · Maciej Borzęcki
On Tue, Oct 10, 2017 at 2:25 PM, Alexander Kanavin
Quoted 1 line
Where is the typo and what is it, exactly?
-set( CMAKE
ASM_FLAGS${CMAKE_C_FLAGS} CACHE STRING "" FORCE )
Quoted 8 lines
Quoted 1 line
missing _ between CMAKE and ASM
Correct. As it is the code defines a variable named "CMAKE" with the contents "
ASM_FLAGS${CMAKE_C_FLAGS}". As far as CMake is concerned that is valid and so this will not generate any form of error, but may result in incorrect flags.I can resend the patch with a better commit message if you like.
That would be nice. I stared at the line for a bit trying to see the typo also.
Philip
Quoted 4 lines
--
Øsse