7

I am trying to set up some sort of a nightly build environment that would compile both a x64 and x86 version of a PHP DLL extension.

I have followed this guide to set up the environment and build the extension and it works fine.

At the moment I have two virtual machines, one with x86 and one with x64 versions of Windows (XP and 7).

Is there a way to build both DLLs (32 and 64 bit) in the same virtual machine (I presume this would be the Windows 7 one) using a batch file?

My goal is to set a nightly build "server" but also be able to compile DLLs with the push of a button.

Thanks for any pointers.

The machines that compile the DLLs have Visual Studio 2008 Express and Windows SDK 6 (for the x86) and 7 (for the x64)

Nikolaos Dimopoulos
  • 11,495
  • 6
  • 39
  • 67
  • x86 compilers should have flags to specify what cpu(s) to target for the compilation, but you don't mention which compiler, so... – Marc B Oct 20 '12 at 13:42
  • From the guide that I linked it just says, use: `setenv /x86 /xp /release` and then setup your build environment and run `nmake`. Similarly it will be /x64 for the 64 bit one. – Nikolaos Dimopoulos Oct 20 '12 at 13:47

2 Answers2

1

In Visual Studio under project properties you fill find Build tab. Clicking on Build tab will show you a dropdown with label Platform target. You can set it to x86 and give it a try. If that fails then you may try with the other option Any CPU..

000
  • 3,976
  • 4
  • 25
  • 39
  • Thanks for the reply but the guide I linked does not require you to launch visual studio at all. All you do is `setenv /x86 /xp /release` and then you can build the package in the relevant php version (5.4, 5.3 etc.) using the command line. The issue is that if I use a batch file, the `setenv` directive halts the batch file. Also is there a way to run a visual studio project using the command line? – Nikolaos Dimopoulos Nov 02 '12 at 16:22
  • Because I want to automate the process by running a scheduled task - hence the nightly build I mentioned in the question. – Nikolaos Dimopoulos Nov 02 '12 at 18:06
  • @NikolaosDimopoulos to automate the process, there is a dirty workaround by using AutoIt3 http://www.autoitscript.com – HamZa Nov 05 '12 at 19:54
0

There is a blog (not mine) where someone has compiled the x64 versions of older and newer PHP versions so you don't have to. It is here: http://www.anindya.com/

Coreus
  • 5,360
  • 3
  • 35
  • 50