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

vcpkg support #26

Merged
merged 2 commits into from
May 27, 2022
Merged

vcpkg support #26

merged 2 commits into from
May 27, 2022

Conversation

acidicoala
Copy link
Contributor

This PR lays the groundwork for vcpkg integration. The parts of the code that are meant to be executed only when packaged via vcpkg are put behind ASMJIT_EXTERNAL flag. The support is implemented in a manner that closely mirrors asmjit's support. I have tested this configuration with asmtk port in local vcpkg repo, and it worked flawlessly. Once those changes are merged, I will open a PR in vcpkg repo with portfiles for asmtk.

This PR would be instrumental in closing #25 and microsoft/vcpkg#24359

This PR lays the groundwork for vcpkg integration. The parts of the code that are meant to be executed only when packaged via vcpkg are put behind `ASMJIT_EXTERNAL` flag. The support is implemented in a manner that closely mirrors asmjit's support. I have tested this configuration with asmtk port in local vcpkg repo, and it worked flawlessly. Once those changes are merged, I will open a PR in vcpkg repo with portfiles for asmtk.

This PR would be instrumental in closing #25 and microsoft/vcpkg#24359
@stevemk14ebr
Copy link

just for tracking this is required to resolve #25

@kobalicek
Copy link
Member

Thanks, I have reviewed this and I think it's okay.

@acidicoala
Copy link
Contributor Author

Thanks, I have reviewed this and I think it's okay.

Nice. Could you tell us what is preventing this from being merged?

@acidicoala
Copy link
Contributor Author

acidicoala commented May 26, 2022

I think windows-lib build is failing because OS is specified as windows-latest while c/c++ compiler is specified as vs2019 in yaml config. The windows-latest resolves to windows-2022, which bundles vs2022 rather than vs2019. I would suggest to pin the OS version to windows-2022 and compiler to vs2022 instead.

@stevemk14ebr
Copy link

stevemk14ebr commented May 27, 2022

The specific generator can be specified via CMakeSettings.json (alongside the CMakeLists.txt). I actually just had this exact 'visual studio not found error' locally funny enough. It was caused by my CMakeSettings.json specifying to use the vs 2019 generator, while I had vs 2022 installed. Here's an example settings file for vs 2022

{
  "configurations": [
    {
      "name": "x86-Debug",
      "generator": "Visual Studio 17 2022",
      "configurationType": "Debug",
      "buildRoot": "${projectDir}\\build32",
      "cmakeCommandArgs": "",
      "buildCommandArgs": "-m -v:minimal",
      "ctestCommandArgs": "",
      "inheritEnvironments": []
    },
    {
      "name": "x86-Release",
      "generator": "Visual Studio 17 2022",
      "configurationType": "Release",
      "buildRoot": "${projectDir}\\build32",
      "cmakeCommandArgs": "",
      "buildCommandArgs": "-m -v:minimal",
      "ctestCommandArgs": "",
      "inheritEnvironments": []
    },
    {
      "name": "x86-ReleaseWithDebInfo",
      "generator": "Visual Studio 17 2022",
      "configurationType": "RelWithDebInfo",
      "buildRoot": "${projectDir}\\build32",
      "cmakeCommandArgs": "",
      "buildCommandArgs": "-m -v:minimal",
      "ctestCommandArgs": "",
      "inheritEnvironments": []
    },
    {
      "name": "x64-Debug",
      "generator": "Visual Studio 17 2022 Win64",
      "configurationType": "Debug",
      "buildRoot": "${projectDir}\\build64",
      "cmakeCommandArgs": "",
      "buildCommandArgs": "-m -v:minimal",
      "ctestCommandArgs": "",
      "inheritEnvironments": []
    },
    {
      "name": "x64-Release",
      "generator": "Visual Studio 17 2022 Win64",
      "configurationType": "Release",
      "buildRoot": "${projectDir}\\build64",
      "cmakeCommandArgs": "",
      "buildCommandArgs": "-m -v:minimal",
      "ctestCommandArgs": "",
      "inheritEnvironments": []
    },
    {
      "name": "x64-ReleaseWithDebInfo",
      "generator": "Visual Studio 17 2022 Win64",
      "configurationType": "RelWithDebInfo",
      "buildRoot": "${projectDir}\\build64",
      "cmakeCommandArgs": "",
      "buildCommandArgs": "-m -v:minimal",
      "ctestCommandArgs": "",
      "inheritEnvironments": []
    }
  ]
}

@acidicoala
Copy link
Contributor Author

I think the faulty compiler configuration is specified in the CI config:

- { title: "windows-lib" , os: "windows-latest", cc: "vs2019" , arch: "x86", build_type: "Debug" , defs: "ASMJIT_DIR=../asmjit", problem_matcher: "cpp" }

@kobalicek kobalicek merged commit 648bc8a into asmjit:master May 27, 2022
@kobalicek
Copy link
Member

Thanks! I will fix the CI later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants