Skip to content

[Cmake] compile with MSVC #10

@PierreChatelier

Description

@PierreChatelier

version 0.2.0

I was able to compile with Visual Studio 2019 and 2022, but there was a lot of tricks.
Some of them could be addressed in the CMake.
Here is a list of what I had to do in the projects generated by CMake

  • install vcpkg to get dirent and pthread implementations
  • remove every linker flag trying to link with m.lib
  • remove additional flags -Wall -Wpedantic...
  • manually define R_OK
  • define attribute() as an empty macro
  • use -D__thread=__declspec(thread)
  • even with experimental flags and changing the ISO, stdatomic could not be found. So I compiled t_ops.c as C++ (wrapping code extern "C") to #include the C++ and declare a C interface to atomics with it
  • manually define CLOCK_MONOTONIC and implement some clock_gettime()
  • comment out the #include <unistd.h>

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