Need help building with CMake
Posted: Tue Aug 16, 2022 3:10 am
Hey all! I'm new to developing using devkitPro. I'm trying to use CMake when building the triangle example found on GitHub. When using the Makefile which comes with the example, everything compiles normally. When trying to use CMake in the same environment with this script:
I get the following error:
My folder structure is the following:
I'm sure that I'm making a simple mistake here, but I haven't been able to figure it out after hours of troubleshooting. I've been searching the internet as well as the devkitPro files on my hard drive for clues. Any help on this issue I'm having would be greatly appreciated. Thank you!
Code: Select all
cmake_minimum_required(VERSION 3.20)
include("$ENV{DEVKITPRO}/cmake/Wii.cmake")
project (WiiTest VERSION 1.0)
add_executable(WiiTest triangle.c)
Code: Select all
$ cmake -S . -B build
-- The C compiler identification is GNU 12.1.0
-- The CXX compiler identification is GNU 12.1.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - failed
-- Check for working C compiler: /opt/devkitpro/devkitPPC/bin/powerpc-eabi-gcc.exe
-- Check for working C compiler: /opt/devkitpro/devkitPPC/bin/powerpc-eabi-gcc.exe - broken
CMake Error at /usr/share/cmake-3.23.2/Modules/CMakeTestCCompiler.cmake:69 (message):
The C compiler
"/opt/devkitpro/devkitPPC/bin/powerpc-eabi-gcc.exe"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: /home/Trent/Desktop/wii-cmake/build/CMakeFiles/CMakeTmp
Run Build Command(s):/usr/bin/make.exe -f Makefile cmTC_c5e69/fast && /usr/bin/make -f CMakeFiles/cmTC_c5e69.dir/build.make CMakeFiles/cmTC_c5e69.dir/build
make[1]: Entering directory '/home/Trent/Desktop/wii-cmake/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_c5e69.dir/testCCompiler.o
/opt/devkitpro/devkitPPC/bin/powerpc-eabi-gcc.exe -o CMakeFiles/cmTC_c5e69.dir/testCCompiler.o -c /home/Trent/Desktop/wii-cmake/build/CMakeFiles/CMakeTmp/testCCompiler.c
Linking C executable cmTC_c5e69.exe
/usr/bin/cmake.exe -E cmake_link_script CMakeFiles/cmTC_c5e69.dir/link.txt --verbose=1
/opt/devkitpro/devkitPPC/bin/powerpc-eabi-gcc.exe CMakeFiles/cmTC_c5e69.dir/testCCompiler.o -o cmTC_c5e69.exe -Wl,--out-implib,libcmTC_c5e69.dll.a -Wl,--major-image-version,0,--minor-image-version,0
c:/devkitpro/devkitppc/bin/../lib/gcc/powerpc-eabi/12.1.0/../../../../powerpc-eabi/bin/ld.exe: unrecognized option '--major-image-version'
c:/devkitpro/devkitppc/bin/../lib/gcc/powerpc-eabi/12.1.0/../../../../powerpc-eabi/bin/ld.exe: use the --help option for usage information
collect2.exe: error: ld returned 1 exit status
make[1]: *** [CMakeFiles/cmTC_c5e69.dir/build.make:99: cmTC_c5e69.exe] Error 1
make[1]: Leaving directory '/home/Trent/Desktop/wii-cmake/build/CMakeFiles/CMakeTmp'
make: *** [Makefile:127: cmTC_c5e69/fast] Error 2
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:5 (project)
-- Configuring incomplete, errors occurred!
See also "/home/Trent/Desktop/wii-cmake/build/CMakeFiles/CMakeOutput.log".
See also "/home/Trent/Desktop/wii-cmake/build/CMakeFiles/CMakeError.log".
Code: Select all
wii-cmake
| -> build
| -> CMakeLists.txt
| -> triangle.c