Skip to content

Commit 01182ab

Browse files
committed
Remove path macro for libtestsharedlib
Signed-off-by: Shreyas Atre <[email protected]>
1 parent 1976d0c commit 01182ab

File tree

2 files changed

+6
-21
lines changed

2 files changed

+6
-21
lines changed

unittests/CppInterOp/CMakeLists.txt

-4
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,6 @@ target_link_libraries(DynamicLibraryManagerTests
2828
clangCppInterOp
2929
)
3030

31-
target_compile_definitions(DynamicLibraryManagerTests
32-
PRIVATE CPPINTEROP_LIB_TestSharedLib_DIR_PREFIX=${CMAKE_BINARY_DIR}/unittests/bin/$<CONFIG>/
33-
)
34-
3531
set_output_directory(DynamicLibraryManagerTests BINARY_DIR ${CMAKE_BINARY_DIR}/unittests/bin/$<CONFIG>/)
3632

3733
add_dependencies(DynamicLibraryManagerTests TestSharedLib)

unittests/CppInterOp/DynamicLibraryManagerTest.cpp

+6-17
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@
77

88
#include "../../lib/Interpreter/Paths.h"
99

10-
#define XCPP_INTEROP_STRINGIFY(x) #x
11-
#define CPP_INTEROP_STRINGIFY(x) XCPP_INTEROP_STRINGIFY(x)
12-
1310
// This function isn't referenced outside its translation unit, but it
1411
// can't use the "static" keyword because its address is used for
1512
// GetMainExecutable (since some platforms don't support taking the
@@ -62,23 +59,15 @@ TEST(DynamicLibraryManagerTest, Sanity) {
6259

6360
TEST(UtilsPlatform, DLTest) {
6461
std::string err = "";
65-
// CPPINTEROP_LIB_TestSharedLib_DIR_PREFIX specified by cmake though target
66-
// definitions
6762
#if defined(__APPLE__)
68-
auto dlopen_handle = Cpp::utils::platform::DLOpen(
69-
CPP_INTEROP_STRINGIFY(
70-
CPPINTEROP_LIB_TestSharedLib_DIR_PREFIX) "./libTestSharedLib.dylib",
71-
err);
63+
auto dlopen_handle =
64+
Cpp::utils::platform::DLOpen("./libTestSharedLib.dylib", err);
7265
#elif defined(_WIN32)
73-
auto dlopen_handle = Cpp::utils::platform::DLOpen(
74-
CPP_INTEROP_STRINGIFY(
75-
CPPINTEROP_LIB_TestSharedLib_DIR_PREFIX) "./libTestSharedLib.dll",
76-
err);
66+
auto dlopen_handle =
67+
Cpp::utils::platform::DLOpen("./libTestSharedLib.dll", err);
7768
#else
78-
auto dlopen_handle = Cpp::utils::platform::DLOpen(
79-
CPP_INTEROP_STRINGIFY(
80-
CPPINTEROP_LIB_TestSharedLib_DIR_PREFIX) "./libTestSharedLib.so",
81-
err);
69+
auto dlopen_handle =
70+
Cpp::utils::platform::DLOpen("./libTestSharedLib.so", err);
8271
#endif
8372
EXPECT_TRUE(dlopen_handle);
8473
EXPECT_TRUE(err.empty());

0 commit comments

Comments
 (0)