Commit Graph

14 Commits

Author SHA1 Message Date
Rintaro Ishizaki
9c9010e5b7 [CMake] Support Macros in Linux
For compiling codes required for macro support, we now need swiftc
compiler in the build machine.

Unlike Darwin OSes, where swiftCore runtime is guaranteed to be present
in /usr/lib, Linux doesn't have ABI stability and the stdlib of the
build machine is not at the specific location. So the built compiler
cannot relies on the shared object in the toolchain.
2023-08-24 17:04:15 +00:00
Stéphan Kochen
7b460ce495 build: fix accidental cmake expansions
As of CMake 3.25, there are now global variables `LINUX=1`, `ANDROID=1`,
etc. These conflict with expressions that used these names as unquoted
strings in positions where CMake accepts 'variable|string', for example:

- `if(sdk STREQUAL LINUX)` would fail, because `LINUX` is now defined and
  expands to 1, where it would previously coerce to a string.

- `if(${sdk} STREQUAL "LINUX")` would fail if `sdk=LINUX`, because the
  left-hand side expands twice.

In this patch, I looked for a number of patterns to fix up, sometimes a
little defensively:

- Quoted right-hand side of `STREQUAL` where I was confident it was
  intended to be a string literal.

- Removed manual variable expansion on left-hand side of `STREQUAL`,
  `MATCHES` and `IN_LIST` where I was confident it was unintended.

Fixes #65028.
2023-07-17 21:50:50 +02:00
Alastair Houghton
4495d63c12 [Threading] Add ConditionVariable support.
Swift Concurrency would like to be able to use condition variables.
Add support to the threading packages.

rdar://100236038
2022-09-27 16:21:13 +01:00
Alastair Houghton
210b772800 [UnitTests][Windows] Link with Synchronization.lib
The runtime unit tests also need to link with Synchronization.lib.

rdar://90776105
2022-06-07 07:39:53 +01:00
Alastair Houghton
3bfc7e0731 [Threading][Windows] Link the unit test against Synchronization.lib
We need to link the threading unit test against Synchronization.lib
to pick up the Win32 APIs we're using.

rdar://90776105
2022-06-07 07:39:52 +01:00
Alastair Houghton
6d1b6dbd1c [Threading] Fix the Linux build.
A few fixes specifically for the Linux build.

rdar://90776105
2022-06-07 07:39:52 +01:00
Alastair Houghton
785f4a215c [Unittests] Add more threading library tests.
Added explicit tests for `swift::once` and also for the ulock implementation
used on Linux.

rdar://90776105
2022-06-07 07:39:51 +01:00
Alastair Houghton
2ba80e1180 [Unittests] Make the Threading unit tests work.
The threading unit tests currently just check the operation of Mutex.
This used to be part of the runtime tests, but now it's a separate
library we can test it separately.

rdar://90776105
2022-06-07 07:39:51 +01:00
Alex Hoppen
4aa2bbbf06 Revert "Merge pull request #42447 from al45tair/eng/PR-90776105"
This reverts commit 8bcb71140f, reversing
changes made to c4dd271d36.
2022-06-02 18:03:23 +02:00
Alastair Houghton
dadd23e5e2 [UnitTests][Windows] Link with Synchronization.lib
The runtime unit tests also need to link with Synchronization.lib.

rdar://90776105
2022-05-24 14:57:41 +01:00
Alastair Houghton
d5c022f628 [Threading][Windows] Link the unit test against Synchronization.lib
We need to link the threading unit test against Synchronization.lib
to pick up the Win32 APIs we're using.

rdar://90776105
2022-05-24 14:57:41 +01:00
Alastair Houghton
fc90280e34 [Threading] Fix the Linux build.
A few fixes specifically for the Linux build.

rdar://90776105
2022-05-24 14:57:39 +01:00
Alastair Houghton
4280222286 [Unittests] Add more threading library tests.
Added explicit tests for `swift::once` and also for the ulock implementation
used on Linux.

rdar://90776105
2022-05-24 14:57:39 +01:00
Alastair Houghton
ddea8b18a8 [Unittests] Make the Threading unit tests work.
The threading unit tests currently just check the operation of Mutex.
This used to be part of the runtime tests, but now it's a separate
library we can test it separately.

rdar://90776105
2022-05-24 14:57:39 +01:00