https://github.com/Kitware/CMake
Raw File
Tip revision: ac925ec09e2dd4b373353d312e9e50b6165a66d0 authored by Brad King on 27 February 2018, 14:34:35 UTC
CMake 3.11.0-rc2
Tip revision: ac925ec
testbundleutils1.cpp

#include "framework.h"
#include "shared.h"
#include "stdio.h"

#if defined(WIN32)
#include <windows.h>
#else
#include "dlfcn.h"
#endif

int main(int, char**)
{
  framework();
  shared();

#if defined(WIN32)
  HANDLE lib = LoadLibraryA("module1.dll");
  if (!lib) {
    printf("Failed to open module1\n");
  }
#else
  void* lib = dlopen("module1.so", RTLD_LAZY);
  if (!lib) {
    printf("Failed to open module1\n%s\n", dlerror());
  }
#endif

  return lib == 0 ? 1 : 0;
}
back to top