Skip to content

Commit 3d4a5dd

Browse files
authored
recommend compiling as a package in readme rather than source file (#60)
1 parent 3a17f5c commit 3d4a5dd

File tree

2 files changed

+9
-14
lines changed

2 files changed

+9
-14
lines changed

README.md

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -35,42 +35,39 @@ compile an executable and produce a self-contained bundle in `build/`:
3535
```bash
3636
juliac \
3737
--output-exe app_test_exe \
38-
--project test/AppProject\
3938
--bundle build \
4039
--trim=safe \
4140
--experimental \
42-
--verbose \
43-
test/AppProject/src/test.jl
41+
test/AppProject
4442
```
4543

4644
Notes:
4745
- `--trim[=mode]` enables removing unreachable code; on 1.12 prereleases this implies `--experimental`.
4846
- Define `function @main(args::Vector{String})` in your package or source file to build an executable.
47+
- For simple scripts, a source file may be specified instead of a package directory, but this is not recommended.
4948

50-
### Quick start (module, no app install)
49+
### Quick start (without app install)
5150

5251
```bash
5352
julia --project -e "using JuliaC; JuliaC.main(ARGS)" -- \
5453
--output-exe app_test_exe \
55-
--project test/AppProject \
5654
--bundle build \
5755
--trim=safe \
5856
--experimental \
59-
--verbose \
60-
test/AppProject/src/test.jl
57+
test/AppProject
6158
```
6259

6360
### CLI reference
6461

6562
- `--output-exe <name>`: Output native executable name (no path). Use `--bundle` to choose destination directory.
6663
- `--output-lib|--output-sysimage|--output-o|--output-bc <path>`: Output path for non-executable artifacts.
67-
- `--project <path>`: App project to instantiate/precompile (defaults to active project).
64+
- `--project <path>`: Project to instantiate/precompile (defaults to active project).
6865
- `--bundle <dir>`: Copy required Julia libs/stdlibs and artifacts next to the output; also sets a relative rpath.
69-
- `--trim[=mode]`: Enable IR/metadata trimming (e.g. `--trim=safe`). Use `--trim=no` to disable.
66+
- `--trim[=mode]`: Enable code trimming (e.g. `--trim=safe`). Use `--trim=no` to disable.
7067
- `--compile-ccallable`: Export `ccallable` entrypoints (see C-callable section).
7168
- `--experimental`: Forwarded to Julia; required for `--trim` on some builds.
7269
- `--verbose`: Print underlying commands and timing.
73-
- `<file>`: The Julia entry file to compile (must define `@main` for executables).
70+
- `<file>`: The Julia entry file or package to compile (must define `@main` for executables).
7471

7572
### Library API
7673

@@ -79,8 +76,7 @@ using JuliaC
7976

8077
img = ImageRecipe(
8178
output_type = "--output-exe",
82-
file = "test/AppProject/src/test.jl",
83-
project = "test/AppProject",
79+
file = "test/AppProject",
8480
trim_mode = "safe",
8581
add_ccallables = false,
8682
verbose = true,

test/cli.jl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,8 @@ end
1111
exename = "app"
1212
cliargs = String[
1313
"--output-exe", exename,
14-
"--project", TEST_PROJ,
1514
"--trim=safe",
16-
TEST_SRC,
15+
TEST_PROJ,
1716
"--bundle", outdir,
1817
"--verbose",
1918
]

0 commit comments

Comments
 (0)