I have been pondering this for quite a while, and the only way I can think
of doing this, while retaining the bytecompile option is to wrap the
layout.html file in a if/then statement, and checking for mobile browsers in
a model somewhere.
So your model would have a variable called is_mobile that determines if the
current request is from a mobile browser. Then your model would contain
something like this:
if is_mobile and request.extension == 'html':
request.extension = 'mobile'
Then your layout.html would contain something like this:
{{if is_mobile:}}
<!-- Your layout for mobile devices (such as the contents of
plugin_jqmobile/layout.html) goes here -->
{{else:}}
<!-- The rest of the original layout.html file (or your custom layout)
goes here -->
{{pass}}
Then you can make views regular and mobile views. Regular views having the
.html extension, and mobile views having a .mobile extension.