Commit Graph

1784 Commits

Author SHA1 Message Date
Manu Evans
04a7cd1546 Silence warnings about arguments unknown to Clang, fixed a mistake 2015-08-02 12:34:28 +10:00
Manu Evans
eab093302c Support LLVM platform toolset for MSC; Clang in Visual Studio. 2015-08-02 12:34:27 +10:00
Manu Evans
046da71a28 Merge pull request #188 from moomalade/outputof
Chomp newlines in os.outputof()
2015-08-02 10:52:29 +10:00
Lusito
15ceabac48 fix for path.join problem when both string start with a "..", a unit test has been added 2015-08-01 21:10:02 +02:00
Tim Wharton
5ec37965a2 Improve module loadfile() error messages
Have the module package loader return the loadfile() error for file system modules,
and report the error from the calling script, rather than globals.lua.

This give marginally better errors when require()'ing modules with syntax errors.
The error will appear in the package loader list with the correct call site.

     Error: /Users/blah/premake5.lua:7: module 'wee' not found:
         no field package.preload['wee']
         load error /Users/blah/modules/wee/wee.lua:3: '=' expected near '<eof>'
	 ....
2015-08-01 04:10:15 +01:00
Tim Wharton
f8091ee53d Chomp newlines in os.outputof()
Fixes #45
2015-08-01 02:59:07 +01:00
leeonix
dd8c5f1818 Merge remote-tracking branch 'premake-src/master' 2015-08-01 09:21:57 +08:00
leeonix
ccd1790324 add cfg.debugformat ~= "c7" condition. 2015-08-01 09:17:00 +08:00
leeonix
829a76060a add cfg.debugformat ~= "c7" condition. 2015-08-01 09:15:38 +08:00
starkos
2d5fbbc7c9 Merge pull request #175 from TurkeyMan/gmake_arrays
Updated gmake actions to use function arrays
2015-07-31 17:58:29 -04:00
starkos
eaaaecf274 Merge pull request #156 from Blizzard/http-download-fixes
fix http.download
2015-07-31 17:43:55 -04:00
Jason Perkins
aa31909d1d Fix Windows build errors introduced by zip.extract() commit 2015-07-31 16:50:36 -04:00
starkos
6f2d3b9f18 Merge pull request #155 from Blizzard/unzip
add zip.extract(src, dst) method.
2015-07-31 16:31:17 -04:00
starkos
236dd35f62 Merge pull request #145 from Meoo/master
Fix #39, working tokens and wildcards in the same path
2015-07-31 16:08:43 -04:00
Tom van Dijck
21f4046793 Buffered I/O, and only write generated file if it changed. 2015-07-31 09:28:51 -07:00
Tom van Dijck
6223513122 Fully bake solution configs. 2015-07-30 18:27:59 -07:00
Tom van Dijck
aee6c98586 Allow calling code to save and restore a filter 2015-07-30 18:11:13 -07:00
Tom van Dijck
32885d1673 Files can now be queried for configuration properties. 2015-07-30 18:11:00 -07:00
Manu Evans
96848b28f1 Merge pull request #180 from starkos/rename-solution-to-workspace
Begin renaming solution to workspace
2015-07-31 09:31:38 +10:00
starkos
8ee9529315 Merge pull request #161 from Blizzard/entrypoint-api
add 'entrypoint' API.
2015-07-30 18:54:57 -04:00
starkos
50d89a1c00 Merge pull request #168 from TurkeyMan/more_sse
Added some missing SSE versions that I've wanted a few times
2015-07-30 15:49:17 -04:00
Jason Perkins
9926ba7738 Add workspace symbol ("wks") to token expansion environments
This lets you replace a token like "%{sln.name}" with "%{wks.name}". The "sln" is still supported.
2015-07-30 15:39:26 -04:00
Jason Perkins
91220c7d71 Replace "wrk" with "wks" 2015-07-30 15:30:41 -04:00
Jason Perkins
a82466c6f4 Rename solution.lua to workspace.lua and change names internally 2015-07-29 15:45:27 -04:00
Jason Perkins
f5e27d1e6d Change action callbacks from "solution" to "workspace" 2015-07-29 15:40:20 -04:00
starkos
1b2f19fa87 Merge pull request #177 from TurkeyMan/gcc_prefix
Fixed GCC prefix, which was all messed up somehow
2015-07-28 19:47:47 -04:00
Jason Perkins
2db9ed2061 Change solution() to workspace() with minimum changes 2015-07-28 19:08:28 -04:00
Jason Perkins
e84cc11412 Add ability to safely alias function names without breaking overrides
Introduces new calls premake.alias() and premake.resolveAlias()
2015-07-28 17:20:13 -04:00
Manu Evans
c4a70b0af3 Fixed GCC prefix, which was all messed up somehow 2015-07-28 22:27:58 +10:00
Tom van Dijck
b9402b0e67 add 'entrypoint' API. 2015-07-27 10:30:51 -07:00
Manu Evans
bade299f6b Updated gmake actions to use function arrays
- Updated gmake action in the D module aswell
2015-07-27 23:14:32 +10:00
Manu Evans
2706449670 Merge pull request #172 from starkos/fix-project-type-validation
Move project language and kind checks to validation.lua
2015-07-27 20:44:03 +10:00
Jason Perkins
bfc67b5c51 Add capture support to UTF8 BOM output
If `io.utf8()` is called while running unit tests, it would be output directly to the console since there is no active file output while testing. Replace call with premake.utf8() as a companion to premake.w() and ignore while capturing to prevent this spurious output.
2015-07-27 20:14:48 +10:00
Jason Perkins
e4f2dd7639 Move project language and kind checks to validation.lua
These validation checks were added to oven.lua by a previous commit. Move them over to validation.lua with the rest of the validation logic.
2015-07-26 18:31:08 -04:00
Manu Evans
fa02da93c6 Updated extensions to modern style, added a heap of tests 2015-07-26 23:53:24 +10:00
Manu Evans
da385c897b Added some missing SSE versions that I've wanted a few times. 2015-07-25 15:11:57 +10:00
leeonix
ac5dd3cfce if flags has Symbols. change .pdb file name. 2015-07-22 13:10:22 +08:00
leeonix
c90fe7a064 rename .pdb file name as $(TargetName). 2015-07-22 12:47:11 +08:00
Manu Evans
1c27cca3f2 Merge pull request #131 from tbasnoopy/localdebuggertype
allow changing of local debugger type
2015-07-20 20:36:00 +10:00
starkos
a2d7160bb7 Merge pull request #153 from Blizzard/added-table-functions
Add table.insertsorted, table.unique, table.filter and table.insertkeyed
2015-07-19 14:22:15 -04:00
starkos
a66aae1057 Merge pull request #152 from Blizzard/detoken-fix
fix bug in detoken.
2015-07-19 14:21:44 -04:00
starkos
072c4581b9 Merge pull request #81 from Blizzard/validate_options
add validation of valid_kinds and valid_languages
2015-07-19 13:54:52 -04:00
leeonix
f5931345c3 rename .pdb file name as targetname. 2015-07-19 03:45:15 +08:00
Jason Perkins
d2452f23e9 Use m.element() consistently; precursor to enabling more per-file configuration settings 2015-07-15 16:52:57 -04:00
Jason Perkins
d7525cf1d9 Replace "premake." with "p." consistently 2015-07-15 16:52:56 -04:00
Jason Perkins
de7b6e001d Code cleanup; finish converting to new indentation-aware output APIs 2015-07-15 16:52:56 -04:00
Jason Perkins
6be595f126 Consolidate file handling in VC 2010 exporter 2015-07-15 16:52:56 -04:00
Jason Perkins
f94c5aee15 Convert custom build files export to call array 2015-07-15 16:52:56 -04:00
Jason Perkins
59644e42fb Convert VC 2010 file configurations export to call array; bit of cleanup 2015-07-15 16:52:56 -04:00
Jason Perkins
b323613cdf Enable rules for later version of Visual Studio 2015-07-15 12:20:06 -04:00
Jason Perkins
6d6fe29dcf Stop generating rules and solutions when they have been marked as external 2015-07-15 12:19:46 -04:00
Tom van Dijck
26008f0bed both key and value need to be expanded for tables. 2015-07-14 15:12:52 -07:00
Tom van Dijck
da6009f128 some compile fixes. 2015-07-14 14:11:10 -07:00
Tom van Dijck
bb0f16f206 fix http.download 2015-07-14 11:37:07 -07:00
Tom van Dijck
bcba1a2e39 allow os.mkdir to recursively create a folder path. 2015-07-14 11:35:52 -07:00
Tom van Dijck
600ecf4cbd add zip_extract(src, dst) method. 2015-07-14 10:24:09 -07:00
Tom van Dijck
58b60aa232 Add table.insertsorted, table.unique, table.filter and table.insertkeyed 2015-07-14 09:37:16 -07:00
Tom van Dijck
92b704ed96 fix bug in detoken. 2015-07-14 09:34:40 -07:00
Tom van Dijck
9a4e49efcc use premake.warn instead of printf, and fix the visual studio action warnings. 2015-07-14 09:31:31 -07:00
Tom van Dijck
53e4145765 add nil check, remove 'self' as argument, just get it through action.current() 2015-07-14 09:31:31 -07:00
Tom van Dijck
7ce257badc add validation of valid_kinds and valid_languages 2015-07-14 09:31:31 -07:00
starkos
90857e578d Merge pull request #115 from dcourtois/fix_token_backslashes
fixed a crash when a token contains non-escaped backslashes
2015-07-12 17:17:17 -04:00
starkos
52eeed6a0b Merge pull request #146 from starkos/solution-hasproject
Add new convenience function solution.hasProject()
2015-07-12 16:52:30 -04:00
starkos
3663909c35 Merge pull request #43 from Blizzard/contrib-libs
adding contrib libs (curl, zlib and libzip)
2015-07-12 16:51:24 -04:00
Jason Perkins
acbf81112e Add new convenience function solution.hasProject() to check existings of projects meeting particular criteria
This is a companion function to project.hasConfig() and works the same way. I also implemented a generic container.hasChild() for reuse by other container types
2015-07-09 19:23:07 -04:00
Bastien Brunnenstein
66cd87153e Fix a bug in detoken, returning nil when the value is not a string 2015-07-09 18:20:37 +02:00
Tom van Dijck
1eaeed4800 fix targetdir default. 2015-07-09 15:06:33 +02:00
Jason Perkins
349c6f891c Add link time optimization support for GCC and Clang 2015-07-09 15:06:32 +02:00
rhuvendiek
54cefc08ef Write entries to compile idl files with MIDL into vcxproj-files. 2015-07-09 15:06:29 +02:00
Jason Perkins
a76e18f50c Fix preloading of embedded modules
os.locate() wasn't able to find the embedded scripts; added an explicit check after scanning the file system
2015-07-09 15:06:24 +02:00
tbasnoopy
0fff5bb036 add customtoolnamespace 2015-07-09 15:06:23 +02:00
leeonix
91ec1f2f4f modify gmake Makefile LINKCMD $(TARGET) to "$@" issue #125 2015-07-09 15:06:18 +02:00
Jason Perkins
7101edc54d Add more informative deprecation warnings for NoExceptions and NoRTTI flags 2015-07-09 15:06:15 +02:00
Jason Perkins
9f68132f53 Deprecate SEH flag; add value to exceptionhandling() 2015-07-09 15:06:14 +02:00
Jason Perkins
4dc9745363 Fix mapping of exception handler and rtti values in tool adapters 2015-07-09 15:06:08 +02:00
Jason Perkins
bd2b887367 Add optional versions argument to require() 2015-07-09 15:06:03 +02:00
Jason Perkins
c3c288a139 Add a version comparison call with tests 2015-07-09 15:05:59 +02:00
Tom van Dijck
8574e25f9d Update vs2010_vcxproj.lua 2015-07-09 15:05:56 +02:00
Tom van Dijck
d3f9a18ff4 Update _premake_init.lua 2015-07-09 15:05:55 +02:00
Jason Perkins
89eb297f24 Embedded modules should now return "should load" test function from their _preload.lua script
Each _preload.lua should end by returning a function of the form `function (cfg) … end`, which should itself return true if the module is required by the provided configuration. For the D language module, this might look like `return function (cfg) return cfg.language == "D" end`
2015-07-09 15:05:53 +02:00
Tom van Dijck
0432d192e4 convert exceptionhandling, rtti and editandcontinue flags from boolean to "tri-states". 2015-07-09 15:05:50 +02:00
Tom van Dijck
046abc1331 add new exceptionhandling and rtti API's, deprecate the corresponding flags. 2015-07-09 15:05:47 +02:00
Gabi Davar
7de66f1199 Add file.directory token
Useful for buildrules which require the directory of the file separate from its basename (protobuf 2.x).
Example:

``` lua

       -- One or more commands to run (required)
       protobuf_base = path.getabsolute(path.join(os.getcwd(), 'Third-Party/nanopb'))

       buildcommands {
            protobuf_base .. '/bin/protoc.exe -o%{cfg.objdir}/%{file.basename}.pb --proto_path=%{file.directory} %{file.abspath}',
```
2015-07-09 15:05:40 +02:00
Tom van Dijck
155dbe48bb adding table.filterempty to vstudio.path 2015-07-09 15:05:38 +02:00
Tom van Dijck
b874b79597 filter out /./ in path.join and path.normalize 2015-07-09 15:05:33 +02:00
Tom van Dijck
812d374a87 add inlining API. 2015-07-09 15:05:31 +02:00
Bastien Brunnenstein
75eb183296 Fix #39, working tokens and wildcards in the same path
Add a "translate" accessor to field kinds, allowing to perform a custom
processing (after detoken has happened)
Detoken is now applied to the "remove" elements
Detoken and translate are now performed in configset.fetch
2015-07-08 17:26:14 +02:00
Damien Courtois
b228a68919 fixed incorrect backslashes escaping outside of tokens 2015-07-07 14:43:31 +02:00
starkos
9e1b733e78 Merge pull request #138 from Blizzard/targetdir-default-fix
fix targetdir default.
2015-07-05 12:30:36 -04:00
starkos
080c78455a Merge pull request #130 from tbasnoopy/customtoolnamespace
add customtoolnamespace
2015-07-05 12:23:18 -04:00
starkos
e04c4292ac Merge pull request #103 from Blizzard/inline
add inlining API.
2015-07-05 12:21:53 -04:00
starkos
b3639127cc Merge pull request #137 from starkos/lto-support
Add link time optimization support for GCC and Clang
2015-07-01 16:27:53 -04:00
Tom van Dijck
c3d9ca6c89 fix targetdir default. 2015-06-30 15:02:52 -07:00
Jason Perkins
d0e6042406 Add link time optimization support for GCC and Clang 2015-06-30 16:20:10 -04:00
rhuvendiek
94374e496b Write entries to compile idl files with MIDL into vcxproj-files. 2015-06-29 13:56:15 +02:00
Manu Evans
3cdfaa705b Merge pull request #132 from starkos/fix-preloading
Fix preloading of embedded modules
2015-06-26 10:47:17 +10:00
starkos
5ce2bc0a7b Merge pull request #127 from starkos/exception-rtti-fixes
Finish switching to exceptionhandling() and rtti()
2015-06-25 15:35:05 -04:00
Jason Perkins
6a66587079 Fix preloading of embedded modules
os.locate() wasn't able to find the embedded scripts; added an explicit check after scanning the file system
2015-06-25 14:18:14 -04:00
tbasnoopy
26326835c9 add customtoolnamespace 2015-06-25 11:34:46 +02:00
tbasnoopy
c9147296ce allow changing of local debugger type 2015-06-25 11:30:48 +02:00
leeonix
a01225a90a modify gmake Makefile LINKCMD $(TARGET) to "$@" issue #125 2015-06-25 07:03:10 +08:00
Jason Perkins
e22834a220 Add more informative deprecation warnings for NoExceptions and NoRTTI flags 2015-06-23 19:06:25 -04:00
Jason Perkins
f59651f3f6 Deprecate SEH flag; add value to exceptionhandling() 2015-06-23 19:03:28 -04:00
Jason Perkins
d35a5f5ebf Fix mapping of exception handler and rtti values in tool adapters 2015-06-23 16:52:17 -04:00
Jason Perkins
5d98731c65 Add optional versions argument to require() 2015-06-22 15:35:20 -04:00
Jason Perkins
bc55dc5796 Add a version comparison call with tests 2015-06-22 14:48:26 -04:00
Tom van Dijck
59bd1c10b0 Update vs2010_vcxproj.lua 2015-06-22 08:25:18 -07:00
Tom van Dijck
ca049404cc Update _premake_init.lua 2015-06-22 08:24:42 -07:00
starkos
41dec88056 Merge pull request #114 from mindw/add_get_directory
Add file.directory token
2015-06-21 19:31:12 -04:00
starkos
d1a74ecf76 Merge pull request #106 from Blizzard/filterempty
adding table.filterempty to vstudio.path
2015-06-21 19:30:57 -04:00
starkos
0280d44efd Merge pull request #104 from Blizzard/normalize-fix
filter out /./ in path.join and path.normalize
2015-06-21 19:30:45 -04:00
starkos
fe1f9b4531 Merge pull request #102 from Blizzard/exceptionhandling
add new exceptionhandling and rtti API's, deprecate the corresponding flags.
2015-06-21 19:28:27 -04:00
Jason Perkins
3714abefde Embedded modules should now return "should load" test function from their _preload.lua script
Each _preload.lua should end by returning a function of the form `function (cfg) … end`, which should itself return true if the module is required by the provided configuration. For the D language module, this might look like `return function (cfg) return cfg.language == "D" end`
2015-06-17 15:48:47 -04:00
Tom van Dijck
8d0b2565b5 convert exceptionhandling, rtti and editandcontinue flags from boolean to "tri-states". 2015-06-16 08:44:18 -07:00
Tom van Dijck
307e04ed88 add new exceptionhandling and rtti API's, deprecate the corresponding flags. 2015-06-16 08:25:39 -07:00
Damien Courtois
f5d7ef1a5b fixed a crash when a token contains non-escaped backslashes, and added a unit test 2015-06-15 18:15:03 +02:00
Gabi Davar
eace6d5d59 Add file.directory token
Useful for buildrules which require the directory of the file separate from its basename (protobuf 2.x).
Example:

``` lua

       -- One or more commands to run (required)
       protobuf_base = path.getabsolute(path.join(os.getcwd(), 'Third-Party/nanopb'))

       buildcommands {
            protobuf_base .. '/bin/protoc.exe -o%{cfg.objdir}/%{file.basename}.pb --proto_path=%{file.directory} %{file.abspath}',
```
2015-06-14 10:18:43 +03:00
Jason Perkins
26333a3b7b Fix issue #107: map "Win32" to the x86 architecture for Visual Studio projects 2015-06-13 15:54:19 -04:00
starkos
7983320ec6 Merge pull request #112 from starkos/deterministic-flag-maps
Make application of flag mappings deterministic (and potentially prioritized)
2015-06-13 15:09:54 -04:00
starkos
a1af0f02ce Merge pull request #110 from moomalade/bootstrap
Bootstrap Makefile
2015-06-13 13:47:30 -04:00
Manu Evans
2851751963 Merge pull request #99 from moomalade/make_cc_override
Enable Makefile environment overrides for CC,CXX and AR.
2015-06-13 10:43:04 +10:00
Jason Perkins
575ca32f5f Make application of flag mappings deterministic (and potentially prioritized) 2015-06-12 18:12:27 -04:00
Tim Wharton
42b3ca2c51 Add bootstrap Makefile create premake initial executable
On a fresh clone, Bootstrap.mak can be used to prepare the initial premake executable on Windows, OSX and Linux.
2015-06-11 19:26:59 +01:00
Tom van Dijck
678616b068 fix for /O2 not liking /RTC1 2015-06-10 16:32:09 -07:00
Tom van Dijck
cf4d189368 adding table.filterempty to vstudio.path 2015-06-08 11:48:02 -07:00
Tom van Dijck
c3c2045d92 filter out /./ in path.join and path.normalize 2015-06-08 11:08:08 -07:00
Tom van Dijck
962f1e5a2d add inlining API. 2015-06-08 11:06:18 -07:00
Tim Wharton
45401aa57b Enable Makefile environment overrides for CC,CXX and AR.
Check if CC, CXX or AR are their default values before assigning them their premake defaults.
If they are not at their default values, they have been overriden in the environment and we should leave them alone.

Overriding toolchains from the command line is useful when swapping between compilers.
For example: `CC=gcc-4.8.1 make -C build`
2015-06-08 04:46:16 +01:00
starkos
65a69d6546 Merge pull request #97 from moomalade/calling_convention
Add Visual Studio calling convention support
2015-06-07 08:56:42 -04:00
starkos
4638c266a6 Merge pull request #84 from Blizzard/solution-filter
add "system" to the filter for solutions, so we can do system specific solution configurations.
2015-06-07 08:55:48 -04:00
Tim Wharton
957195fcc3 Fix typo in support for 'category' option field 2015-06-06 04:47:49 +01:00
Tim Wharton
fbd2d5d707 Add Visual Studio calling convention support
Add callingconvention directive, possible values are: Cdecl, FastCall, StdCall or VectorCall.
2015-06-06 04:44:04 +01:00
Manu Evans
7965886fb0 Update D submodule reference (fixes _preload.lua not working like I thought). 2015-06-04 23:47:55 +10:00
Tom van Dijck
983a4e530b add "system" to the filter for solutions, so we can do system specific solution configurations. 2015-05-26 10:09:50 -07:00
starkos
01abeaa99e Merge pull request #82 from Blizzard/option-defaults-and-categories
add option default and category support.
2015-05-25 19:43:20 -04:00
starkos
b23fcc0e2b Merge pull request #12 from Blizzard/pr6
/O2 is incompatible with /RTC1
2015-05-25 19:42:29 -04:00
starkos
5d66d7695f Merge pull request #79 from starkos/remove-extra-list-sorts
Restore ordering of include file search paths
2015-05-21 08:01:34 -04:00
Tom van Dijck
74978881fa add option default and category support. 2015-05-20 17:25:18 -07:00
Jason Perkins
aafdc11626 Prevent environment variables from being trimmed out by ".." sequences in path.join() 2015-05-20 18:15:41 -04:00
Jason Perkins
24f232ce13 Restore ordering of include file search paths 2015-05-20 17:09:48 -04:00
starkos
d16b2f952f Merge pull request #76 from starkos/vstudio-system-includes
Add system include and library search paths
2015-05-20 16:20:03 -04:00
Manu Evans
e095efe21c Merge pull request #70 from Blizzard/path-join-optimize
Performance improvement by handling edge .. directories during path join
2015-05-20 11:55:39 +10:00
Jason Perkins
4d708b2580 Add sysincludedir() support to makefiles 2015-05-19 15:56:37 -04:00
Jason Perkins
304c091431 Merge remote-tracking branch 'origin/master' into vstudio-system-includes 2015-05-19 15:55:47 -04:00
Jason Perkins
c83634c105 Add support for sysincludedirs() and syslibdirs() to GCC, Clang, and MSC adapters 2015-05-19 15:55:11 -04:00
Jason Perkins
7d586a6b02 Bit of cleanup on GCC tool adapter 2015-05-19 14:13:15 -04:00
Tom van Dijck
f994bcf448 fix architecture. 2015-05-18 18:16:58 -07:00
Tom van Dijck
6f20d21328 performance improvement by handling edge .. directories during path join 2015-05-18 18:08:36 -07:00
tdijck
588a1567bf /O2 is incompatible with /RTC1 2015-05-18 08:35:34 -07:00
Jason Perkins
7eb03dfa27 Add syslibdirs and VC 2010+ implementation 2015-05-17 17:53:55 -04:00