diff --git a/.github/workflows/package.yml b/.github/workflows/package.yml index ead482b54..1c34a5324 100644 --- a/.github/workflows/package.yml +++ b/.github/workflows/package.yml @@ -29,8 +29,7 @@ jobs: - name: Build Tool run: | - cd tools/hxcpp - haxe compile.hxml + haxelib run hxcpp setup - name: Check XCode diff --git a/.github/workflows/setup/action.yml b/.github/workflows/setup/action.yml index cb170b80b..a88acec9c 100644 --- a/.github/workflows/setup/action.yml +++ b/.github/workflows/setup/action.yml @@ -30,6 +30,5 @@ runs: run: haxe compile.hxml - name: build hxcpp - working-directory: tools/hxcpp shell: pwsh - run: haxe compile.hxml \ No newline at end of file + run: haxelib run hxcpp setup diff --git a/README.md b/README.md index b20414b1e..b2b65a483 100644 --- a/README.md +++ b/README.md @@ -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://github.com/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://github.com/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 diff --git a/run.n b/run.n old mode 100755 new mode 100644 index 2153e3e71..b5daab169 Binary files a/run.n and b/run.n differ diff --git a/tools/hxcpp/BuildTool.hx b/tools/hxcpp/BuildTool.hx index 22f85d898..e173394b2 100644 --- a/tools/hxcpp/BuildTool.hx +++ b/tools/hxcpp/BuildTool.hx @@ -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(''); } @@ -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) diff --git a/tools/run/RunMain.hx b/tools/run/RunMain.hx index f5a4bb301..38cabf0d7 100644 --- a/tools/run/RunMain.hx +++ b/tools/run/RunMain.hx @@ -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"); @@ -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;