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.

Regards,
Mikhail.
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake
  • [CMake] Platform informat... Никонов Михаил Николаевич

Reply via email to