MSYS: Add support for running under MSYS runtime environment

Detect MSYS as CYGWIN, with the required adaptations.
This commit is contained in:
Orgad Shaneh 2021-04-01 20:03:52 +03:00 committed by Brad King
parent b3ca4f9ad1
commit ddcd1469e8
60 changed files with 246 additions and 66 deletions

View File

@ -27,6 +27,7 @@
# Tru64 Tru64
# Ultrix ULTRIX
# cygwin CYGWIN_NT-5.1
# MSYS MSYS_NT-6.1
# MacOSX Darwin
@ -43,7 +44,7 @@ if(CMAKE_HOST_UNIX)
else()
exec_program(${CMAKE_UNAME} ARGS -r OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_VERSION)
endif()
if(CMAKE_HOST_SYSTEM_NAME MATCHES "Linux|CYGWIN.*|^GNU$|Android")
if(CMAKE_HOST_SYSTEM_NAME MATCHES "Linux|CYGWIN.*|MSYS.*|^GNU$|Android")
exec_program(${CMAKE_UNAME} ARGS -m OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_PROCESSOR
RETURN_VALUE val)
elseif(CMAKE_HOST_SYSTEM_NAME MATCHES "Darwin")

View File

@ -5,6 +5,9 @@
#if defined(__linux) || defined(__linux__) || defined(linux)
# define PLATFORM_ID "Linux"
#elif defined(__MSYS__)
# define PLATFORM_ID "MSYS"
#elif defined(__CYGWIN__)
# define PLATFORM_ID "Cygwin"

View File

@ -14,6 +14,7 @@
set(APPLE )
set(UNIX )
set(CYGWIN )
set(MSYS )
set(WIN32 )

View File

@ -225,7 +225,7 @@ if(CMAKE_USE_PTHREADS_INIT)
set(CMAKE_THREAD_LIBS_INIT )
endif()
if(CMAKE_SYSTEM MATCHES "CYGWIN_NT")
if(CMAKE_SYSTEM MATCHES "CYGWIN_NT" OR CMAKE_SYSTEM MATCHES "MSYS_NT")
set(CMAKE_USE_PTHREADS_INIT 1)
set(Threads_FOUND TRUE)
set(CMAKE_THREAD_LIBS_INIT )

View File

@ -1,7 +1,7 @@
if("${CMAKE_MINIMUM_REQUIRED_VERSION}" VERSION_LESS "2.8.3.20101214")
if("${CMAKE_MINIMUM_REQUIRED_VERSION}" VERSION_LESS "2.8.3.20101214" AND NOT MSYS)
set(__USE_CMAKE_LEGACY_CYGWIN_WIN32 1)
endif()
if(NOT DEFINED WIN32)
if(NOT DEFINED WIN32 AND NOT MSYS)
set(WIN32 0)
if(DEFINED __USE_CMAKE_LEGACY_CYGWIN_WIN32)
if(NOT DEFINED CMAKE_LEGACY_CYGWIN_WIN32

View File

@ -0,0 +1 @@
include(Platform/CYGWIN-Clang-C)

View File

@ -0,0 +1 @@
include(Platform/CYGWIN-Clang-CXX)

View File

@ -0,0 +1 @@
include(Platform/CYGWIN-Determine-CXX)

View File

@ -0,0 +1 @@
include(Platform/CYGWIN-GNU-C)

View File

@ -0,0 +1 @@
include(Platform/CYGWIN-GNU-CXX)

View File

@ -0,0 +1 @@
include(Platform/CYGWIN-GNU-Fortran)

View File

@ -0,0 +1 @@
include(Platform/CYGWIN-GNU)

View File

@ -0,0 +1 @@
include(Platform/CYGWIN-windres)

View File

@ -0,0 +1,4 @@
set(MSYS 1)
include(Platform/CYGWIN)
set(CMAKE_SHARED_LIBRARY_PREFIX "msys-")
set(CMAKE_SHARED_MODULE_PREFIX "msys-")

View File

@ -44,7 +44,7 @@ endif()
if(NOT CMake_DEFAULT_RECURSION_LIMIT)
if(DEFINED ENV{DASHBOARD_TEST_FROM_CTEST})
set(CMake_DEFAULT_RECURSION_LIMIT 100)
elseif(MINGW)
elseif(MINGW OR MSYS)
set(CMake_DEFAULT_RECURSION_LIMIT 400)
elseif(WIN32 AND CMAKE_C_COMPILER_ID STREQUAL "IntelLLVM")
set(CMake_DEFAULT_RECURSION_LIMIT 600)

View File

@ -80,7 +80,9 @@ if(CMake_HAVE_CXX_MAKE_UNIQUE)
set(CMake_HAVE_CXX_UNIQUE_PTR 1)
endif()
cm_check_cxx_feature(unique_ptr)
if (NOT CMAKE_CXX_STANDARD LESS "17")
if (NOT CMAKE_CXX_STANDARD LESS "17"
AND NOT MSYS # FIXME: RunCMake.cmake_path cases crash with MSYS std::filesystem
)
if (NOT CMAKE_CROSSCOMPILING OR CMAKE_CROSSCOMPILING_EMULATOR)
cm_check_cxx_feature(filesystem TRY_RUN)
else()

View File

@ -40,7 +40,14 @@ They may be set by end users to point at LibUUID components.
#]=======================================================================]
#-----------------------------------------------------------------------------
if(CYGWIN)
if(MSYS)
# Note: on current version of MSYS2, linking to libuuid.dll.a doesn't
# import the right symbols sometimes. Fix this by linking directly
# to the DLL that provides the symbols, instead.
find_library(LibUUID_LIBRARY
NAMES msys-uuid-1.dll
)
elseif(CYGWIN)
# Note: on current version of Cygwin, linking to libuuid.dll.a doesn't
# import the right symbols sometimes. Fix this by linking directly
# to the DLL that provides the symbols, instead.

View File

@ -655,7 +655,7 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
xml.EndElement(); // extension
} else {
std::string systemName = mf->GetSafeDefinition("CMAKE_SYSTEM_NAME");
if (systemName == "CYGWIN") {
if (systemName == "CYGWIN" || systemName == "MSYS") {
xml.StartElement("extension");
xml.Attribute("id", "org.eclipse.cdt.core.Cygwin_PE");
xml.Attribute("point", "org.eclipse.cdt.core.BinaryParser");

View File

@ -3239,10 +3239,14 @@ cm::string_view cmSystemTools::GetSystemName()
systemName = "kFreeBSD";
}
// fix for CYGWIN which has windows version in it
// fix for CYGWIN and MSYS which have windows version in them
if (systemName.find("CYGWIN") != cm::string_view::npos) {
systemName = "CYGWIN";
}
if (systemName.find("MSYS") != cm::string_view::npos) {
systemName = "MSYS";
}
return systemName;
}
return "";

View File

@ -460,7 +460,7 @@ if(BUILD_TESTING)
ADD_TEST_MACRO(OutName exe.OutName.exe)
ADD_TEST_MACRO(ObjectLibrary UseCshared)
ADD_TEST_MACRO(NewlineArgs NewlineArgs)
ADD_TEST_MACRO(SetLang SetLang)
ADD_TEST_MACRO(SetLang SetLangX)
ADD_TEST_MACRO(EmptyProperty EmptyProperty)
ADD_TEST_MACRO(ExternalOBJ ExternalOBJ)
if(NOT CMake_TEST_EXTERNAL_CMAKE)

View File

@ -36,7 +36,7 @@ if(CMAKE_CXX_COMPILER_ID MATCHES Intel)
string (REGEX REPLACE ".*Version ([0-9]+(\\.[0-9]+)+).*" "\\1" _intel_version "${_intel_version_info}")
endif()
message("Platform:\n WIN32: ${WIN32}\n UNIX: ${UNIX}\n APPLE: ${APPLE}\n MINGW: ${MINGW}\n CYGWIN: ${CYGWIN}\n"
message("Platform:\n WIN32: ${WIN32}\n UNIX: ${UNIX}\n APPLE: ${APPLE}\n MINGW: ${MINGW}\n CYGWIN: ${CYGWIN}\n MSYS: ${MSYS}\n"
" MSVC: ${MSVC}\n MSVC60: ${MSVC60}\n MSVC70: ${MSVC70}\n MSVC71: ${MSVC71}\n MSVC80: ${MSVC80}\n MSVC90: ${MSVC90}\n MSVC10: ${MSVC10}\n"
" GCC: ${_gcc_version}\n"
" Clang: ${_clang_version}\n"

View File

@ -459,7 +459,28 @@ set(msys_g77_dirs "C:/some-mingw/lib/gcc/mingw32/3.4.5;C:/some-mingw/lib/gcc;/so
list(APPEND platforms msys_g77)
#-----------------------------------------------------------------------------
# MSYS2
# MSYS2-runtime
# gcc dummy.c -v
set(msys2rt_gcc_text " /usr/lib/gcc/i686-pc-msys/6.4.0/collect2.exe -Bdynamic --dll-search-prefix=msys- /usr/lib/gcc/i686-pc-msys/6.4.0/../../../crt0.o -L/usr/lib/gcc/i686-pc-msys/6.4.0 -L/usr/lib/gcc/i686-pc-msys/6.4.0 -L/usr/lib/gcc/i686-pc-msys/6.4.0/../../.. /home/user/AppData/Local/Temp/cczg1Arh.o -lgcc -lmsys-2.0 -luser32 -lkernel32 -ladvapi32 -lshell32 -lgcc")
set(msys2rt_gcc_libs "msys-2.0;user32;kernel32;advapi32;shell32")
set(msys2rt_gcc_dirs "/usr/lib/gcc/i686-pc-msys/6.4.0;/usr/lib")
list(APPEND platforms msysrt_gcc)
# g++ dummy.cxx -v
set(msys2rt_g++_text " /usr/lib/gcc/i686-pc-msys/6.4.0/collect2.exe -Bdynamic --dll-search-prefix=msys- /usr/lib/gcc/i686-pc-msys/6.4.0/../../../crt0.o -L/usr/lib/gcc/i686-pc-msys/6.4.0 -L/usr/lib/gcc/i686-pc-msys/6.4.0 -L/usr/lib/gcc/i686-pc-msys/6.4.0/../../.. /home/user/AppData/Local/Temp/ccsvcDO6.o -lstdc++ -lgcc -lmsys-2.0 -luser32 -lkernel32 -ladvapi32 -lshell32 -lgcc")
set(msys2rt_g++_libs "stdc++;msys-2.0;user32;kernel32;advapi32;shell32")
set(msys2rt_g++_dirs "/usr/lib/gcc/i686-pc-msys/6.4.0;/usr/lib")
list(APPEND platforms msysrt_g++)
# g77 dummy.f -v
set(msys2rt_g77_text "Configured with: ... LD=/opt/gcc-tools/bin/ld.exe /usr/lib/gcc/i686-pc-msys/6.4.0/collect2.exe -Bdynamic --dll-search-prefix=msys- -u ___register_frame_info -u ___deregister_frame_info /usr/lib/gcc/i686-pc-msys/6.4.0/../../../crt0.o /usr/lib/gcc/i686-pc-msys/6.4.0/crtbegin.o -L/usr/lib/gcc/i686-pc-msys/6.4.0 -L/usr/lib/gcc/i686-pc-msys/6.4.0 -L/usr/lib/gcc/i686-pc-msys/6.4.0/../../.. /home/user/AppData/Local/Temp/ccqRWKWg.o -lgfortranbegin -lgfortran -lgcc_s -lgcc_s -lgcc -lmsys-2.0 -luser32 -lkernel32 -ladvapi32 -lshell32 -lgcc_s -lgcc_s -lgcc /usr/lib/gcc/i686-pc-msys/6.4.0/crtend.o")
set(msys2rt_g77_libs "stdc++;msys-2.0;user32;kernel32;advapi32;shell32")
set(msys2rt_g77_dirs "/usr/lib/gcc/i686-pc-msys/6.4.0;/usr/lib")
list(APPEND platforms msysrt_g77)
#-----------------------------------------------------------------------------
# MSYS2-mingw
# gcc dummy.c -v
set(msys2_gcc_text " C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/7.2.0/collect2.exe -plugin C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/7.2.0/liblto_plugin-0.dll -plugin-opt=C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/7.2.0/lto-wrapper.exe -plugin-opt=-fresolution=C:/msys64/tmp/ccikz9Wf.res -plugin-opt=-pass-through=-lmingw32 -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_eh -plugin-opt=-pass-through=-lmoldname -plugin-opt=-pass-through=-lmingwex -plugin-opt=-pass-through=-lmsvcrt -plugin-opt=-pass-through=-lpthread -plugin-opt=-pass-through=-ladvapi32 -plugin-opt=-pass-through=-lshell32 -plugin-opt=-pass-through=-luser32 -plugin-opt=-pass-through=-lkernel32 -plugin-opt=-pass-through=-lmingw32 -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_eh -plugin-opt=-pass-through=-lmoldname -plugin-opt=-pass-through=-lmingwex -plugin-opt=-pass-through=-lmsvcrt -m i386pep -Bdynamic C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/7.2.0/../../../../x86_64-w64-mingw32/lib/../lib/crt2.o C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/7.2.0/crtbegin.o -LC:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/7.2.0 -LC:/msys64/mingw64/bin/../lib/gcc -LC:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/7.2.0/../../../../x86_64-w64-mingw32/lib/../lib -LC:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/7.2.0/../../../../lib -LC:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/7.2.0/../../../../x86_64-w64-mingw32/lib -LC:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/7.2.0/../../.. C:/msys64/tmp/ccK0dTUv.o -lmingw32 -lgcc -lgcc_eh -lmoldname -lmingwex -lmsvcrt -lpthread -ladvapi32 -lshell32 -luser32 -lkernel32 -lmingw32 -lgcc -lgcc_eh -lmoldname -lmingwex -lmsvcrt C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/7.2.0/../../../../x86_64-w64-mingw32/lib/../lib/default-manifest.o C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/7.2.0/crtend.o")

View File

@ -189,7 +189,9 @@ find_package(ArchD 4.0 EXACT NAMES zot)
unset(CMAKE_LIBRARY_ARCHITECTURE)
# Test find_package() with CMAKE_FIND_PACKAGE_RESOLVE_SYMLINKS enabled
if(UNIX)
if(UNIX
AND NOT MSYS # FIXME: This works on CYGWIN but not on MSYS
)
# Create ./symlink pointing back here.
execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink
. "${CMAKE_CURRENT_SOURCE_DIR}/symlink")

View File

@ -165,7 +165,7 @@ if(CMAKE_GENERATOR MATCHES "Ninja")
endif()
add_RunCMake_test(Ninja)
set(NinjaMultiConfig_ARGS
-DCYGWIN=${CYGWIN}
-DCYGWIN=${CYGWIN} -DMSYS=${MSYS}
)
if(CMake_TEST_Qt5 AND Qt5Core_FOUND)
list(APPEND NinjaMultiConfig_ARGS -DCMake_TEST_Qt5=1 -DQt5Core_DIR=${Qt5Core_DIR} -DCMAKE_TEST_Qt5Core_Version=${Qt5Core_VERSION})
@ -346,7 +346,7 @@ add_RunCMake_test(export)
add_RunCMake_test(cmake_language)
add_RunCMake_test(cmake_minimum_required)
add_RunCMake_test(cmake_parse_arguments)
add_RunCMake_test(cmake_path)
add_RunCMake_test(cmake_path -DMSYS=${MSYS})
add_RunCMake_test(continue)
add_executable(color_warning color_warning.c)
add_executable(fake_build_command fake_build_command.c)
@ -367,14 +367,14 @@ add_RunCMake_test(ctest_skipped_test)
add_RunCMake_test(ctest_update)
add_RunCMake_test(ctest_upload)
add_RunCMake_test(ctest_fixtures)
add_RunCMake_test(file)
add_RunCMake_test(file-CHMOD)
add_RunCMake_test(file -DMSYS=${MSYS})
add_RunCMake_test(file-CHMOD -DMSYS=${MSYS})
if(HAVE_ELF_H OR CMAKE_SYSTEM_NAME STREQUAL "AIX")
add_RunCMake_test(file-RPATH -DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME} -DHAVE_ELF_H=${HAVE_ELF_H})
endif()
add_RunCMake_test(find_file)
add_RunCMake_test(find_library -DCYGWIN=${CYGWIN})
add_RunCMake_test(find_package)
add_RunCMake_test(find_library -DCYGWIN=${CYGWIN} -DMSYS=${MSYS})
add_RunCMake_test(find_package -DMSYS=${MSYS})
add_RunCMake_test(find_path)
add_RunCMake_test(find_program -DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME})
add_RunCMake_test(foreach)
@ -512,7 +512,9 @@ else()
message(STATUS "Could not find ctresalloc")
endif()
if(NOT WIN32)
if(NOT WIN32
AND NOT MSYS # FIXME: This works on CYGWIN but not on MSYS
)
add_RunCMake_test(SymlinkTrees)
endif ()
@ -616,7 +618,8 @@ endif()
add_executable(pseudo_llvm-rc pseudo_llvm-rc.c)
add_RunCMake_test(CommandLine -DLLVM_RC=$<TARGET_FILE:pseudo_llvm-rc> -DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME} -DCYGWIN=${CYGWIN} -DPYTHON_EXECUTABLE=${PYTHON_EXECUTABLE})
add_RunCMake_test(CommandLine -DLLVM_RC=$<TARGET_FILE:pseudo_llvm-rc> -DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME}
-DCYGWIN=${CYGWIN} -DMSYS=${MSYS} -DPYTHON_EXECUTABLE=${PYTHON_EXECUTABLE})
add_RunCMake_test(CommandLineTar)
if(CMAKE_PLATFORM_NO_VERSIONED_SONAME OR (NOT CMAKE_SHARED_LIBRARY_SONAME_FLAG AND NOT CMAKE_SHARED_LIBRARY_SONAME_C_FLAG))
@ -625,7 +628,7 @@ else()
set(NO_NAMELINK 0)
endif()
add_RunCMake_test(install -DNO_NAMELINK=${NO_NAMELINK} -DCYGWIN=${CYGWIN}
add_RunCMake_test(install -DNO_NAMELINK=${NO_NAMELINK} -DCYGWIN=${CYGWIN} -DMSYS=${MSYS}
-DCMAKE_SHARED_LIBRARY_RPATH_ORIGIN_TOKEN=${CMAKE_SHARED_LIBRARY_RPATH_ORIGIN_TOKEN}
-DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME}
-DCMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG=${CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG}

View File

@ -562,7 +562,7 @@ file(MAKE_DIRECTORY ${out})
run_cmake_command(E_cat_non_existing_file
${CMAKE_COMMAND} -E cat ${out}/non-existing-file.txt)
if(UNIX)
if(UNIX AND NOT MSYS)
# test non readable file only if not root
execute_process(
COMMAND id -u $ENV{USER}
@ -801,7 +801,7 @@ function(reject_fifo)
run_cmake_command(reject_fifo ${BASH_EXECUTABLE} -c ${BASH_COMMAND_ARGUMENT})
endif()
endfunction()
if(CMAKE_HOST_UNIX AND NOT CMAKE_SYSTEM_NAME STREQUAL "CYGWIN")
if(CMAKE_HOST_UNIX AND NOT CMAKE_SYSTEM_NAME STREQUAL "CYGWIN" AND NOT CMAKE_SYSTEM_NAME STREQUAL "MSYS")
reject_fifo()
run_cmake_command(closed_stdin sh -c "\"${CMAKE_COMMAND}\" --version <&-")
run_cmake_command(closed_stdout sh -c "\"${CMAKE_COMMAND}\" --version >&-")

View File

@ -119,7 +119,7 @@
"type": "target",
"destination": "lib",
"paths": [
"^lib/((Debug|Release|MinSizeRel|RelWithDebInfo)/)?(lib|cyg)?c_shared_lib(-1)?\\.(dll|so)$"
"^lib/((Debug|Release|MinSizeRel|RelWithDebInfo)/)?(lib|cyg|msys-)?c_shared_lib(-1)?\\.(dll|so)$"
],
"pathsNamelink": [
"^lib/((Debug|Release|MinSizeRel|RelWithDebInfo)/)?(lib)?c_shared_lib\\.(so\\.1\\.2\\.3|1\\.2\\.3\\.dylib)$",
@ -210,7 +210,7 @@
"type": "target",
"destination": "lib",
"paths": [
"^cxx/((Debug|Release|MinSizeRel|RelWithDebInfo)/)?(lib|cyg)?cxx_shared_lib\\.(dll|so|dylib)$"
"^cxx/((Debug|Release|MinSizeRel|RelWithDebInfo)/)?(lib|cyg|msys-)?cxx_shared_lib\\.(dll|so|dylib)$"
],
"isExcludeFromAll": null,
"isOptional": null,

View File

@ -90,10 +90,10 @@
}
],
"folder": null,
"nameOnDisk": "^(lib|cyg)?c_shared_lib(-1)?\\.(so|dylib|dll)$",
"nameOnDisk": "^(lib|cyg|msys-)?c_shared_lib(-1)?\\.(so|dylib|dll)$",
"artifacts": [
{
"path": "^lib/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?(lib|cyg)?c_shared_lib(-1)?\\.(so|dylib|dll)$",
"path": "^lib/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?(lib|cyg|msys-)?c_shared_lib(-1)?\\.(so|dylib|dll)$",
"_dllExtra": false
},
{
@ -101,7 +101,7 @@
"_dllExtra": true
},
{
"path": "^lib/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?(lib|cyg)?c_shared_lib(-1)?\\.pdb$",
"path": "^lib/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?(lib|cyg|msys-)?c_shared_lib(-1)?\\.pdb$",
"_dllExtra": true
}
],

View File

@ -66,10 +66,10 @@
}
],
"folder": null,
"nameOnDisk": "^(lib|cyg)?cxx_shared_lib\\.(so|dylib|dll)$",
"nameOnDisk": "^(lib|cyg|msys-)?cxx_shared_lib\\.(so|dylib|dll)$",
"artifacts": [
{
"path": "^cxx/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?(lib|cyg)?cxx_shared_lib\\.(so|dylib|dll)$",
"path": "^cxx/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?(lib|cyg|msys-)?cxx_shared_lib\\.(so|dylib|dll)$",
"_dllExtra": false
},
{
@ -77,7 +77,7 @@
"_dllExtra": true
},
{
"path": "^cxx/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?(lib|cyg)?cxx_shared_lib\\.pdb$",
"path": "^cxx/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?(lib|cyg|msys-)?cxx_shared_lib\\.pdb$",
"_dllExtra": true
}
],

View File

@ -11,5 +11,6 @@ file(GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/$<LOWER_CASE:$<CONFIG>>/custom
add_custom_target(checkCustomFilePermissions ALL
COMMAND ${CMAKE_COMMAND}
-DgeneratedFile=${CMAKE_CURRENT_BINARY_DIR}/$<LOWER_CASE:$<CONFIG>>/customfilepermissions.txt
-DMSYS=${MSYS}
-P "${CMAKE_CURRENT_SOURCE_DIR}/CustomFilePermissionsVerify.cmake"
)

View File

@ -2,7 +2,7 @@ if(NOT EXISTS "${generatedFile}")
message(SEND_ERROR "Missing file:\n ${generatedFile}")
endif()
if (UNIX)
if (UNIX AND NOT MSYS)
find_program(STAT_EXECUTABLE NAMES stat)
if(NOT STAT_EXECUTABLE)
return()

View File

@ -2,7 +2,7 @@ if(NOT EXISTS "${generatedFile}")
message(SEND_ERROR "Missing generated file:\n ${generatedFile}")
endif()
if (UNIX)
if (UNIX AND NOT MSYS)
find_program(STAT_EXECUTABLE NAMES stat)
if(NOT STAT_EXECUTABLE)
return()

View File

@ -58,8 +58,8 @@ set_property (TARGET static3 PROPERTY ARCHIVE_OUTPUT_NAME static3_archive)
string (APPEND GENERATE_CONTENT [[
check_value ("TARGET_FILE_BASE_NAME executable all properties" "$<TARGET_FILE_BASE_NAME:exec3>" "exec3_runtime")
check_value ("TARGET_FILE_BASE_NAME shared all properties" "$<TARGET_FILE_BASE_NAME:shared3>" "$<IF:$<IN_LIST:$<PLATFORM_ID>,Windows$<SEMICOLON>CYGWIN>,shared3_runtime,shared3_library>")
check_value ("TARGET_LINKER_FILE_BASE_NAME shared linker all properties" "$<TARGET_LINKER_FILE_BASE_NAME:shared3>" "$<IF:$<IN_LIST:$<PLATFORM_ID>,Windows$<SEMICOLON>CYGWIN>,shared3_archive,shared3_library>")
check_value ("TARGET_FILE_BASE_NAME shared all properties" "$<TARGET_FILE_BASE_NAME:shared3>" "$<IF:$<IN_LIST:$<PLATFORM_ID>,Windows$<SEMICOLON>CYGWIN$<SEMICOLON>MSYS>,shared3_runtime,shared3_library>")
check_value ("TARGET_LINKER_FILE_BASE_NAME shared linker all properties" "$<TARGET_LINKER_FILE_BASE_NAME:shared3>" "$<IF:$<IN_LIST:$<PLATFORM_ID>,Windows$<SEMICOLON>CYGWIN$<SEMICOLON>MSYS>,shared3_archive,shared3_library>")
check_value ("TARGET_FILE_BASE_NAME static all properties" "$<TARGET_FILE_BASE_NAME:static3>" "static3_archive")
check_value ("TARGET_LINKER_FILE_BASE_NAME static linker all properties" "$<TARGET_LINKER_FILE_BASE_NAME:static3>" "static3_archive")
]])
@ -95,8 +95,8 @@ set_property (TARGET static4 PROPERTY ${FIRST_CONFIG}_POSTFIX _postfix)
string (APPEND GENERATE_CONTENT [[
check_value ("TARGET_FILE_BASE_NAME executable all properties + postfix" "$<TARGET_FILE_BASE_NAME:exec4>" "exec4_runtime_postfix")
check_value ("TARGET_FILE_BASE_NAME shared all properties + postfix" "$<TARGET_FILE_BASE_NAME:shared4>" "$<IF:$<IN_LIST:$<PLATFORM_ID>,Windows$<SEMICOLON>CYGWIN>,shared4_runtime,shared4_library>_postfix")
check_value ("TARGET_LINKER_FILE_BASE_NAME shared linker all properties + postfix" "$<TARGET_LINKER_FILE_BASE_NAME:shared4>" "$<IF:$<IN_LIST:$<PLATFORM_ID>,Windows$<SEMICOLON>CYGWIN>,shared4_archive,shared4_library>_postfix")
check_value ("TARGET_FILE_BASE_NAME shared all properties + postfix" "$<TARGET_FILE_BASE_NAME:shared4>" "$<IF:$<IN_LIST:$<PLATFORM_ID>,Windows$<SEMICOLON>CYGWIN$<SEMICOLON>MSYS>,shared4_runtime,shared4_library>_postfix")
check_value ("TARGET_LINKER_FILE_BASE_NAME shared linker all properties + postfix" "$<TARGET_LINKER_FILE_BASE_NAME:shared4>" "$<IF:$<IN_LIST:$<PLATFORM_ID>,Windows$<SEMICOLON>CYGWIN$<SEMICOLON>MSYS>,shared4_archive,shared4_library>_postfix")
check_value ("TARGET_FILE_BASE_NAME static all properties + postfix" "$<TARGET_FILE_BASE_NAME:static4>" "static4_archive_postfix")
check_value ("TARGET_LINKER_FILE_BASE_NAME static linker all properties + postfix" "$<TARGET_LINKER_FILE_BASE_NAME:static4>" "static4_archive_postfix")
]])

View File

@ -72,8 +72,8 @@ set_property (TARGET static3 PROPERTY PDB_NAME static3_pdb)
string (APPEND GENERATE_CONTENT [[
check_value ("TARGET_FILE_BASE_NAME executable all properties" "$<TARGET_FILE_BASE_NAME:exec3>" "exec3_runtime")
check_value ("TARGET_FILE_BASE_NAME shared all properties" "$<TARGET_FILE_BASE_NAME:shared3>" "$<IF:$<IN_LIST:$<PLATFORM_ID>,Windows$<SEMICOLON>CYGWIN>,shared3_runtime,shared3_library>")
check_value ("TARGET_LINKER_FILE_BASE_NAME shared linker all properties" "$<TARGET_LINKER_FILE_BASE_NAME:shared3>" "$<IF:$<IN_LIST:$<PLATFORM_ID>,Windows$<SEMICOLON>CYGWIN>,shared3_archive,shared3_library>")
check_value ("TARGET_FILE_BASE_NAME shared all properties" "$<TARGET_FILE_BASE_NAME:shared3>" "$<IF:$<IN_LIST:$<PLATFORM_ID>,Windows$<SEMICOLON>CYGWIN$<SEMICOLON>MSYS>,shared3_runtime,shared3_library>")
check_value ("TARGET_LINKER_FILE_BASE_NAME shared linker all properties" "$<TARGET_LINKER_FILE_BASE_NAME:shared3>" "$<IF:$<IN_LIST:$<PLATFORM_ID>,Windows$<SEMICOLON>CYGWIN$<SEMICOLON>MSYS>,shared3_archive,shared3_library>")
check_value ("TARGET_FILE_BASE_NAME static all properties" "$<TARGET_FILE_BASE_NAME:static3>" "static3_archive")
check_value ("TARGET_LINKER_FILE_BASE_NAME static linker all properties" "$<TARGET_LINKER_FILE_BASE_NAME:static3>" "static3_archive")
]])
@ -118,8 +118,8 @@ set_property (TARGET static4 PROPERTY ${FIRST_CONFIG}_POSTFIX _postfix)
string (APPEND GENERATE_CONTENT [[
check_value ("TARGET_FILE_BASE_NAME executable all properties + postfix" "$<TARGET_FILE_BASE_NAME:exec4>" "exec4_runtime_postfix")
check_value ("TARGET_FILE_BASE_NAME shared all properties + postfix" "$<TARGET_FILE_BASE_NAME:shared4>" "$<IF:$<IN_LIST:$<PLATFORM_ID>,Windows$<SEMICOLON>CYGWIN>,shared4_runtime,shared4_library>_postfix")
check_value ("TARGET_LINKER_FILE_BASE_NAME shared linker all properties + postfix" "$<TARGET_LINKER_FILE_BASE_NAME:shared4>" "$<IF:$<IN_LIST:$<PLATFORM_ID>,Windows$<SEMICOLON>CYGWIN>,shared4_archive,shared4_library>_postfix")
check_value ("TARGET_FILE_BASE_NAME shared all properties + postfix" "$<TARGET_FILE_BASE_NAME:shared4>" "$<IF:$<IN_LIST:$<PLATFORM_ID>,Windows$<SEMICOLON>CYGWIN$<SEMICOLON>MSYS>,shared4_runtime,shared4_library>_postfix")
check_value ("TARGET_LINKER_FILE_BASE_NAME shared linker all properties + postfix" "$<TARGET_LINKER_FILE_BASE_NAME:shared4>" "$<IF:$<IN_LIST:$<PLATFORM_ID>,Windows$<SEMICOLON>CYGWIN$<SEMICOLON>MSYS>,shared4_archive,shared4_library>_postfix")
check_value ("TARGET_FILE_BASE_NAME static all properties + postfix" "$<TARGET_FILE_BASE_NAME:static4>" "static4_archive_postfix")
check_value ("TARGET_LINKER_FILE_BASE_NAME static linker all properties + postfix" "$<TARGET_LINKER_FILE_BASE_NAME:static4>" "static4_archive_postfix")
]])

View File

@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.14)
enable_language (C)
set (win_platforms Windows CYGWIN)
set (win_platforms Windows CYGWIN MSYS)
set (GENERATE_CONTENT [[
macro (CHECK_VALUE test_msg value expected)

View File

@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.14)
enable_language (C)
set (win_platforms Windows CYGWIN)
set (win_platforms Windows CYGWIN MSYS)
set (GENERATE_CONTENT [[
macro (CHECK_VALUE test_msg value expected)

View File

@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.14)
enable_language (C)
set (win_platforms Windows CYGWIN)
set (win_platforms Windows CYGWIN MSYS)
set (GENERATE_CONTENT [[
macro (CHECK_VALUE test_msg value expected)

View File

@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.14)
enable_language (C)
set (win_platforms Windows CYGWIN)
set (win_platforms Windows CYGWIN MSYS)
set (GENERATE_CONTENT [[
macro (CHECK_VALUE test_msg value expected)

View File

@ -8,6 +8,14 @@
#include "libshared.h"
#include "libstatic.h"
static void rtrim(std::string& str, char byte)
{
const std::size_t size = str.size();
if (size && str[size - 1] == byte) {
str.resize(size - 1);
}
}
void compare(const char* refName, const char* testName)
{
std::ifstream ref;
@ -31,16 +39,14 @@ void compare(const char* refName, const char* testName)
// Some very old Borland runtimes (C++ Builder 5 WITHOUT Update 1) add a
// trailing null to the string that we need to strip before testing for a
// trailing space.
if (refLine.size() && refLine[refLine.size() - 1] == 0) {
refLine.resize(refLine.size() - 1);
}
if (testLine.size() && testLine[testLine.size() - 1] == 0) {
testLine.resize(testLine.size() - 1);
}
rtrim(refLine, 0);
rtrim(testLine, 0);
// The reference files never have trailing spaces:
if (testLine.size() && testLine[testLine.size() - 1] == ' ') {
testLine.resize(testLine.size() - 1);
}
rtrim(testLine, ' ');
// Strip trailing CR. LF is not returned by getline, but CR is returned
// on some platforms.
rtrim(refLine, '\r');
rtrim(testLine, '\r');
if (refLine != testLine) {
std::cout << "Ref and test are not the same:\n Ref: \"" << refLine
<< "\"\n Test: \"" << testLine << "\"\n";

View File

@ -23,10 +23,13 @@ function(run_cmake test)
endif()
string(TOLOWER ${CMAKE_HOST_SYSTEM_NAME} platform_name)
#remove all additional bits from cygwin/msys name
if(platform_name MATCHES cygwin)
#remove all additional bits from cygwin name
set(platform_name cygwin)
endif()
if(platform_name MATCHES msys)
set(platform_name msys)
endif()
foreach(o out err)
if(RunCMake-std${o}-file AND EXISTS ${top_src}/${RunCMake-std${o}-file})

View File

@ -1,7 +1,7 @@
configure_file(NoSourcePermissions.sh NoSourcePermissions.sh.out
NO_SOURCE_PERMISSIONS)
if (UNIX)
if (UNIX AND NOT MSYS)
execute_process(COMMAND ${CMAKE_CURRENT_BINARY_DIR}/NoSourcePermissions.sh.out
RESULT_VARIABLE result)
if (result EQUAL "0")

View File

@ -6,7 +6,7 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/sourcefile.txt
WORLD_READ
)
if (CMAKE_HOST_UNIX)
if (CMAKE_HOST_UNIX AND NOT MSYS)
find_program(STAT_EXECUTABLE NAMES stat)
if(NOT STAT_EXECUTABLE)
return()

View File

@ -14,6 +14,6 @@ if(UNIX)
OUTPUT_STRIP_TRAILING_WHITESPACE)
endif()
if(NOT WIN32 AND NOT "${uid}" STREQUAL "0")
if(NOT WIN32 AND NOT MSYS AND NOT "${uid}" STREQUAL "0")
run_cmake(CHMOD-write-only)
endif()

View File

@ -87,7 +87,9 @@ run_cmake(GLOB-noexp-RELATIVE)
run_cmake_command(GLOB-error-CONFIGURE_DEPENDS-SCRIPT_MODE ${CMAKE_COMMAND} -P
${RunCMake_SOURCE_DIR}/GLOB-error-CONFIGURE_DEPENDS-SCRIPT_MODE.cmake)
if(NOT WIN32 OR CYGWIN)
if(NOT WIN32
AND NOT MSYS # FIXME: This works on CYGWIN but not on MSYS
)
run_cmake(CREATE_LINK-SYMBOLIC)
run_cmake(CREATE_LINK-SYMBOLIC-noexist)
run_cmake(GLOB_RECURSE-cyclic-recursion)
@ -162,7 +164,9 @@ else()
run_cmake_command(GLOB-CONFIGURE_DEPENDS-RerunCMake-rebuild_second ${CMAKE_COMMAND} --build .)
run_cmake_command(GLOB-CONFIGURE_DEPENDS-RerunCMake-nowork ${CMAKE_COMMAND} --build .)
if(NOT WIN32 OR CYGWIN)
if(NOT WIN32
AND NOT MSYS # FIXME: This works on CYGWIN but not on MSYS
)
message(STATUS "GLOB-CONFIGURE_DEPENDS-CMP0009-RerunCMake: link the first test directory into a new directory...")
file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}/test2")
execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink "${RunCMake_TEST_BINARY_DIR}/test" "${RunCMake_TEST_BINARY_DIR}/test2/test_folder_symlink")

View File

@ -0,0 +1,9 @@
-- PrefixInPATH_File='PrefixInPATH_File-NOTFOUND'
-- PrefixInPATH_File='.*/Tests/RunCMake/find_file/include/PrefixInPATH.h'
-- PrefixInPATH_File='.*/Tests/RunCMake/find_file/include/PrefixInPATH.h'
-- PrefixInPATH_File='PrefixInPATH_File-NOTFOUND'
-- PrefixInPATH_File='PrefixInPATH_File-NOTFOUND'
-- PrefixInPATH_File='PrefixInPATH_File-NOTFOUND'
-- PrefixInPATH_File='PrefixInPATH_File-NOTFOUND'
-- PrefixInPATH_File='PrefixInPATH_File-NOTFOUND'
-- PrefixInPATH_File='PrefixInPATH_File-NOTFOUND'

View File

@ -0,0 +1,4 @@
-- PrefixInPATH_INCLUDE_DIR='PrefixInPATH_INCLUDE_DIR-NOTFOUND'
-- PrefixInPATH_INCLUDE_DIR='.*/Tests/RunCMake/find_file/include/PrefixInPATH.h'
-- PrefixInPATH_INCLUDE_DIR='.*/Tests/RunCMake/find_file/include/PrefixInPATH.h'
-- PrefixInPATH_INCLUDE_DIR='.*/Tests/RunCMake/find_file/include/PrefixInPATH.h'

View File

@ -0,0 +1,6 @@
-- CREATED_LIBRARY='CREATED_LIBRARY-NOTFOUND'
-- CREATED_LIBRARY='[^']*/Tests/RunCMake/find_library/FromPATHEnv-build/lib/libcreated.a'
-- CREATED_LIBRARY='[^']*/Tests/RunCMake/find_library/FromPATHEnv-build/lib/libcreated.a'
-- CREATED_LIBRARY='CREATED_LIBRARY-NOTFOUND'
-- CREATED_LIBRARY='CREATED_LIBRARY-NOTFOUND'
-- CREATED_LIBRARY='CREATED_LIBRARY-NOTFOUND'

View File

@ -0,0 +1,4 @@
-- PrefixInPATH_LIBRARY='PrefixInPATH_LIBRARY-NOTFOUND'
-- PrefixInPATH_LIBRARY='.*/Tests/RunCMake/find_library/lib/libPrefixInPATH.a'
-- PrefixInPATH_LIBRARY='.*/Tests/RunCMake/find_library/lib/libPrefixInPATH.a'
-- PrefixInPATH_LIBRARY='.*/Tests/RunCMake/find_library/lib/libPrefixInPATH.a'

View File

@ -40,6 +40,8 @@ run_cmake(VersionRangeConfig)
run_cmake(VersionRangeConfig2)
run_cmake(VersionRangeConfigStd)
run_cmake(VersionRangeConfigStd2)
if(UNIX)
if(UNIX
AND NOT MSYS # FIXME: This works on CYGWIN but not on MSYS
)
run_cmake(SetFoundResolved)
endif()

View File

@ -0,0 +1,9 @@
-- PATH_IN_ENV_PATH='PATH_IN_ENV_PATH-NOTFOUND'
-- PATH_IN_ENV_PATH='.*/Tests/RunCMake/find_path/include'
-- PATH_IN_ENV_PATH='.*/Tests/RunCMake/find_path/include'
-- PATH_IN_ENV_PATH='PATH_IN_ENV_PATH-NOTFOUND'
-- PATH_IN_ENV_PATH='PATH_IN_ENV_PATH-NOTFOUND'
-- PATH_IN_ENV_PATH='PATH_IN_ENV_PATH-NOTFOUND'
-- PATH_IN_ENV_PATH='PATH_IN_ENV_PATH-NOTFOUND'
-- PATH_IN_ENV_PATH='PATH_IN_ENV_PATH-NOTFOUND'
-- PATH_IN_ENV_PATH='PATH_IN_ENV_PATH-NOTFOUND'

View File

@ -0,0 +1,4 @@
-- PrefixInPATH_INCLUDE_DIR='PrefixInPATH_INCLUDE_DIR-NOTFOUND'
-- PrefixInPATH_INCLUDE_DIR='.*/Tests/RunCMake/find_path/include'
-- PrefixInPATH_INCLUDE_DIR='.*/Tests/RunCMake/find_path/include'
-- PrefixInPATH_INCLUDE_DIR='.*/Tests/RunCMake/find_path/include'

View File

@ -6,7 +6,7 @@ run_cmake(NamesPerDir)
run_cmake(RelAndAbsPath)
run_cmake(Required)
if(CMAKE_SYSTEM_NAME MATCHES "^(Windows|CYGWIN)$")
if(CMAKE_SYSTEM_NAME MATCHES "^(Windows|CYGWIN|MSYS)$")
run_cmake(WindowsCom)
run_cmake(WindowsExe)
else()

View File

@ -13,6 +13,21 @@ if(WIN32)
[[mylib/(lib)?lib1\.(dll\.a|lib)]]
[[mylib/(lib)?lib2\.(a|lib)]]
)
elseif(MSYS)
set(_check_files
[[lib3]]
[[lib3/liblib3\.dll\.a]]
[[lib4]]
[[lib4/msys-lib4\.dll]]
[[mybin]]
[[mybin/exe\.exe]]
[[mybin/msys-lib1\.dll]]
[[myinclude]]
[[myinclude/obj3\.h]]
[[mylib]]
[[mylib/liblib1\.dll\.a]]
[[mylib/liblib2\.a]]
)
elseif(CYGWIN)
set(_check_files
[[lib3]]

View File

@ -15,6 +15,23 @@ if(WIN32)
[[lib4]]
[[lib4/(lib)?lib4\.dll]]
)
elseif(MSYS)
set(_check_files
[[bin]]
[[bin/exe\.exe]]
[[bin/msys-lib1\.dll]]
[[include]]
[[include/obj1\.h]]
[[include/obj2\.h]]
[[include/obj3\.h]]
[[lib]]
[[lib/liblib1\.dll\.a]]
[[lib/liblib2\.a]]
[[lib3]]
[[lib3/liblib3\.dll\.a]]
[[lib4]]
[[lib4/msys-lib4\.dll]]
)
elseif(CYGWIN)
set(_check_files
[[bin]]

View File

@ -8,6 +8,16 @@ if(WIN32)
[[lib/(lib)?namelink-uns-dev\.dll]]
[[lib/(lib)?namelink-uns\.dll]]
)
elseif(MSYS)
set(_check_files
[[lib]]
[[lib/msys-namelink-none\.dll]]
[[lib/msys-namelink-same-1\.dll]]
[[lib/msys-namelink-sep-1\.dll]]
[[lib/msys-namelink-skip-1\.dll]]
[[lib/msys-namelink-uns-1\.dll]]
[[lib/msys-namelink-uns-dev-1\.dll]]
)
elseif(CYGWIN)
set(_check_files
[[lib]]

View File

@ -6,6 +6,14 @@ if(WIN32)
[[lib/(lib)?namelink-sep\.dll]]
[[lib/(lib)?namelink-skip\.dll]]
)
elseif(MSYS)
set(_check_files
[[lib]]
[[lib/msys-namelink-none\.dll]]
[[lib/msys-namelink-same-1\.dll]]
[[lib/msys-namelink-sep-1\.dll]]
[[lib/msys-namelink-skip-1\.dll]]
)
elseif(CYGWIN)
set(_check_files
[[lib]]

View File

@ -4,6 +4,12 @@ if(WIN32)
[[lib/(lib)?namelink-uns-dev\.dll]]
[[lib/(lib)?namelink-uns\.dll]]
)
elseif(MSYS)
set(_check_files
[[lib]]
[[lib/msys-namelink-uns-1\.dll]]
[[lib/msys-namelink-uns-dev-1\.dll]]
)
elseif(CYGWIN)
set(_check_files
[[lib]]

View File

@ -4,6 +4,8 @@ if(WIN32)
set(test45 [[bin/test4\.dll;bin/test4\.lib;bin/test5ar\.lib]])
check_installed("^bin;(${libtest45};${test123})|(${test123};${test45})\$")
elseif(MSYS)
check_installed([[^bin;bin/libtest4\.dll\.a;bin/libtest5ar\.a;bin/msys-test4\.dll;bin/test1out\.exe;bin/test2deb\.exe;bin/test3exc\.exe$]])
elseif(CYGWIN)
check_installed([[^bin;bin/cygtest4\.dll;bin/libtest4\.dll\.a;bin/libtest5ar\.a;bin/test1out\.exe;bin/test2deb\.exe;bin/test3exc\.exe$]])
elseif(APPLE)

View File

@ -9,6 +9,10 @@ set_source_files_properties(foo.c bar.c PROPERTIES LANGUAGE CXX)
target_link_libraries(SetLang foo)
set_target_properties(SetLang PROPERTIES LINKER_LANGUAGE CXX)
# Windows defender blocks SetLang executable (https://cygwin.com/pipermail/cygwin/2021-January/247508.html)
# Coordinate this name with 'Tests/CMakeLists.txt'.
set_target_properties(SetLang PROPERTIES OUTPUT_NAME "SetLangX")
# VS generators historically tolerated target-wide -TP flags added
# by project code, so cover that case to preserve the behavior.
if(CMAKE_GENERATOR MATCHES "^Visual Studio" AND "x${CMAKE_C_COMPILER_ID}" STREQUAL "xMSVC")

View File

@ -156,7 +156,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "OS400")
)
endif()
if(CMAKE_SYSTEM_NAME MATCHES "CYGWIN")
if(CMAKE_SYSTEM_NAME MATCHES "CYGWIN" OR CMAKE_SYSTEM_NAME MATCHES "MSYS")
list(APPEND uv_libraries
)
list(APPEND uv_headers

View File

@ -97,8 +97,17 @@ else
cmake_system_cygwin=false
fi
# Determine whether this is a MSYS environment.
if echo "${cmake_system}" | grep MSYS >/dev/null 2>&1; then
cmake_system_msys=true
cmake_doc_dir_keyword="MSYS"
cmake_man_dir_keyword="MSYS"
else
cmake_system_msys=false
fi
# Determine whether this is a MinGW environment.
if echo "${cmake_system}" | grep 'MINGW\|MSYS' >/dev/null 2>&1; then
if echo "${cmake_system}" | grep 'MINGW' >/dev/null 2>&1; then
cmake_system_mingw=true
else
cmake_system_mingw=false
@ -1071,7 +1080,7 @@ else
fi
# Add Cygwin-specific flags
if ${cmake_system_cygwin}; then
if ${cmake_system_cygwin} || ${cmake_system_msys}; then
cmake_ld_flags="${LDFLAGS} -Wl,--enable-auto-import"
fi
@ -1096,6 +1105,7 @@ cmake_toolchains=''
case "${cmake_system}" in
*AIX*) cmake_toolchains='XL GNU' ;;
*CYGWIN*) cmake_toolchains='GNU' ;;
*MSYS*) cmake_toolchains='GNU' ;;
*Darwin*) cmake_toolchains='Clang GNU' ;;
*Linux*) cmake_toolchains='GNU Clang XL PGI PathScale' ;;
*MINGW*) cmake_toolchains='GNU' ;;