diff options
| author | Craig Kolb <craig.kolb@gmail.com> | 2022-05-31 11:16:34 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-05-31 14:16:34 -0400 |
| commit | 1a83d50a5d9e85934386310c17a14860cc92e75c (patch) | |
| tree | 710c74036362a3424bfe630c867f13be0455b899 /source/core/slang-shared-library.cpp | |
| parent | 2d3392f22c894957d17dd13486e0565c4ecea89c (diff) | |
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
Diffstat (limited to 'source/core/slang-shared-library.cpp')
| -rw-r--r-- | source/core/slang-shared-library.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
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 <Windows.h> -#elif defined(__linux__) +#elif defined(__linux__) || defined(SLANG_OSX) #include <dlfcn.h> #endif #include <sys/stat.h> @@ -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)) { |
