[OpenWrt-Devel] cmake.mk: ignores package CFLAGS
Rafał Miłecki
zajec5 at gmail.com
Fri Jan 9 04:51:38 EST 2015
If you look at include/cmake.mk you will notice followiing:
-DCMAKE_BUILD_TYPE=Release
It means that CMake uses CMAKE_C_FLAGS_RELEASE
I've created package and tested it using two variants:
1) TARGET_CFLAGS=-DFOO
This is what I got:
grep FOO build_dir/target-*/test/CMakeCache.txt
CMAKE_CXX_FLAGS:STRING='-DFOO '
CMAKE_C_FLAGS:STRING='-DFOO '
My app was compiled *without* FOO
2) CMAKE_OPTIONS=-DCMAKE_C_FLAGS_RELEASE="-DFOO"
This is what I got:
grep FOO build_dir/target-*/test/CMakeCache.txt
CMAKE_C_FLAGS_RELEASE:STRING=-DFOO
My app was compiled *with* FOO
I think there is a bug in cmake.mk. Since we use
-DCMAKE_BUILD_TYPE=Release
we can't really relay on
CFLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS)"
because it will result in
CMAKE_C_FLAGS
instead of
CMAKE_C_FLAGS_RELEASE
--
Rafał
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
More information about the openwrt-devel
mailing list