Skip to content

Commit

Permalink
Add CMake check for VS dev command prompt (#388)
Browse files Browse the repository at this point in the history
  • Loading branch information
tristanlabelle authored Dec 4, 2024
1 parent 38284d7 commit 5775f8a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ cmake_minimum_required(VERSION 3.21.0)

project(SwiftWinRT LANGUAGES C Swift)

if("$ENV{WindowsSDKVersion}" STREQUAL "" OR "$ENV{VSCMD_ARG_TGT_ARCH}" STREQUAL "")
message(FATAL_ERROR "The CMake build requires the environment from a Visual Studio Developer Command Prompt.")
endif()

if("${CMAKE_EXPORT_COMPILE_COMMANDS}" STREQUAL "")
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
endif()
Expand Down

0 comments on commit 5775f8a

Please sign in to comment.