Using bundled libc++ in ThirdParty

I’m building a ThirdParty library (RadeonRays), and would like to cause it to compile and link against the libc++ which is bundled with Unreal. Are there any examples of doing this? I’ve seen this recommendation but can’t find any practical examples of doing so.

This is exactly and precisely what I need. Thank you!!!

Hey,

you can examine the build scripts of the third party libs bundled with Unreal (e.g. libglslang or hlslcc). Squarely it boils down to setting these options (I’m using UE_THIRD_PARTY_DIR as a shortcut for the absolute path to Engine/Source/ThirdParty):

Compile:

-nostdinc++ -I $UE_THIRD_PARTY_DIR/Linux/LibCxx/include/ -I $UE_THIRD_PARTY_DIR/Linux/LibCxx/include/c++/v1

Link:

-nodefaultlibs -L $UE_THIRD_PARTY_DIR/Linux/LibCxx/lib/Linux/x86_64-unknown-linux-gnu/  $UE_THIRD_PARTY_DIR/Linux/LibCxx/lib/Linux/x86_64-unknown-linux-gnu/libc++.a $UE_THIRD_PARTY_DIR/Linux/LibCxx/lib/Linux/x86_64-unknown-linux-gnu/libc++abi.a -lm -lc -lgcc_s -lgcc

Hope this helps.