Skip to content

Compiling error on Windows when using CMake - if not MSVC compiler #2655

@mliutko

Description

@mliutko

Development Machine, OS, Compiler (and Other Relevant Toolchain Info)

Compiling by CMake on Windows 10 x64 using GCC 13.2.0

SDK Version (Please Give Commit SHA if Manually Compiling)

Latest Release (LTS_08_2024)

Protocol

N/A

Describe the Bug

If try to compile the project (which uses and depends on the azure-iot-sdk-c) on Windows but not by MSVC compiler (e.g. GCC) the next error is thrown on cmake --preset ..... command execution (does not matter Debug or Release):

CMake Error at IoTAzureClientLibC/azure-iot-sdk-c/configs/azure_iot_sdksFunctions.cmake:219 (if):
  if given arguments:
    "(" "Release" "STREQUAL" "Debug" ")" "AND" "(" "GREATER_EQUAL" "1930" ")"
  Unknown arguments specified
Call Stack (most recent call first):
  AveryIoTAzureClientLibC/azure-iot-sdk-c/provisioning_client/tests/CMakeLists.txt:8 (enable_address_sanitize)

Possible solution
For easiest fix of this error is enough to add an additional check condition for MSVC in azure-iot-sdk-c/configs/azure_iot_sdksFunctions.cmake file, e.g. replace at line 218 (currently) from if(WIN32) to if(WIN32 AND MSVC)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions