Skip to content

Commit

Permalink
Merge pull request #20 from kayru/mingw_fix
Browse files Browse the repository at this point in the history
Fixed MinGW build issues and added .elf extension to build targets
  • Loading branch information
shuffle2 committed Nov 1, 2014
2 parents cfc3b4d + 0cf30c9 commit a851c62
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ set(MACHDEP "-DGEKKO -mrvl -mcpu=750 -meabi -mhard-float")

set(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} ${MACHDEP}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${MACHDEP}")
set(CMAKE_EXECUTABLE_SUFFIX ".elf")

add_custom_target(run)

Expand Down
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

mkdir -p build
cd build
cmake -DCMAKE_TOOLCHAIN_FILE=../toolchain-powerpc.cmake ..
cmake -DCMAKE_TOOLCHAIN_FILE=../toolchain-powerpc.cmake -G "Unix Makefiles" ..
make
10 changes: 8 additions & 2 deletions toolchain-powerpc.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,14 @@ if(NOT LIBOGCDIR)
set(LIBOGCDIR ${DEVKITPRO}/libogc)
endif()

set(CMAKE_C_COMPILER ${DEVKITPPC}/bin/powerpc-eabi-gcc)
set(CMAKE_CXX_COMPILER ${DEVKITPPC}/bin/powerpc-eabi-g++)
if(WIN32)
set(CMAKE_C_COMPILER ${DEVKITPPC}/bin/powerpc-eabi-gcc.exe)
set(CMAKE_CXX_COMPILER ${DEVKITPPC}/bin/powerpc-eabi-g++.exe)
else()
set(CMAKE_C_COMPILER ${DEVKITPPC}/bin/powerpc-eabi-gcc)
set(CMAKE_CXX_COMPILER ${DEVKITPPC}/bin/powerpc-eabi-g++)
endif()

set(CMAKE_FIND_ROOT_PATH ${DEVKITPPC})
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
Expand Down

0 comments on commit a851c62

Please sign in to comment.