CMake: Update a sanity check
authorGerald Combs <gerald@wireshark.org>
Sun, 11 Jun 2023 23:31:38 +0000 (16:31 -0700)
committerGerald Combs <gerald@wireshark.org>
Sun, 11 Jun 2023 23:31:50 +0000 (16:31 -0700)
CMakeLists.txt

index 2b8e548aa68ee59e0f93b8d64cb84e84081250de..74167a33eb619e2a783a63605fcc53d6d0bd7ea9 100644 (file)
@@ -165,16 +165,12 @@ if(WIN32)
        endif()
 
        # Sanity check
-       if(MSVC)
-               if(DEFINED ENV{PLATFORM})
-                       string(TOLOWER $ENV{PLATFORM} _vs_platform)
-               else()
-                       set(_vs_platform "[undefined]") # x86
-               endif()
+       if(MSVC AND DEFINED ENV{PLATFORM})
+               string(TOLOWER $ENV{PLATFORM} _vs_platform)
                if(
                        (_vs_platform STREQUAL "x64" AND NOT WIRESHARK_TARGET_PLATFORM STREQUAL "x64")
                        OR
-                       (_vs_platform STREQUAL "[undefined]" AND NOT WIRESHARK_TARGET_PLATFORM STREQUAL "win32")
+                       (_vs_platform STREQUAL "arm64" AND NOT WIRESHARK_TARGET_PLATFORM STREQUAL "arm64")
                )
                        message(FATAL_ERROR "The PLATFORM environment variable (${_vs_platform})"
                                " doesn't match the generator platform (${WIRESHARK_TARGET_PLATFORM})")