Skip to content

Commit

Permalink
Fix breakage of DSO loading on all platforms
Browse files Browse the repository at this point in the history
Summary: bc00a99 fixed a spelling error, but failed to fix the accidentally inverted logic, meaning that instead of underscores being unconditionally omitted, they would instead be added when they are not needed, and omitted when they are needed.

Exit statuses are hard. Used EXIT_SUCCESS/EXIT_FAILURE in the hopes of making the code readable.
Closes #3104

Reviewed By: @paroski

Differential Revision: D1419880

Pulled By: @jwatzman
  • Loading branch information
tstarling authored and facebook-github-bot committed Jul 4, 2014
1 parent de0ac92 commit 1fc5341
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion CMake/FindLibDL.cmake
Expand Up @@ -18,10 +18,15 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibDL DEFAULT_MSG
SET(CMAKE_REQUIRED_LIBRARIES dl)
INCLUDE(CheckCSourceRuns)
CHECK_C_SOURCE_RUNS("#include <dlfcn.h>
#include <stdlib.h>
void testfunc() {}
int main() {
testfunc();
return dlsym(0, \"_testfunc\") != (void*)0;
if (dlsym(0, \"_testfunc\") != (void*)0) {
return EXIT_SUCCESS;
} else {
return EXIT_FAILURE;
}
}" LIBDL_NEEDS_UNDERSCORE)

mark_as_advanced(LIBDL_INCLUDE_DIRS LIBDL_LIBRARIES LIBDL_NEEDS_UNDERSCORE)

0 comments on commit 1fc5341

Please sign in to comment.