[CMake] Platform information override file is ignored for ASM language

Alexander Neundorf a.neundorf-work at gmx.net
Mon Aug 25 16:27:20 EDT 2014


On Monday, August 25, 2014 14:36:21 Никонов Михаил Николаевич wrote:
> Hello,
> 
> In a bare-metal embedded project, I need to initialize compiler flags
> to custom values while toolchains are initialized; for that, I'm using
> override files to set _INIT variables. From what I've encountered, it
> appears that CMAKE_USER_MAKE_RULES_OVERRIDE file (and
> language-specific *_ASM one) are not loaded during initialization of
> assembly compiler. Here's a test to reproduce it, made of two files:
> 
> CMakeLists.txt:
>   set(CMAKE_USER_MAKE_RULES_OVERRIDE override.cmake)
>   project(Test C CXX ASM)
> 
> override.cmake:
>   set(CMAKE_C_FLAGS_INIT "-Wall")
>   set(CMAKE_CXX_FLAGS_INIT "-Wall")
>   set(CMAKE_ASM_FLAGS_INIT "-Wall")
> 
> After running cmake, CMAKE_C_FLAGS and CMAKE_CXX_FLAGS in
> CMakeCache.txt contain flag -Wall, while CMAKE_ASM_FLAGS doesn't
> (tested with CMake 2.8.12.2 and 3.0.1 and gcc 4.8.2 on latest Ubuntu).
> 
> Is there any mistake I made? And if not, is there any elegant
> workaround for that? I'm aware that I can just force flags' values
> into cache in toolchain file itself, before project() call, but from
> what I understood, it's a discouraged practice.

please enter a bug report at http://public.kitware.com/Bug

Thanks
Alex



More information about the CMake mailing list