diff --git a/unittests/CppInterOp/CMakeLists.txt b/unittests/CppInterOp/CMakeLists.txt index 0e155f709..5b712abb8 100644 --- a/unittests/CppInterOp/CMakeLists.txt +++ b/unittests/CppInterOp/CMakeLists.txt @@ -37,7 +37,7 @@ target_link_libraries(DynamicLibraryManagerTests clangCppInterOp ) -set_output_directory(DynamicLibraryManagerTests BINARY_DIR ${CMAKE_BINARY_DIR}/unittests/bin/$/) +set_output_directory(DynamicLibraryManagerTests BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/TestSharedLib/unittests/bin/$/) add_dependencies(DynamicLibraryManagerTests TestSharedLib) #export_executable_symbols_for_plugins(TestSharedLib) diff --git a/unittests/CppInterOp/TestSharedLib/CMakeLists.txt b/unittests/CppInterOp/TestSharedLib/CMakeLists.txt index 9fbf2296c..05f1afb3f 100644 --- a/unittests/CppInterOp/TestSharedLib/CMakeLists.txt +++ b/unittests/CppInterOp/TestSharedLib/CMakeLists.txt @@ -5,7 +5,7 @@ add_llvm_library(TestSharedLib TestSharedLib.cpp) # Put TestSharedLib next to the unit test executable. set_output_directory(TestSharedLib - BINARY_DIR ${CMAKE_BINARY_DIR}/unittests/bin/$/ - LIBRARY_DIR ${CMAKE_BINARY_DIR}/unittests/bin/$/ + BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/unittests/bin/$/ + LIBRARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/unittests/bin/$/ ) set_target_properties(TestSharedLib PROPERTIES FOLDER "Tests") diff --git a/unittests/CppInterOp/TestSharedLib/TestSharedLib.h b/unittests/CppInterOp/TestSharedLib/TestSharedLib.h index 92633cdb7..a56ba4229 100644 --- a/unittests/CppInterOp/TestSharedLib/TestSharedLib.h +++ b/unittests/CppInterOp/TestSharedLib/TestSharedLib.h @@ -5,7 +5,7 @@ #ifdef _WIN32 extern "C" __declspec(dllexport) int ret_zero(); #else -extern "C" int ret_zero(); +extern "C" int __attribute__((visibility("default"))) ret_zero(); #endif #endif // UNITTESTS_CPPINTEROP_TESTSHAREDLIB_TESTSHAREDLIB_H