Skip to content

Commit

Permalink
Link hdb with ICU
Browse files Browse the repository at this point in the history
Summary:
CMake by default erases the rpath when installing a target. In general
this is fine because we set the `BUILD_WITH_INSTALL_RPATH` variable
for each target in the `hermes_link_icu` function (which prevents this
default behaviour). However, until now `hdb` did not explicitly link
against ICU, which meant that the rpath would get erased on install.

For example:
```
[538/539] Install the project...
-- Install configuration: "Debug"
-- Installing: /home/neildhar/build/./destroot/bin/hermes
-- Installing: /home/neildhar/build/./destroot/bin/hermesc
-- Installing: /home/neildhar/build/./destroot/bin/hdb
-- Set runtime path of "./destroot/bin/hdb" to ""
-- Installing: /home/neildhar/build/./destroot/bin/hbcdump
-- Installing: /home/neildhar/build/./destroot/bin/hvm
-- Up-to-date: /home/neildhar/build/./destroot/include/hermes/Public
-- Up-to-date: /home/neildhar/build/./destroot/include/hermes/Public/Buffer.h
-- Up-to-date: /home/neildhar/build/./destroot/include/hermes/Public/CrashManager.h
-- Up-to-date: /home/neildhar/build/./destroot/include/hermes/Public/CtorConfig.h
-- Up-to-date: /home/neildhar/build/./destroot/include/hermes/Public/DebuggerTypes.h
-- Up-to-date: /home/neildhar/build/./destroot/include/hermes/Public/GCConfig.h
-- Up-to-date: /home/neildhar/build/./destroot/include/hermes/Public/GCTripwireContext.h
-- Up-to-date: /home/neildhar/build/./destroot/include/hermes/Public/RuntimeConfig.h
-- Installing: /home/neildhar/build/./destroot/lib/libhermes.so
-- Up-to-date: /home/neildhar/build/./destroot/include/hermes
-- Up-to-date: /home/neildhar/build/./destroot/include/hermes/SynthTrace.h
-- Up-to-date: /home/neildhar/build/./destroot/include/hermes/TracingRuntime.h
-- Up-to-date: /home/neildhar/build/./destroot/include/hermes/hermes_tracing.h
-- Up-to-date: /home/neildhar/build/./destroot/include/hermes/DebuggerAPI.h
-- Up-to-date: /home/neildhar/build/./destroot/include/hermes/CompileJS.h
-- Up-to-date: /home/neildhar/build/./destroot/include/hermes/TraceInterpreter.h
-- Up-to-date: /home/neildhar/build/./destroot/include/hermes/SynthTraceParser.h
-- Up-to-date: /home/neildhar/build/./destroot/include/hermes/hermes.h
neildhar@devvm2076 ~/build> ./destroot/bin/hdb
./destroot/bin/hdb: error while loading shared libraries: libicuuc.so.53: cannot open shared object file: No such file or directory
```

To fix this, this diff explicitly calls `hermes_link_icu` for the
`hdb` target so that we can safely add an install target.

Reviewed By: tmikov

Differential Revision: D22084012

fbshipit-source-id: 1e59e601007cf62186724ba23c65f9e9c9f5bc7e
  • Loading branch information
neildhar authored and facebook-github-bot committed Jul 11, 2020
1 parent 05c853b commit 7caee3b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tools/hdb/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ target_link_libraries(hdb
hermesapi
)

hermes_link_icu(hdb)

hermes_strip_apple_debug_symbols(hdb)

install(TARGETS hdb
Expand Down

0 comments on commit 7caee3b

Please sign in to comment.