https://github.com/Kitware/CMake
Raw File
Tip revision: dc45b20aca1323d8497ac08d202fe238727c7198 authored by Brad King on 22 February 2024, 14:40:22 UTC
CMake 3.29.0-rc2
Tip revision: dc45b20
testbundleutils2.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("module2.dll");
  if (!lib) {
    printf("Failed to open module2\n");
  }
#else
  void* lib = dlopen("module2.so", RTLD_LAZY);
  if (!lib) {
    printf("Failed to open module2\n%s\n", dlerror());
  }
#endif

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