diff --git a/CMakeLists.txt b/CMakeLists.txt index 776c74f4..2f4ccad8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -34,7 +34,16 @@ add_library(oms::3rd::kinsol ALIAS sundials_kinsol_static) ######################################################################### ## zlib. message(STATUS "##### 3rdParty zlib") -add_subdirectory(zlib EXCLUDE_FROM_ALL) +option(OM_USE_SYSTEM_ZLIB "Use system zlib" OFF) +if (OM_USE_SYSTEM_ZLIB) + set(ZLIB_USE_STATIC_LIBS ON) + find_package(ZLIB MODULE REQUIRED) + unset(ZLIB_USE_STATIC_LIBS) + add_library(zlibstatic INTERFACE) + target_link_libraries(zlibstatic INTERFACE ZLIB::ZLIB) +else () + add_subdirectory(zlib EXCLUDE_FROM_ALL) +endif () add_library(oms::3rd::zlib ALIAS zlibstatic) ######################################################################### diff --git a/fmi4c/src/fmi4c.c b/fmi4c/src/fmi4c.c index f27445ab..e45d9edb 100644 --- a/fmi4c/src/fmi4c.c +++ b/fmi4c/src/fmi4c.c @@ -24,14 +24,20 @@ #include #endif -#if defined(__x86_64__) || defined(_M_X64) - #define arch_str "x86_64" +#if defined(__x86_64__) || defined(_M_X64) || defined(__aarch64__) || defined(__arm64__) || defined(_M_ARM64) #define bits_str "64" #else - #define arch_str "x86" #define bits_str "32" #endif +#if defined(__aarch64__) || defined(__arm64__) || defined(_M_ARM64) + #define arch_str "aarch64" +#elif defined(__x86_64__) || defined(_M_X64) + #define arch_str "x86_64" +#else + #define arch_str "x86" +#endif + #if defined(__CYGWIN__) #define dirsep_str "/" #elif defined(_WIN32) @@ -44,6 +50,10 @@ #define dllext_str ".dll" #define fmi12_system_str "win" #define fmi3_system_str "windows" +#elif defined(__APPLE__) + #define dllext_str ".dylib" + #define fmi12_system_str "darwin" + #define fmi3_system_str "darwin" #else #define dllext_str ".so" #define fmi12_system_str "linux"