Skip to content

Commit

Permalink
Added FindGBA cmake module
Browse files Browse the repository at this point in the history
  • Loading branch information
javsalgar committed Jul 8, 2015
1 parent cfbb5aa commit 701bea0
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 43 deletions.
25 changes: 25 additions & 0 deletions cmake/FindGBA.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
set(CMAKE_SYSTEM_NAME Generic)
set(cmake_system_processor arm)
set(cmake_crosscompiling 1)
set(DEVKITARM $ENV{DEVKITARM})
set(DEVKITPRO $ENV{DEVKITPRO})

set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "")
set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "")
set(CMAKE_C_COMPILER ${DEVKITARM}/bin/arm-none-eabi-gcc)
set(CMAKE_C_FLAGS "-mthumb-interwork -mthumb -O2 -Wall -fno-strict-aliasing -specs=gba.specs")
set(CMAKE_CXX_COMPILER ${DEVKITARM}/bin/arm-none-eabi-gcc)
set(CMAKE_CXX_FLAGS "-mthumb-interwork -mthumb -O2 -Wall -fno-strict-aliasing -specs=gba.specs")

function(add_gba_rom ROMNAME)
set(ROM_SRC ${ARGV})
list(REMOVE_AT ROM_SRC 0)
add_executable(${ROMNAME}.elf ${ROM_SRC})
add_custom_target(${ROMNAME}.gba ALL
COMMAND ${DEVKITARM}/bin/arm-none-eabi-objcopy -v -O binary ${ROMNAME}.elf ${ROMNAME}.gba
COMMAND ${DEVKITARM}/bin/gbafix ${ROMNAME}.gba
DEPENDS ${ROMNAME}.elf
COMMENT "Creating GBA ROM ${ROMNAME}.gba")
add_dependencies(${ROMNAME}.gba ${ROMNAME}.elf)
set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES ${ROMNAME}.gba)
endfunction(add_gba_rom)
File renamed without changes.
File renamed without changes.
File renamed without changes
20 changes: 20 additions & 0 deletions qtcreator/wizard.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/*******************************************
** QTCreator Homebrew Project
** Author: Javier J. Salmeron-Garcia
** mail: [email protected]
**
****************************************************************************/
-->
<wizard version="1" kind="project" firstpage="10" id="Game Boy Advance (CMake)" category="Homebrew.Projects"
platformIndependent="true" featuresRequired="Plugin.CMakeProjectManager">
<icon>mgba.png</icon>
<description>Game Boy Advance ROM using CMake. Devkitarm required.</description>
<displayname>Game Boy Advance (CMake)</displayname>;
<displaycategory>Homebrew Development</displaycategory>
<files>
<file source="main.c" target="main.c" openeditor="true"/>
<file source="CMakeLists.txt" openproject="true"/>
</files>
</wizard>
43 changes: 0 additions & 43 deletions wizard.xml

This file was deleted.

0 comments on commit 701bea0

Please sign in to comment.