Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing XCODE_EMIT_EFFECTIVE_PLATFORM_NAME support #3420

Open
mckelvin opened this issue Nov 2, 2023 · 1 comment
Open

Missing XCODE_EMIT_EFFECTIVE_PLATFORM_NAME support #3420

mckelvin opened this issue Nov 2, 2023 · 1 comment
Labels
bug a bug in the product Feature: debug/launch investigation needed issues needs a developer assigned to it and investigation done in order to implement a fix
Milestone

Comments

@mckelvin
Copy link

mckelvin commented Nov 2, 2023

Brief Issue Summary

Before reporting the issue, I'd like to say: The VSCode is awesome and thanks for developing the extension!

The issue will be reproduced when using the following statement in cmake files:

set_property(GLOBAL PROPERTY XCODE_EMIT_EFFECTIVE_PLATFORM_NAME ON)

Steps to reproduce:

  1. Prepare the an empty folder with the following 4 files
  2. Open the folder using VSCode on macOS
  3. CMake - Configure All Projects
  4. Run and Debug - Select Debug - Click the play button
  5. We will see launch: program '/tmp/poc/build/xcode/Debug${EFFECTIVE_PLATFORM_NAME}/demo_macos' does not exist

$ tree -a

.
├── .vscode
│   └── launch.json
├── CMakeLists.txt
├── CMakePresets.json
└── demo.cpp

$ cat .vscode/launch.json

{
  // https://github.com/microsoft/vscode-cmake-tools/blob/main/docs/debug-launch.md#debug-using-a-launchjson-file
  "version": "0.2.0",
  "configurations": [
    {
      "name": "Debug",
      "type": "cppdbg",
      "request": "launch",
      "program": "${command:cmake.launchTargetPath}",
      "stopAtEntry": false,
      "cwd": "${workspaceFolder}",
      "environment": [],
      "presentation": {
        "hidden": false,
        "group": "DebugGroup",
        "order": 2
      },
      "osx": {
        "type": "cppdbg",
        "MIMode": "lldb",
        "setupCommands": [
          {
            "description": "Enable pretty-printing for lldb",
            "text": "-enable-pretty-printing",
            "ignoreFailures": true
          }
        ],
      },
      "windows": {
        "type": "cppvsdbg",
      }
    },
  ]
}

$ cat CMakeLists.txt

if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.25")
  cmake_policy(SET CMP0142 NEW)
  set_property(GLOBAL PROPERTY XCODE_EMIT_EFFECTIVE_PLATFORM_NAME ON)
endif()

project(demo)
add_executable(demo_macos demo.cpp)

$ cat CMakePresets.json

{
    "version": 3,
    "cmakeMinimumRequired": {
        "major": 3,
        "minor": 18,
        "patch": 0
    },
    "configurePresets": [
        {
            "name": "xcode",
            "generator": "Xcode",
            "binaryDir": "${sourceDir}/build/xcode",
            "condition": {
                "type": "equals",
                "lhs": "${hostSystemName}",
                "rhs": "Darwin"
            }
        }
    ],
    "buildPresets": [
        {
            "name": "xcode-Debug",
            "displayName": "Debug",
            "configurePreset": "xcode",
            "configuration": "Debug",
            "condition": {
                "type": "equals",
                "lhs": "${hostSystemName}",
                "rhs": "Darwin"
            },
            "targets": ["demo_macos"]
        }
    ]
}

$ cat demo.cpp

#include <iostream>

int main (int argc, char *argv[])
{

	return 0;
}

CMake Tools Diagnostics

{
  "os": "darwin",
  "vscodeVersion": "1.84.0",
  "cmtVersion": "1.16.20",
  "configurations": [
    {
      "folder": "/private/tmp/poc",
      "cmakeVersion": "3.27.6",
      "configured": true,
      "generator": "Xcode",
      "usesPresets": true,
      "compilers": {}
    }
  ],
  "cpptoolsIntegration": {
    "isReady": true,
    "hasCodeModel": true,
    "activeBuildType": "Debug",
    "buildTypesSeen": [
      "Debug",
      "Release",
      "MinSizeRel",
      "RelWithDebInfo"
    ],
    "requests": [
      "file:///private/tmp/poc/demo.cpp"
    ],
    "responses": [],
    "partialMatches": [
      {
        "request": "file:///private/tmp/poc/demo.cpp",
        "matches": "/tmp/poc/demo.cpp"
      }
    ],
    "targetCount": 3,
    "executablesCount": 1,
    "librariesCount": 0,
    "targets": [
      {
        "name": "ALL_BUILD",
        "type": "UTILITY"
      },
      {
        "name": "ZERO_CHECK",
        "type": "UTILITY"
      },
      {
        "name": "demo_macos",
        "type": "EXECUTABLE"
      }
    ]
  },
  "settings": [
    {
      "communicationMode": "automatic",
      "useCMakePresets": "auto",
      "configureOnOpen": true
    }
  ]
}


### Debug Log

_No response_

### Additional Information

_No response_
@github-actions github-actions bot added the triage label Nov 2, 2023
@snehara99 snehara99 added investigation needed issues needs a developer assigned to it and investigation done in order to implement a fix and removed triage labels Nov 3, 2023
@snehara99
Copy link
Contributor

snehara99 commented Nov 3, 2023

@mckelvin thank you for your post! We'll investigate it as soon as it's possible for our team, thanks!

@snehara99 snehara99 added bug a bug in the product Feature: debug/launch labels Nov 3, 2023
@github-project-automation github-project-automation bot moved this to Needs Triaging in CMake Tools Nov 21, 2023
@github-project-automation github-project-automation bot moved this to Triage Needed in CMake Tools Nov 29, 2023
@gcampbell-msft gcampbell-msft moved this from Triage Needed to Needs Repro in CMake Tools Nov 29, 2023
@gcampbell-msft gcampbell-msft moved this from Needs Repro to Pending Prioritization in CMake Tools Nov 29, 2023
@gcampbell-msft gcampbell-msft added this to the Backlog milestone Nov 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug a bug in the product Feature: debug/launch investigation needed issues needs a developer assigned to it and investigation done in order to implement a fix
Projects
Status: Pending Prioritization
Development

No branches or pull requests

3 participants