Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ project(Hylo
LANGUAGES C CXX Swift
)
enable_testing()
include(CTest)
if(BUILD_TESTING)
include(CTest)
endif()

set(CMAKE_OSX_DEPLOYMENT_TARGET "13.0")

Expand Down
17 changes: 11 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,13 @@ file for LLVM.
(on Windows substitute your shell's line continuation character
for `\` or just remove the line breaks and backslashes).

If you want to run tests, add `-DBUILD_TESTING=1`.
If you want to run tests, add `-D BUILD_TESTING=1`.

**Note:** on macOS, if you are not using your Xcode's default
toolchain, [you may need `-D
CMAKE_Swift_COMPILER=swiftc`](https://gitlab.kitware.com/cmake/cmake/-/issues/25750)
to prevent CMake from using Xcode's default `swift`.
**Note:** on macOS,
- To run tests, you also need `-D CMAKE_OSX_SYSROOT=$(xcrun --show-sdk-path)`.
- if you are not using your Xcode's default toolchain, [you may need `-D
CMAKE_Swift_COMPILER=swiftc`](https://gitlab.kitware.com/cmake/cmake/-/issues/25750) to
prevent CMake from using Xcode's default `swift`.

If this command fails it could be because you have an LLVM without
CMake support installed; we suggest you try one of
Expand Down Expand Up @@ -92,7 +93,11 @@ You will need CMake 3.3.0-rc1 or newer.
-G Xcode -S . -B <build-directory>
```

If you want to run tests, add `-DBUILD_TESTING=1`.
If you want to run tests, add

```
-D BUILD_TESTING=1 -D CMAKE_OSX_SYSROOT=$(xcrun --show-sdk-path)
```

2. **Profit**: open the `.xcodeproj` file in the *build-directory* and
use Xcode's UI to build and test.
Expand Down
Loading