khoarus / rapidjson

Automatically exported from code.google.com/p/rapidjson
MIT License
0 stars 0 forks source link

premake script doesn't work on Mac OS X (at least not on Snow Leopard 10.6.8) #54

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
When premake is run on Mac OS X, it complains it can't find premake4. This is 
because the working directory always defaults to the users home directory, 
rather than the folder the script/batch file is run from.

I have tried various ways to fix this without success at the moment. I'll post 
back here if/when I find a solution. 

Original issue reported on code.google.com by keith3...@rocketmail.com on 21 Jan 2013 at 11:44

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
After some experimentation, I have found the solution. There are a few problems 
with the premake shell script:

1) It contains Carriage Return+Linefeed for line endings. This needs to be 
changed to unix line endings of just Linefeed.
2) To fix the working directory problem, you need to add the following line at 
the beginning: cd "$(dirname "$0")"
3) each of the four premake4 lines needs to be prefixed with ./ (eg. instead of 
"premake4 vs2005", it should be "./premake4 vs2005")
4) This suggestion is not necessary, but good practice - Add the following line 
at the beginning to specify which interpreter to use: #!/bin/sh

I've attached the corrected version of premake that works on Mac OS X. I would 
expect it to work on Linux/Unix as well, but if it doesn't then you'll just 
have to have different premake scripts for Mac OS X and Linux/Unix.

Original comment by keith3...@rocketmail.com on 22 Jan 2013 at 12:56

Attachments:

GoogleCodeExporter commented 8 years ago
Note: I zipped up the premake file so it keeps the executable permission.

Original comment by keith3...@rocketmail.com on 22 Jan 2013 at 12:58

GoogleCodeExporter commented 8 years ago
Partially fixed according to your advice at 
https://github.com/miloyip/rapidjson/commit/a2240e26ab504ae57534b57962b886e6eff4
ec3e

I think Premake4 should be installed in system search path.
Currently we use a CI solution and its script is 
https://github.com/miloyip/rapidjson/blob/master/.travis.yml

Original comment by milo...@gmail.com on 30 Jun 2014 at 10:28