Skip to content

Building on Windows

kylehuff edited this page Sep 1, 2011 · 1 revision

Setting up the Environment to compile on Windows

Requirements

Setting up the build environment

In order to compile the plugin, you need to compile libgpgme and libgpg-error, and crate the .lib files.

build and install libassuan

  1. Extract libassuan somewhere

  2. In the MSYS CLI, navigate to the libassuan dir and execute:

     ./configure --prefix=/mingw
     make
     make install
    

build and install libgpg-error

  1. Extract libgpg-error somewhere

  2. In the MSYS CLI, navigate to the libgpg-error dir and do

     ./configure --prefix=/mingw
     make
     make install
     mkdir lib
     cp src/.libs/libgpg-error-0.dll.def lib/libgpg-error-0.def
    
  3. For the next part, either you need to be in the standard windows CLI (cmd.exe) or in the visual studio command prompt.

    3.1 if using the Visual Studio CLI, cd to your libgpg-error directory and type:

     lib.exe /machine:i386 /def:lib\libgpg-error-0.def /out:lib\libgpg-error-0.lib
    

    3.2 if you use the standard windows CLI (cmd.exe), go to the libgpg-error directory and type:

     c:\WinDDK\7600.16385.1\bin\x86\x86\link.exe /lib /machine:i386 /def:lib\libgpg-error-0.def /out:lib\libgpg-error-0.lib
    
  4. move the file lib/libgpg-error-0.lib somewhere that the compilier can find it while building the plugin.

build and install libgpgme

  1. Extract libgpgme somewhere

  2. In the MSYS CLI, navigate to the libgpgme dir and do

     configure --prefix=/mingw
     make
     make install
     mkdir lib
     cp src/.libs/libgpgme-11.dll.def lib/libgpgme-11.def
    
  3. For the next part, either you need to be in the standard windows CLI (cmd.exe) or in the visual studio command prompt.

    3.1 if using the Visual Studio CLI, cd to your libgpg-error directory and type:

     lib.exe /machine:i386 /def:lib\libgpgme-11.def /out:lib\libgpgme-11.lib
    

    3.2 if you use the standard windows CLI (cmd.exe), go to the libgpg-error directory and type:

     c:\WinDDK\7600.16385.1\bin\x86\x86\link.exe /lib /machine:i386 /def:lib\libgpgme-11.def /out:lib\libgpgme-11.lib
    
  4. Move the file lib/libgpgme-11.lib somewhere that the compilier can find it while building the plugin.

Build the plugin

  1. Navigate to the webpg-npapi directory and execute:

    1.1 For Visual Studio 2008:

     firebreath\prep2008.cmd . build
    

    1.2 For Visual Studio 2009:

     firebreath\prep2009.cmd . build
    

    1.3 For Visual Studio 2010:

     firebreath\prep2010.cmd . build
    
  2. Navigate to the newly created build directory and execute:

     cmake --build . --config MinSizeRel --target webpgPlugin
    

The plugin is now built, and should be found in build\bin\webpgPlugin\MinSizeRel\npwebpgPlugin.dll