Giter VIP home page Giter VIP logo

Comments (3)

kwhat avatar kwhat commented on May 27, 2024 1

Also, irritatingly, installing Visual Studio doesn't update the PATH by default.

Visual Studio uses its own shell. You need to compile from the shell launched by C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Auxiliary\Build\vcvars64.bat. You can find these tool shortcuts here: C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Visual Studio 2019\Visual Studio Tools\VC. I am sure there is a reason for this like having multiple tool-chains installed at the same time. Windows is really just a pain in general, but not nearly as much of a pain as MacOS.

Processors like i3, i5, i 7 are x64 right?

Anything modern is going to be x64 (aka amd64, X86-64 or k8). Sometimes you want Win32 (aka x86 or i386) compatibility because Windows still ships a lot of 32-bit software for whatever reason. See Wow64.

What about building for Windows on ARM is that supported?

Yes, you can look at the build scripts that package artifacts for this repo here: https://github.com/kwhat/libuiohook/blob/1.2/.github/workflows/package.yml#L342 This builds everything currently supported except for BSD.

Is there any difference in the functioning / performance of libuiohook with compiling with Visual Studio vs compiling with MinGW?

Not really, a lot of work went into making sure it would compile with gcc/clang on Windows. This may not be the case moving forward, but for now its fine.

from libuiohook.

kwhat avatar kwhat commented on May 27, 2024

This is what I use to build for Windows locally:

Z:
cd Z:\IdeaProjects\JNativeHook\src\external\libuiohook

cmake -B .\build ^
  -G "Visual Studio 16 2019" -A x64 ^
  -D CMAKE_INSTALL_PREFIX=.\dist\windows\x86_64 ^
  -D CMAKE_VERBOSE_MAKEFILE=true ^
  -D USE_EPOCH_TIME=OFF ^
  -D BUILD_SHARED_LIBS=ON ^
  -D BUILD_DEMO=ON

cmake --build .\build ^
  --parallel 2 ^
  --config RelWithDebInfo

cmake --install .\build --config RelWithDebInfo

You probably need to switch out -G mingw32-make if you want to build with MinGW. See https://cmake.org/cmake/help/latest/manual/cmake-generators.7.html#manual:cmake-generators(7)

from libuiohook.

gaurav21r avatar gaurav21r commented on May 27, 2024

@kwhat Thank you for this, in the process of trying out dozens of combinations, I think I wrote this as well but probably missed out on the -A switch. Also, irritatingly, installing Visual Studio doesn't update the PATH by default. Maybe I am missing something there. I will try with MinGW and close this thread if successful. Just a few questions:

  1. Do you think it would be good if we added this to README or maybe somewhere else in the docs? Apologies if this is already there.

  2. I'm always a bit confused with the Architecture switch. Processors like i3, i5, i 7 are x64 right? AMD processors would also be x64? What about building for Windows on ARM is that supported? If so, what would be the correct value for -A then? I went through the link you gave and CMake also has a Win32 value for the -A switch. What would be the target platform then?

  3. Is there any difference in the functioning / performance of libuiohook with compiling with Visual Studio vs compiling with MinGW?

from libuiohook.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.