So, after those first set() lines we begin to describe which compiler we'll use. I prefer to write the commands in lowercase and everything else in upper case. The keywords inside commands have to be in UPPER CASE. Commands like if, message, endif, set and so on can be written either in ALL CAPS or in lower case. Set(CMAKE_SYSTEM_PROCESSOR arm-eabi)A note on style here. The other 2 variables set here are optional: Instead of the usual BNF variable = value style syntax for assignment, CMake uses a function. Here we come across one of the oddities that takes a bit of getting used to. This is done by setting the variable CMAKE_SYSTEM_NAME to "Generic". We don't want it to try and guess based on any native compiler installed.Īs described in the CMake wiki we first have to turn off the auto detection. When cross compiling for the DS, you have to tell CMake which compiler it should use. Normally CMake autodetects the local platform type and configures the compiler, linker, compilation flags and so on, to the correct values. First we need to create a Toolchain File that CMake uses to understand your target platform. The features needed to compile on the DS were only added quite recently (version 2.6 onwards).Īfter you've installed CMake, you can start hacking away. The first thing you will need is the latest version of CMake. So compiling ARM7 and ARM9 cores and combining the result into the final. It can also generate project files for CodeBlocks, Eclipse CDT and KDevelop.Ī hefty obstacle for using CMake with the DS is that currently CMake doesn't support building multiple target architectures in one build tree. On Windows, CMake generates project files for use with Visual Studio. You write a configuration file, called CMakeLists.txt, run the cmake program to generate a load of Makefiles or project files, then run make (or whatever) to compile your project. This week viewers we'll look at CMake.ĬMake is a build system that generates files for use with the build tool on your platform. I'm going to write a few posts describing how you can use CMake, SCons or Waf to compile your code. There are several alternatives for the brave developer, however. In the Nintendo DS scene the build tool that everyone uses is plain ol' Make.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |