Skip to content

Commit 2c9819a

Browse files
authored
Merge pull request #61514 from kavon/enhance-docs
[Docs] Add tip of using dry-run flag; mention build dir setting.
2 parents b5b70cc + 6f712ce commit 2c9819a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

docs/HowToGuides/GettingStarted.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,11 +395,12 @@ In project settings, locate `Build, Execution, Deployment > CMake`. You will nee
395395
- latest versions of the IDE suggest valid values here. Generally `RelWithDebInfoAssert` is a good one to work with
396396
- Toolchain: Default should be fine
397397
- Generator: Ninja
398-
- CMake options:
398+
- CMake options: You want to duplicate the essential CMake flags that `build-script` had used here, so CLion understands the build configuration. You can get the full list of CMake arguments from `build-script` by providing the `-n` dry-run flag; look for the last `cmake` command with a `-G Ninja`. Here is a minimal list of what you should provide to CLion here for this setting:
399399
- `-D SWIFT_PATH_TO_CMARK_BUILD=SOME_PATH/swift-project/build/Ninja-RelWithDebInfoAssert/cmark-macosx-arm64 -D LLVM_DIR=SOME_PATH/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/cmake/llvm -D Clang_DIR=SOME_PATH/swift-project/build/Ninja-RelWithDebInfoAssert/llvm-macosx-arm64/lib/cmake/clang -D CMAKE_BUILD_TYPE=RelWithDebInfoAssert -G Ninja -S .`
400400
- replace the `SOME_PATH` to the path where your `swift-project` directory is
401401
- the CMAKE_BUILD_TYPE should match the build configuration name, so if you named this profile `RelWithDebInfo` the CMAKE_BUILD_TYPE should also be `RelWithDebInfo`
402402
- **Note**: If you're using an Intel machine to build swift, you'll need to replace the architecture in the options. (ex: `arm64` with `x86_64`)
403+
- Build Directory: change this to the Swift build directory corresponding to the `build-script` run you did earlier, for example, `SOME_PATH/swift-project/build/Ninja-RelWithDebInfoAssert/swift-macosx-arm64`.
403404
404405
With this done, CLion should be able to successfully import the project and have full autocomplete and code navigation powers.
405406

0 commit comments

Comments
 (0)