Skip to content

[cmake] Add install target#239

Closed
alloy wants to merge 3 commits intofacebook:masterfrom
alloy:add-install-target
Closed

[cmake] Add install target#239
alloy wants to merge 3 commits intofacebook:masterfrom
alloy:add-install-target

Conversation

@alloy
Copy link
Copy Markdown
Contributor

@alloy alloy commented May 6, 2020

This adds a CMake install target, which makes it a little easier to collect the files needed for a distribution.

I have not updated the Android build yet to make use of this yet, because I don’t currently have the correct setup and figured it could be done in a next iteration, either on my end or your end.

$ ./src/utils/build/configure.py --build-type=Debug --cmake-flags='-DCMAKE_INSTALL_PREFIX:PATH=../destroot'
$ cd build
$ ninja install -v
[…]
[430/431] cd /Users/eloy/Code/ReactNative/Hermes/build && /usr/local/Cellar/cmake/3.15.3/bin/cmake -P cmake_install.cmake
-- Install configuration: "Debug"
-- Installing: /Users/eloy/Code/ReactNative/Hermes/build/../destroot/lib/libhermes.dylib
-- Installing: /Users/eloy/Code/ReactNative/Hermes/build/../destroot/bin/hermes
-- Installing: /Users/eloy/Code/ReactNative/Hermes/build/../destroot/bin/hermesc
-- Installing: /Users/eloy/Code/ReactNative/Hermes/build/../destroot/bin/hdb
-- Installing: /Users/eloy/Code/ReactNative/Hermes/build/../destroot/bin/hbcdump
-- Installing: /Users/eloy/Code/ReactNative/Hermes/build/../destroot/bin/hvm
-- Up-to-date: /Users/eloy/Code/ReactNative/Hermes/build/../destroot/include/hermes
-- Up-to-date: /Users/eloy/Code/ReactNative/Hermes/build/../destroot/include/hermes/TraceInterpreter.h
-- Up-to-date: /Users/eloy/Code/ReactNative/Hermes/build/../destroot/include/hermes/SynthTrace.h
-- Up-to-date: /Users/eloy/Code/ReactNative/Hermes/build/../destroot/include/hermes/TracingRuntime.h
-- Up-to-date: /Users/eloy/Code/ReactNative/Hermes/build/../destroot/include/hermes/DebuggerAPI.h
-- Up-to-date: /Users/eloy/Code/ReactNative/Hermes/build/../destroot/include/hermes/SynthTraceParser.h
-- Up-to-date: /Users/eloy/Code/ReactNative/Hermes/build/../destroot/include/hermes/CompileJS.h
-- Up-to-date: /Users/eloy/Code/ReactNative/Hermes/build/../destroot/include/hermes/hermes.h
-- Up-to-date: /Users/eloy/Code/ReactNative/Hermes/build/../destroot/include/hermes/hermes_tracing.h
-- Up-to-date: /Users/eloy/Code/ReactNative/Hermes/build/../destroot/include
-- Up-to-date: /Users/eloy/Code/ReactNative/Hermes/build/../destroot/include/jsi
-- Up-to-date: /Users/eloy/Code/ReactNative/Hermes/build/../destroot/include/jsi/jsi-inl.h
-- Up-to-date: /Users/eloy/Code/ReactNative/Hermes/build/../destroot/include/jsi/JSIDynamic.h
-- Up-to-date: /Users/eloy/Code/ReactNative/Hermes/build/../destroot/include/jsi/instrumentation.h
-- Up-to-date: /Users/eloy/Code/ReactNative/Hermes/build/../destroot/include/jsi/jsi.h
-- Up-to-date: /Users/eloy/Code/ReactNative/Hermes/build/../destroot/include/jsi/decorator.h
-- Up-to-date: /Users/eloy/Code/ReactNative/Hermes/build/../destroot/include/jsi/threadsafe.h
-- Up-to-date: /Users/eloy/Code/ReactNative/Hermes/build/../destroot/include/jsi/jsilib.h
-- Up-to-date: /Users/eloy/Code/ReactNative/Hermes/build/../destroot/include/hermes/Public
-- Up-to-date: /Users/eloy/Code/ReactNative/Hermes/build/../destroot/include/hermes/Public/RuntimeConfig.h
-- Up-to-date: /Users/eloy/Code/ReactNative/Hermes/build/../destroot/include/hermes/Public/GCConfig.h
-- Up-to-date: /Users/eloy/Code/ReactNative/Hermes/build/../destroot/include/hermes/Public/GCTripwireContext.h
-- Up-to-date: /Users/eloy/Code/ReactNative/Hermes/build/../destroot/include/hermes/Public/Buffer.h
-- Up-to-date: /Users/eloy/Code/ReactNative/Hermes/build/../destroot/include/hermes/Public/DebuggerTypes.h
-- Up-to-date: /Users/eloy/Code/ReactNative/Hermes/build/../destroot/include/hermes/Public/CtorConfig.h
-- Up-to-date: /Users/eloy/Code/ReactNative/Hermes/build/../destroot/include/hermes/Public/CrashManager.h

This ends up creating:

$ tree ../destroot/
../destroot/
├── bin
│   ├── hbcdump
│   ├── hdb
│   ├── hermes
│   ├── hermesc
│   └── hvm
├── include
│   ├── hermes
│   │   ├── CompileJS.h
│   │   ├── DebuggerAPI.h
│   │   ├── Public
│   │   │   ├── Buffer.h
│   │   │   ├── CrashManager.h
│   │   │   ├── CtorConfig.h
│   │   │   ├── DebuggerTypes.h
│   │   │   ├── GCConfig.h
│   │   │   ├── GCTripwireContext.h
│   │   │   └── RuntimeConfig.h
│   │   ├── SynthTrace.h
│   │   ├── SynthTraceParser.h
│   │   ├── TraceInterpreter.h
│   │   ├── TracingRuntime.h
│   │   ├── hermes.h
│   │   └── hermes_tracing.h
│   └── jsi
│       ├── JSIDynamic.h
│       ├── decorator.h
│       ├── instrumentation.h
│       ├── jsi-inl.h
│       ├── jsi.h
│       ├── jsilib.h
│       └── threadsafe.h
└── lib
    └── libhermes.dylib

…as opposed to what the current include dir looks like in the npm package:

$ tree ../npm-releases/0.5.0/android/include
../npm-releases/0.5.0/android/include
└── hermes
    ├── CompileJS.h
    ├── DebuggerAPI.h
    ├── Public
    │   ├── Buffer.h
    │   ├── CrashManager.h
    │   ├── CtorConfig.h
    │   ├── DebuggerTypes.h
    │   ├── GCConfig.h
    │   ├── GCTripwireContext.h
    │   ├── MemoryEventTracker.h
    │   └── RuntimeConfig.h
    ├── SynthTrace.h
    ├── SynthTraceParser.h
    ├── TraceInterpreter.h
    ├── TracingRuntime.h
    ├── hermes.h
    ├── hermes_tracing.h
    └── synthtest
        └── tests
            └── TestFunctions.h

(I assume that TestFunctions.h header didn’t need to be included?)

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed Do not delete this pull request or issue due to inactivity.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants