Commit Graph

7 Commits

Author SHA1 Message Date
Evan Wilde
7870db67f8 CMake: Runtime Installation Story
Starting to work on a full installation story for the Swift runtimes.
This involves generating the SwiftCoreConfig cmake files to allow
importing the just-built runtimes into the overlays and supplemental
libraries, setting up the flags appropriately for the given SwiftCore
build configuration.

This also separates out the development and runtime components to allow
installing just the runtimes without the headers.

Component List:
 - SwiftCore_runtime

  The runtime libraries that are required for running code.

 - SwiftCore_development

  The interface with the runtime libraries that are required for
  building code against the runtimes.

 - SwiftCore_cmake

  Files for interfacing CMake projects with the built runtimes.
  This includes the target list and flags needed to use the targets
  built by the specific configuration used to build the runtime
  libraries.

  These files are used for mapping flags, definitions, and locations
  into the overlay libraries and supplemental libraries.

This adds install commands for the object libraries contributing to
libswiftCore so that they are represented in SwiftCoreTargets.cmake.
Object libraries do not contribute anything to the files actually
installed.
2025-02-22 10:33:17 -08:00
Evan Wilde
37223c8562 CMake: SwiftCore: Add Locale macro
Add locale support to new build system. The locale support depends on
finding the `clocale` C++ header.
2025-01-07 15:44:51 -08:00
Saleem Abdulrasool
f4851a9ac6 runtime: adjust the style for target_link_libraries
Using a single library per line model allows for an easier time to
adjust the list as well as reduces the diff between revisions.
2024-12-13 14:05:18 -08:00
Saleem Abdulrasool
8bf26a795c Runtime: control swiftCore_EXPORTS based on the build
This define is meant to be present only when performing a build of a
dynamic library. The general pattern for this is:

  ```c
  #if defined(LIBRARY_STATIC)
  # define LIBRARY_ABI /**/
  #else
  # if defined(_WIN32)
  #   if defined(LIBRARY_EXPORTS)
  #     define LIBRARY_ABI __declspec(dllexport)
  #   else
  #     define LIBRARY_ABI __declspec(dllimport)
  #   endif
  # elseif defined(__linux__) && !defined(__ANDROID__)
  #   define LIBRARY_ABI __attribute__((__visibility__("protected")))
  # else
  #   define LIBRARY_ABI __attribute__((__visibility__("default")))
  # endif
  #endif
  ```

For AIX this would require an additional flag to be specified
(`-mdefault-visibility-export-mapping=explicit`). The same applies for
other non-AIX, non-Windows platforms with a different set of flags:
`-fvisibility=hidden -fvisibility-inlines-hidden`.

This is required to start trying to build the standard library
statically on Windows (which also requires further changes to the
Swift compiler).
2024-12-12 10:06:21 -08:00
Evan Wilde
f273a2e283 [CMake] Enable unicode data support
Stubs has a macro define for enabling or disabling the embedded
unicode data tables, which are required for doing things like counting
characters in strings. Add that option and default it to 'on' for full
unicode support.
2024-11-22 15:43:10 -08:00
Evan Wilde
2a3e6d53a0 Moving compiler-src-dir refs
Moving the rest of the references to the compiler source directory to
use the `SwiftCore_SWIFTC_SOURCE_DIR` variable instead of
`${PROJECT_SOURCE_DIR}/../../`.
2024-11-06 21:27:53 -08:00
Evan Wilde
f3b5fcdc15 Add stubs library to build
Adding stdlib stubs library, which uses gyb and requires knowing about
some of the platform info.

The stubs library pulls in several headers from the compiler repository.
We should probably clean that up, but not right now. I've made a note of
it.
2024-11-06 21:27:53 -08:00