First have a look at the flex-config.xml
file. You'll find it in [flex_sdk_path]/frameworks/flex-config.xml
. Now find the nodes called runtime-shared-library-path
. Here you'll find a list of all the libraries that will be merged when you compile with compc (the nodes are called runtime-shared-library-path
because RSL is the default linkage when you use mxmlc). These are the files that you need to link externally.
You have two options to do this:
- Create your own config file in which you translate all those
runtime-shared-library-path
nodes to external-library-path
nodes. Load this file instead of the default by adding -load-config=my-config.xml
to the compiler command.
- Keep the default config file but override the linkage with command options. Simply add each swc to the external-library-path:
-external-library-path+=libs/framework.swc
and so forth.
When you compile an application with mxmlc though, the default linkage is RSL. You may want to override this too and make it 'merged'. In this case you'll first have to reset the RSL path: -runtime-shared-library-path=
(that's right, nothing after the =
). Then add each swc to the -library-path: -library-path+=libs/framework.swc
Alternatively (warning! shameless self-promotion on the way), you could use a build tool called GradleFx. If you create a build file with just this line:
type = 'swc'
it will compile your library with the framework linked externally. You can override this default if the need be:
type = 'swc'
frameworkLinkage = 'merged'