SDCC project generation seems to be broken
calling:
cmake -DCMAKE_TOOLCHAIN_FILE=sdcc-toolchain.cmake -G "MinGW Makefiles"
result:
-- The C compiler identification is unknown
-- Check for working C compiler: x:/tools/sdcc/bin/sdcc.exe
-- Check for working C compiler: x:/tools/sdcc/bin/sdcc.exe -- broken
CMake Error at C:/Program Files/CMake/share/cmake-3.8/Modules/CMakeTestCCompiler.cmake:51 (message):
The C compiler "x:/tools/sdcc/bin/sdcc.exe" is not able to compile a simple test program.
It fails with the following output:
Change Dir: X:/work/scratchpad/test/CMakeFiles/CMakeTmp
Run Build Command:"C:/msys64/mingw64/bin/mingw32-make.exe" "cmTC_1e390/fast"
C:/msys64/mingw64/bin/mingw32-make.exe -f CMakeFiles\cmTC_1e390.dir\build.make CMakeFiles/cmTC_1e390.dir/build
mingw32-make.exe[1]: Entering directory
'X:/work/scratchpad/test/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_1e390.dir/testCCompiler.c.obj
x:\tools\sdcc\bin\sdcc.exe -o CMakeFiles\cmTC_1e390.dir\testCCompiler.c.obj -c
X:\work\scratchpad\test\CMakeFiles\CMakeTmp\testCCompiler.c
Linking C executable cmTC_1e390
"C:\Program Files\CMake\bin\cmake.exe" -E cmake_link_script
CMakeFiles\cmTC_1e390.dir\link.txt --verbose=1
x:\tools\sdcc\bin\sdcc.exe CMakeFiles/cmTC_1e390.dir/testCCompiler.c.obj -o
cmTC_1e390
at 1: error 119: don't know what to do with file
'CMakeFiles/cmTC_1e390.dir/testCCompiler.c.obj'. file extension
unsupported
sdcc is placed at: x:/tools/sdcc/bin/sdcc.exe
sdcc-toolchain.cmake:
set(CMAKE_SYSTEM_NAME Generic)
set(CMAKE_C_COMPILER "x:/tools/sdcc/bin/sdcc.exe")
set(CMAKE_FIND_ROOT_PATH "x:/tools/sdcc")
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
CMakeLists.txt:
project (test LANGUAGES C)
add_executable (myTest main.c)
main.c:
int main()
{
return 0;
}
copying: c:\Program Files\CMake\share\cmake-3.8\Modules\Platform\Generic-SDCC-C.cmake
to: c:\Program Files\CMake\share\cmake-3.8\Modules\Platform\Generic-sdcc.cmake
resolves problem:
cmake -DCMAKE_TOOLCHAIN_FILE=sdcc-toolchain.cmake -G "MinGW Makefiles"
-- The C compiler identification is unknown
-- Check for working C compiler: x:/tools/sdcc/bin/sdcc.exe
-- Check for working C compiler: x:/tools/sdcc/bin/sdcc.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Configuring done
-- Generating done
-- Build files have been written to: X:/work/scratchpad/
of course i can always use:
include (CMakeForceCompiler)
CMAKE_FORCE_C_COMPILER ("x:/tools/sdcc/bin/sdcc.exe" SDCC)
but it is extremity