Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[tools] Add setup command for easier tools recompilation #1147

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .github/workflows/package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ jobs:

- name: Build Tool
run: |
cd tools/hxcpp
haxe compile.hxml
haxelib run hxcpp setup


- name: Check XCode
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,5 @@ runs:
run: haxe compile.hxml

- name: build hxcpp
working-directory: tools/hxcpp
shell: pwsh
run: haxe compile.hxml
run: haxelib run hxcpp setup
33 changes: 24 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,38 @@

hxcpp is the runtime support for the c++ backend of the [haxe](http://haxe.org/) compiler. This contains the headers, libraries and support code required to generate a fully compiled executable from haxe code.

## Installing from haxelib

# building the tools
```sh
haxelib install hxcpp
```

## Installing from git

```sh
haxelib git hxcpp https:/HaxeFoundation/hxcpp
```
REPO=$(pwd)
cd ${REPO}/tools/run
haxe compile.hxml
cd ${REPO}/tools/hxcpp
haxe compile.hxml
cd $REPO

Alternatively, if you plan on modifying hxcpp for development, you can clone manually and use `haxelib dev`:

```sh
git clone https:/HaxeFoundation/hxcpp
haxelib dev hxcpp ./hxcpp
```

# cppia
### Build the tools

You first need to build the cppia host.
When installing from git, it is necessary to build the hxcpp build tool:

```sh
haxelib run hxcpp setup
```

### cppia

You first need to build the cppia host.

```sh
REPO=$(pwd)
cd ${REPO}/project
haxe compile-cppia.hxml
Expand Down
Binary file modified run.n
100755 → 100644
Binary file not shown.
4 changes: 3 additions & 1 deletion tools/hxcpp/BuildTool.hx
Original file line number Diff line number Diff line change
Expand Up @@ -1847,6 +1847,8 @@ class BuildTool
Log.println(' ${BOLD}resize${NORMAL} #megabytes -- Only keep #megabytes MB');
Log.println(' ${BOLD}list${NORMAL} -- list cache usage');
Log.println(' ${BOLD}details${NORMAL} -- list cache usage, per file');
Log.println(' ${BOLD}haxelib run hxcpp${NORMAL} ${ITALIC}${WHITE}setup${NORMAL}');
Log.println(' Rebuild the hxcpp build tool');
Log.println('');
}

Expand Down Expand Up @@ -2348,7 +2350,7 @@ class BuildTool
{
var ver = Std.parseInt(inVersion);
if (ver>6)
Log.error("Your version of hxcpp.n is out-of-date. Please update by compiling 'haxe compile.hxml' in hxcpp/tools/hxcpp.");
Log.error("Your version of hxcpp.n is out-of-date. Please update by running 'haxelib run hxcpp setup'");
}

public function resolvePath(inPath:String)
Expand Down
9 changes: 7 additions & 2 deletions tools/run/RunMain.hx
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ class RunMain
log('This version of hxcpp ($dir) appears to be a source/developement version.');
log("Before this can be used, you need to:");
log(" 1. Rebuild the main command-line tool, this can be done with:");
log(" cd tools/hxcpp");
log(" haxe compile.hxml");
log(" haxelib run hxcpp setup");
log(" 2. FOR HXCPP API < 330:");
log(" Build the binaries appropriate to your system(s), this can be done with:");
log(" cd project");
Expand Down Expand Up @@ -87,6 +86,12 @@ class RunMain

public static function executeHxcpp()
{
if (Sys.args()[0] == "setup")
{
setup();
return true;
}

if (!sys.FileSystem.exists("./hxcpp.n"))
return false;

Expand Down