diff --git a/unittests/CppInterOp/CMakeLists.txt b/unittests/CppInterOp/CMakeLists.txt index 7ca5e5dfa..75dccf556 100644 --- a/unittests/CppInterOp/CMakeLists.txt +++ b/unittests/CppInterOp/CMakeLists.txt @@ -28,6 +28,8 @@ target_link_libraries(DynamicLibraryManagerTests clangCppInterOp ) +set_output_directory(DynamicLibraryManagerTests BINARY_DIR ${CMAKE_BINARY_DIR}/unittests/bin/$/) + add_dependencies(DynamicLibraryManagerTests TestSharedLib) #export_executable_symbols_for_plugins(TestSharedLib) add_subdirectory(TestSharedLib) diff --git a/unittests/CppInterOp/DynamicLibraryManagerTest.cpp b/unittests/CppInterOp/DynamicLibraryManagerTest.cpp index d9dc7b35c..01624ef78 100644 --- a/unittests/CppInterOp/DynamicLibraryManagerTest.cpp +++ b/unittests/CppInterOp/DynamicLibraryManagerTest.cpp @@ -41,7 +41,8 @@ TEST(DynamicLibraryManagerTest, Sanity) { << "'"; EXPECT_TRUE(Cpp::LoadLibrary(PathToTestSharedLib.c_str())); - + // Force ExecutionEngine to be created. + Cpp::Process(""); // FIXME: Conda returns false to run this code on osx. #ifndef __APPLE__ EXPECT_TRUE(Cpp::GetFunctionAddress("ret_zero")); diff --git a/unittests/CppInterOp/TestSharedLib/CMakeLists.txt b/unittests/CppInterOp/TestSharedLib/CMakeLists.txt index 0c5d45818..9fbf2296c 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_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/../ - LIBRARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/../ + BINARY_DIR ${CMAKE_BINARY_DIR}/unittests/bin/$/ + LIBRARY_DIR ${CMAKE_BINARY_DIR}/unittests/bin/$/ ) set_target_properties(TestSharedLib PROPERTIES FOLDER "Tests")