Set flags for compiler check

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Set flags for compiler check

Richard Shaw
I'm working on a cross-compiling project for the STM32F4 arm processor and on my Fedora 28 system everything is working fine (cmake 3.11.2) but others trying to configure are running into problems with the compiler check failing.

Since I'm cross-compiling as far as I know I need "--specs=nosys.specs" flag added for the compiler check to work which it is for me (relevant output from CMakeOutput.log):

Building C object CMakeFiles/cmTC_2ac2b.dir/testCCompiler.c.o
/usr/lib64/ccache/arm-none-eabi-gcc   -Wall -std=gnu11 -mlittle-endian -mthumb -mthumb-interwork -nostartfiles -mcpu=cortex-m4 -fsingle-precision-constant -Wdouble-promotion -mfpu=fpv4-sp-d16 -mfloat-abi=hard -D__FPU_PRESENT=1 -D__FPU_USED=1 --specs=nosys.specs    -o CMakeFiles/cmTC_2ac2b.dir/testCCompiler.c.o   -c /home/build/build/stm32/CMakeFiles/CMakeTmp/testCCompiler.c

But others have no flags being applied (cmake 3.9.1 on Ubuntu):

Building C object CMakeFiles/cmTC_01cf5.dir/testCCompiler.c.obj
/usr/bin/arm-none-eabi-gcc    -o CMakeFiles/cmTC_01cf5.dir/testCCompiler.c.obj   -c /home/david/codec2-dev/build_stm32b/CMakeFiles/CMakeTmp/testCCompiler.c

What is the right way to make sure flags are passed to the compiler check?

I assume I could use CMakeForceCompiler but that seems like a last resort...

Thanks,
Richard

--

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:
https://cmake.org/mailman/listinfo/cmake