mintty的Cmake配置

cmake_minimum_required(VERSION 3.12)
project(src C)

set(CMAKE_C_STANDARD 11)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99 -include std.h -Wall -Wextra -Wundef -Werror -mtune=atom -g -O0  -fstack-check")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -static-libgcc -MMD -MP")   

#当使用add_definitions设置时,res.rc文件是无法编译通过的,要使用CMAKE_C_FLAGS。
#add_definitions(-static-libgcc -MMD -MP -std=gnu99 -include std.h -Wall -Wextra -Wundef -Werror -mtune=atom -g -O0  -fstack-check)
message("CMAKE_C_COMPILER=${CMAKE_C_COMPILER}")
message("CMAKE_RC_COMPILER=${CMAKE_RC_COMPILER}")

include_directories(.)

link_directories(/usr/lib/w32api)

add_executable(mintty WIN32
        appinfo.h
        base64.c
        base64.h
        charset.c
        charset.h
        child.c
        child.h
        config.c
        config.h
        ctrls.c
        ctrls.h
        jumplist.c
        jumplist.h
        mcwidth.c
        minibidi.c
        minibidi.h
        print.h
        printers.c
        res.h
        sixel.c
        sixel.h
        sixel_hls.c
        sixel_hls.h
        std.c
        std.h
        term.c
        term.h
        termclip.c
        termline.c
        termmouse.c
        termout.c
        termpriv.h
        textprint.c
        win.h
        winclip.c
        winctrls.c
        winctrls.h
        windialog.c
        winids.h
        winimg.c
        winimg.h
        wininput.c
        winmain.c
        winpriv.h
        winsearch.c
        winsearch.h
        wintext.c
        wintip.c
        res.rc)

target_link_libraries(mintty libusp10.a libgdiplus.a libcomctl32.a  libimm32.a libwinmm.a libwinspool.a libole32.a libuuid.a)