Skip to content

Commit

Permalink
Remove path macro for libtestsharedlib
Browse files Browse the repository at this point in the history
Signed-off-by: Shreyas Atre <[email protected]>
  • Loading branch information
SAtacker committed Feb 16, 2024
1 parent 1976d0c commit fb2a112
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 18 deletions.
4 changes: 0 additions & 4 deletions unittests/CppInterOp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,6 @@ target_link_libraries(DynamicLibraryManagerTests
clangCppInterOp
)

target_compile_definitions(DynamicLibraryManagerTests
PRIVATE CPPINTEROP_LIB_TestSharedLib_DIR_PREFIX=${CMAKE_BINARY_DIR}/unittests/bin/$<CONFIG>/
)

set_output_directory(DynamicLibraryManagerTests BINARY_DIR ${CMAKE_BINARY_DIR}/unittests/bin/$<CONFIG>/)

add_dependencies(DynamicLibraryManagerTests TestSharedLib)
Expand Down
20 changes: 6 additions & 14 deletions unittests/CppInterOp/DynamicLibraryManagerTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,23 +62,15 @@ TEST(DynamicLibraryManagerTest, Sanity) {

TEST(UtilsPlatform, DLTest) {
std::string err = "";
// CPPINTEROP_LIB_TestSharedLib_DIR_PREFIX specified by cmake though target
// definitions
#if defined(__APPLE__)
auto dlopen_handle = Cpp::utils::platform::DLOpen(
CPP_INTEROP_STRINGIFY(
CPPINTEROP_LIB_TestSharedLib_DIR_PREFIX) "./libTestSharedLib.dylib",
err);
auto dlopen_handle =
Cpp::utils::platform::DLOpen("./libTestSharedLib.dylib", err);
#elif defined(_WIN32)
auto dlopen_handle = Cpp::utils::platform::DLOpen(
CPP_INTEROP_STRINGIFY(
CPPINTEROP_LIB_TestSharedLib_DIR_PREFIX) "./libTestSharedLib.dll",
err);
auto dlopen_handle =
Cpp::utils::platform::DLOpen("./libTestSharedLib.dll", err);
#else
auto dlopen_handle = Cpp::utils::platform::DLOpen(
CPP_INTEROP_STRINGIFY(
CPPINTEROP_LIB_TestSharedLib_DIR_PREFIX) "./libTestSharedLib.so",
err);
auto dlopen_handle =
Cpp::utils::platform::DLOpen("./libTestSharedLib.so", err);
#endif
EXPECT_TRUE(dlopen_handle);
EXPECT_TRUE(err.empty());
Expand Down

0 comments on commit fb2a112

Please sign in to comment.