Skip to content

Commit

Permalink
Adapt tests to new cc_binary file extension on macOS (#834)
Browse files Browse the repository at this point in the history
As of bazelbuild/bazel#14369, shared libraries
produced with cc_binary on macOS with the auto-configured toolchain use
the correct file extension for dynamic libraries
(.dylib rather than .so). This requires adapting a test.
  • Loading branch information
fmeum authored Dec 6, 2021
1 parent ebfeaa0 commit 40b03b4
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,13 @@ int main(int argc, char* argv[])
#ifdef _WIN32
test_opening_file(".\\cmake_with_data\\lib_b\\lib_b.dll");
#else
test_opening_file("./cmake_with_data/lib_b/liblib_b.so");
// Shared libraries used to have the .so file extension on macOS.
// See https://github.com/bazelbuild/bazel/pull/14369.
try {
test_opening_file("./cmake_with_data/lib_b/liblib_b.so");
} catch (std::runtime_error& e) {
test_opening_file("./cmake_with_data/lib_b/liblib_b.dylib");
}
#endif
std::cout << "Everything's fine!";
}

0 comments on commit 40b03b4

Please sign in to comment.