[cmake-developers] [PATCH] add support for ARTOS platform
Brad King
brad.king at kitware.com
Thu Aug 13 11:16:05 EDT 2015
On 08/13/2015 08:24 AM, Kars de Jong wrote:
> GNU-DetermineCompiler.cmake: support very old versions of GCC
Applied, thanks:
GNU-DetermineCompiler: Add support for very old versions of GCC
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6699834d
> Add support for ARTOS platform
Thanks for working on this. Here are some comments.
For reference, EUROS was recently added here:
Add EUROS RTOS platform description file
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=606b29d4
and was also originally based on eCos.
> +# find ARTOS stdio library
> +find_library(ARTOS_SYSTEM_STDIO_LIBRARY stdio)
> +
> +if(NOT ARTOS_SYSTEM_STDIO_LIBRARY)
> + message(FATAL_ERROR "Could not find ARTOS \"stdio.a\". Build ARTOS first and set up CMAKE_FIND_ROOT_PATH correctly.")
> +endif()
Is the "stdio" library is a system library that is expected to
be provided by the toolchain? In this case one should not have
to use find_library and can instead just pass "stdio" as a
link item, thus trusting the linker to find it.
> +add_definitions(-DARTOS -Xp -+)
> +set(CMAKE_REQUIRED_LIBRARIES ${ARTOS_SYSTEM_STDIO_LIBRARY})
A platform information file should be completely declarative.
eCos should not be using add_definitions but has been kept
for historical reasons. A New ARTOS module should not follow
this pattern.
Instead there should be files like
Modules/Platform/ARTOS-GNU-C.cmake
Modules/Platform/ARTOS-GNU-CXX.cmake
that take care of updating the compiler rules for this platform.
See Modules/Platform/Windows-MSVC-{C,CXX}.cmake for an example.
They share code in Modules/Platform/Windows-MSVC.cmake which
sets up the compiler rules with the platform-specific flags.
Thanks,
-Brad
More information about the cmake-developers
mailing list