From 1a83d50a5d9e85934386310c17a14860cc92e75c Mon Sep 17 00:00:00 2001 From: Craig Kolb Date: Tue, 31 May 2022 11:16:34 -0700 Subject: Work around MacOS compilation issue with embed stlib (#2255) - The enable-stdlib-generator project is created with 'kind = StaticLib' to allow the build to work, even though the project doesn't actually create a library. - Unlike some other platforms, MacOs "ar" emits an error if no object files are listed to be added to an archive. This causes enable-stdlib-generator to fail on MacOS. - Changing the project's kind to "SharedLib" works around the issue. Other values for kind do not seem to work around the issue. - Add an optional flag to generatorProject to indicate that kind = "SharedLibrary" should be used, rather than "StaticLibrary" - Add MacOS fix for SharedLibraryUtils::getSharedLibraryFileName(). - Enable embed stdlib in github_macos_build.sh --- source/core/slang-shared-library.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source/core/slang-shared-library.cpp') diff --git a/source/core/slang-shared-library.cpp b/source/core/slang-shared-library.cpp index a67b10a42..1513b420f 100644 --- a/source/core/slang-shared-library.cpp +++ b/source/core/slang-shared-library.cpp @@ -8,7 +8,7 @@ #if defined(_WIN32) #define WIN32_LEAN_AND_MEAN #include -#elif defined(__linux__) +#elif defined(__linux__) || defined(SLANG_OSX) #include #endif #include @@ -125,7 +125,7 @@ String SharedLibraryUtils::getSharedLibraryFileName(void* symbolInLib) } return String::fromWString(filenameBuffer); -#elif defined(__linux__) +#elif defined(__linux__) || defined(SLANG_OSX) Dl_info dllInfo; if (!dladdr(symbolInLib, &dllInfo)) { -- cgit v1.2.3