Clion SDCC Compiler STM8 Cmakelists.txt: Error 119 don't know what to do with file 'testCCompiler.c.obj'. file extension unsupported

已回答

Getting error with SDCC .obj file extension not supported.

error 119: don't know what to do with file 'CMakeFiles/cmTC_723dd.dir/testCCompiler.c.obj'. file extension unsupported

CMAKE options:

-D CMAKE_SYSTEM_NAME="Generic" -D CMAKE_C_COMPILER_ID="SDCC"  -D CMAKE_C_COMPILER="sdcc"

Build options:

-mstm8

 

"C:\Program Files\JetBrains\CLion2018\bin\cmake\win\bin\cmake.exe" -DCMAKE_BUILD_TYPE=Debug "-DCMAKE_C_COMPILER=C:/Program Files/SDCC/bin/sdcc.exe" -G "CodeBlocks - MinGW Makefiles" C:\Users\a\CLionProjects\untitled2
-- The C compiler identification is SDCC
-- Check for working C compiler: C:/Program Files/SDCC/bin/sdcc.exe
-- Check for working C compiler: C:/Program Files/SDCC/bin/sdcc.exe -- broken
CMake Error at C:/Program Files/JetBrains/CLion2018/bin/cmake/win/share/cmake-3.12/Modules/CMakeTestCCompiler.cmake:52 (message):
The C compiler

"C:/Program Files/SDCC/bin/sdcc.exe"

is not able to compile a simple test program.

It fails with the following output:

Change Dir: C:/Users/a/CLionProjects/untitled2/cmake-build-debug/CMakeFiles/CMakeTmp

Run Build Command:"C:/msys32/mingw64/bin/mingw32-make.exe" "cmTC_723dd/fast"
C:/msys32/mingw64/bin/mingw32-make.exe -f CMakeFiles\cmTC_723dd.dir\build.make CMakeFiles/cmTC_723dd.dir/build
mingw32-make.exe[1]: Entering directory 'C:/Users/a/CLionProjects/untitled2/cmake-build-debug/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_723dd.dir/testCCompiler.c.obj
C:\PROGRA~1\SDCC\bin\sdcc.exe -o CMakeFiles\cmTC_723dd.dir\testCCompiler.c.obj -c C:\Users\a\CLionProjects\untitled2\cmake-build-debug\CMakeFiles\CMakeTmp\testCCompiler.c
Linking C executable cmTC_723dd.exe
"C:\Program Files\JetBrains\CLion2018\bin\cmake\win\bin\cmake.exe" -E cmake_link_script CMakeFiles\cmTC_723dd.dir\link.txt --verbose=1
C:\PROGRA~1\SDCC\bin\sdcc.exe CMakeFiles/cmTC_723dd.dir/testCCompiler.c.obj -o cmTC_723dd.exe
at 1: error 119: don't know what to do with file 'CMakeFiles/cmTC_723dd.dir/testCCompiler.c.obj'. file extension unsupported
SDCC : mcs51/z80/z180/r2k/r3ka/gbz80/tlcs90/ds390/pic16/pic14/TININative/ds400/hc08/s08/stm8 3.8.0 #10562 (MINGW64)
published under GNU General Public License (GPL)
Usage : sdcc [options] filename

main.c:

#include <stdio.h>

int main() {
printf("Hello, World!\n");
return 0;
}

cmakelists.txt:

cmake_minimum_required(VERSION 3.5.0)
project(stm8 C)

set(CMAKE_C_FLAGS "-mstm8 -lstm8 --opt-code-size")
set(CMAKE_EXE_LINKER_FLAGS "")

add_definitions(-DSKIP_TRAPS=1)
add_definitions(-DSTM8S103)
add_definitions(-D__SDCC__)

# User program
include_directories(User)
file(GLOB_RECURSE USER_SOURCES "C:/Users/a/CLionProjects/untitled2/*.c")

# Library
set(SPL_PATH "C:/Program Files/SDCC/")
set(SPLC "${SPL_PATH}/lib/src")
include_directories("${SPL_PATH}/include")

# System
link_directories("C:/Program Files/SDCC/include")

set(SPL_SOURCES "${SPLC}/stm8s_gpio.c")
Clion 2018 Windows8
1

Hello! For now in CLion you can conveniently work with STM32 using the OpenOCD + STM32CubeMX support for ARM embedded development plugin (see https://blog.jetbrains.com/clion/2016/06/clion-for-embedded-development/ and https://blog.jetbrains.com/clion/2017/12/clion-for-embedded-development-part-ii/ for more details). The situation with STM8 is more difficult for several reasons (it doesn't have gcc, for example), we don't have any support for STM8 at the moment. But embedded development support is one of our main areas of focus for next year and many things in this area can change, so please follow updates in our blog in order to get all important news. 

0

请先登录再写评论。