Files
build_infra/toolchain/Cygwin.cmake
T
2026-06-16 10:23:51 +08:00

21 lines
707 B
CMake
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 指定操作系统(Cygwin 被视为 Unix-like
set(CMAKE_SYSTEM_NAME CYGWIN)
set(CMAKE_FIND_ROOT_PATH "")
# 指定编译器
set(CMAKE_C_COMPILER "${CMAKE_FIND_ROOT_PATH}/bin/gcc.exe")
set(CMAKE_CXX_COMPILER "${CMAKE_FIND_ROOT_PATH}/bin/g++.exe")
# 指定链接器(可省略,默认由编译器调用)
set(CMAKE_LINKER "${CMAKE_FIND_ROOT_PATH}/bin/ld.exe")
set(CMAKE_AR "${CMAKE_FIND_ROOT_PATH}/bin/ar.exe")
# 设置程序查找路径(无需指定 sysroot)
# 设置程序查找模式(查找程序从本地环境找,库/头文件从 root 路径找)
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)