# CMake编译ghs工程报警告 CMake generates a warning when compiling the ghs project.

**URL:** <https://discourse.cmake.org/t/cmake-ghs-cmake-generates-a-warning-when-compiling-the-ghs-project/13451>\
**Category:** Code\
**Created:** [January 22, 2025, 7:27am UTC](https://discourse.cmake.org/t/cmake-ghs-cmake-generates-a-warning-when-compiling-the-ghs-project/13451 "2025-01-22T07:27:03Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![wild.boy](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/w/fbc32d/32.png) [@wild.boy](https://discourse.cmake.org/u/wild.boy)\
**Post date:** [January 22, 2025, 7:27am UTC](https://discourse.cmake.org/t/cmake-ghs-cmake-generates-a-warning-when-compiling-the-ghs-project/13451/1 "2025-01-22T07:27:04Z")

</div>

I encountered a problem when compiling C code using the Ghs compiler through CMake.

Scenario: The MinGw Makefiles generator is used.

Problem: When compiling the source file, I always get a warning that “init.c.obj ignored with these options”, where init.c is the source file. Could it be that the ghs compiler does not recognize the.obj format of the output file? However, even after performing the following operations:

```auto
SET(CMAKE_C_OUTPUT_EXTENSION.o)
SET(CMAKE_CXX_OUTPUT_EXTENSION.o)
SET(CMAKE_ASM_OUTPUT_EXTENSION.o)

```

I am still unable to set the output file to a.o file. Do you have any good solutions to this warning?

 ![image](https://discourse.cmake.org/uploads/default/original/2X/6/629b2d4592c6a5084735a7a0c49bfe615795b58a.png)
