CMake: Add libdl and demangle support
parent
37e682cb07
commit
a8c3ceb3c9
@ -0,0 +1,20 @@
|
|||||||
|
include(CheckCXXSourceCompiles)
|
||||||
|
set(CMAKE_REQUIRED_LIBRARIES "dl")
|
||||||
|
|
||||||
|
check_cxx_source_compiles("
|
||||||
|
#include <dlfcn.h>
|
||||||
|
int main() {
|
||||||
|
Dl_info info;
|
||||||
|
return dladdr(0, &info);
|
||||||
|
}"
|
||||||
|
DL_FOUND
|
||||||
|
)
|
||||||
|
|
||||||
|
if (DL_FOUND)
|
||||||
|
add_compile_options(
|
||||||
|
-DWITH_DL
|
||||||
|
)
|
||||||
|
link_libraries(dl)
|
||||||
|
endif (DL_FOUND)
|
||||||
|
|
||||||
|
set(CMAKE_REQUIRED_LIBRARIES "")
|
@ -0,0 +1,18 @@
|
|||||||
|
include(CheckCXXSourceCompiles)
|
||||||
|
set(CMAKE_REQUIRED_FLAGS "")
|
||||||
|
|
||||||
|
check_cxx_source_compiles("
|
||||||
|
#include <cxxabi.h>
|
||||||
|
int main() {
|
||||||
|
int status = -1;
|
||||||
|
char *demangled = abi::__cxa_demangle(\"test\", 0, 0, &status);
|
||||||
|
return 0;
|
||||||
|
}"
|
||||||
|
DEMANGLE_FOUND
|
||||||
|
)
|
||||||
|
|
||||||
|
if (DEMANGLE_FOUND)
|
||||||
|
add_compile_options(
|
||||||
|
-DWITH_DEMANGLE
|
||||||
|
)
|
||||||
|
endif (DEMANGLE_FOUND)
|
Loading…
Reference in New Issue