Add rules for handling rdef files

Fixes #17392
This commit is contained in:
Adrien Destugues 2021-11-11 19:19:28 +01:00
parent 7be9f17b2b
commit 81f727c2de
2 changed files with 26 additions and 3 deletions

View File

@ -1,4 +1,4 @@
## Haiku Generic Jamfile v1.0.1 ## ## Haiku Generic Jamfile v1.0.3 ##
## Fill in this file to specify the project being created, and the referenced ## Fill in this file to specify the project being created, and the referenced
## Jamfile-engine will do all of the hard work for you. This handles both ## Jamfile-engine will do all of the hard work for you. This handles both
@ -35,6 +35,9 @@ SRCS = ;
# Full path or a relative path to the resource file can be used. # Full path or a relative path to the resource file can be used.
RSRCS = ; RSRCS = ;
# Additionally specify the path of rdef files to compile and add to resources
RDEFS = ;
# Specify additional libraries to link against # Specify additional libraries to link against
# There are two acceptable forms of library specifications # There are two acceptable forms of library specifications
# - if your library follows the naming pattern of: # - if your library follows the naming pattern of:

View File

@ -1,4 +1,4 @@
## Haiku Generic Jamfile Engine v1.0.2 ## Haiku Generic Jamfile Engine v1.0.3
## Does all the hard work for the Generic Jamfile ## Does all the hard work for the Generic Jamfile
## which simply defines the project parameters. ## which simply defines the project parameters.
## Most of the real work is done in the Jambase ## Most of the real work is done in the Jambase
@ -6,7 +6,7 @@
## ##
## Inspired by the Be Makefile Engine ## Inspired by the Be Makefile Engine
## ##
## Supports Generic Jamfile v1.0.1 ## Supports Generic Jamfile v1.0.3
## ##
## Copyright (c) 2002-2010 Ryan Leavengood ## Copyright (c) 2002-2010 Ryan Leavengood
## Copyright (c) 2011 Peter Poláčik ## Copyright (c) 2011 Peter Poláčik
@ -29,6 +29,19 @@ actions AddResources
$(XRES) -o "$(<)" $(>) $(XRES) -o "$(<)" $(>)
} }
# Rc <Resource File> : <Resource definition file> ;
# Compile an rdef file into a binary resources file
rule Rc
{
Depends $(<) : $(>) ;
LOCATE on $(<) = $(LOCATE_TARGET) ;
}
actions Rc
{
rc -o "$(<)" $(>)
}
# MimeSet <Application Name> ; # MimeSet <Application Name> ;
# Sets the mime type of the given application to be an application. # Sets the mime type of the given application to be an application.
actions MimeSet actions MimeSet
@ -237,6 +250,13 @@ rule BeMain
Main $(<) : $(>) ; Main $(<) : $(>) ;
} }
if ( $(RDEFS) )
{
RSRCS += $(NAME).rsrc ;
Rc $(NAME).rsrc : $(RDEFS) ;
}
if ( $(RSRCS) ) if ( $(RSRCS) )
{ {
AddResources $(<) : $(RSRCS) ; AddResources $(<) : $(RSRCS) ;