add_library (${platf} SHARED ${platf}.cpp)
target_link_libraries(${platf} simgrid)
add_dependencies(platf_cpp ${platf})
+ set_target_properties(${platf}
+ PROPERTIES SUFFIX .so
+ )
endforeach()
#include <simgrid/Exception.hpp>
#include <algorithm>
+#ifndef _WIN32
#include <dlfcn.h>
+#endif /* _WIN32 */
#include <string>
XBT_LOG_NEW_CATEGORY(s4u, "Log channels of the S4U (Simgrid for you) interface");
void Engine::load_platform(const std::string& platf) const
{
double start = xbt_os_time();
- if (boost::algorithm::ends_with(platf, ".so")) {
+ if (boost::algorithm::ends_with(platf, ".so") or boost::algorithm::ends_with(platf, ".dylib")) {
+#ifdef _WIN32
+ xbt_die("loading platform through shared library isn't supported on windows");
+#else
void* handle = dlopen(platf.c_str(), RTLD_LAZY);
xbt_assert(handle, "Impossible to open platform file: %s", platf.c_str());
typedef void (*load_fct_t)(const Engine&);
xbt_assert(not dlsym_error, "Error: %s", dlsym_error);
callable(*this);
dlclose(handle);
+#endif /* _WIN32 */
} else {
parse_platform_file(platf);
}