vcpkg/scripts/detect_compiler/CMakeLists.txt
Francois Rivard 741c8cbecd
[vcpkg] Add compiler info to nuspec description (#13571)
* Add compiler info to nuspec description

* Run clang-format on some files

* Fix the unit tests

* [vcpkg] Clarify NuGet description to note 'CXX compiler'

* [vcpkg] Fix tests

Co-authored-by: frivard <frivard@coveo.com>
Co-authored-by: Robert Schumacher <roschuma@microsoft.com>
2020-09-27 18:18:27 -07:00

22 lines
688 B
CMake

cmake_minimum_required(VERSION 3.10)
project(detect_compiler NONE)
if(CMAKE_GENERATOR STREQUAL "Ninja" AND CMAKE_SYSTEM_NAME STREQUAL "Windows")
set(CMAKE_C_COMPILER_WORKS 1)
set(CMAKE_C_COMPILER_ID_RUN 1)
set(CMAKE_C_COMPILER_FORCED 1)
set(CMAKE_CXX_COMPILER_WORKS 1)
set(CMAKE_CXX_COMPILER_FORCED 1)
endif()
enable_language(C)
enable_language(CXX)
file(SHA1 "${CMAKE_CXX_COMPILER}" CXX_HASH)
file(SHA1 "${CMAKE_C_COMPILER}" C_HASH)
string(SHA1 COMPILER_HASH "${C_HASH}${CXX_HASH}")
message("#COMPILER_HASH#${COMPILER_HASH}")
message("#COMPILER_CXX_VERSION#${CMAKE_CXX_COMPILER_VERSION}")
message("#COMPILER_CXX_ID#${CMAKE_CXX_COMPILER_ID}")