# Build issues

**URL:** <https://forums.swift.org/t/build-issues/33685>\
**Category:** Compiler\
**Tags:** xcode, build-script, help-needed, buildin-the-compiler\
**Created:** [February 10, 2020, 8:58pm UTC](https://forums.swift.org/t/build-issues/33685 "2020-02-10T20:58:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![suyashsrijan](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/suyashsrijan/32/5292_2.png) [@suyashsrijan](https://forums.swift.org/u/suyashsrijan)\
**Post date:** [February 10, 2020, 8:58pm UTC](https://forums.swift.org/t/build-issues/33685/1 "2020-02-10T20:58:24Z")

</div>

**Edit** : It seems like upgrading CMake to the latest stable version seems to have fixed the problem.

* * *

> **Summary**
>
> I am not sure if I am the only one, but there's seems to be an issue when building swift (fresh checkout). I am using Xcode 11.3.1 and macOS Catalina 10.15.3.
> 
> There seems to be a few errors actually when building with `build-script -x -r --skip-build-benchmarks` (tried `--clean` and `--reconfigure` too but they make no difference):
> 
> ```swift
> -- Detecting CXX compile features - done
> -- CMake (/usr/local/Cellar/cmake/3.12.4/bin/cmake) Version: 3.12.4
> xcodebuild: error: invalid option '--version'
> 
> ```
> 
> ```swift
> Call Stack (most recent call first):
> cmake/modules/SwiftSharedCMakeConfig.cmake:102 (include)
> cmake/modules/SwiftSharedCMakeConfig.cmake:207 (swift_common_standalone_build_config_llvm)
> CMakeLists.txt:467 (swift_common_standalone_build_config)
> 
> ```
> 
> ```swift
> CMake Error at cmake/modules/AddSwift.cmake:1394 (target_link_options):
> Unknown CMake command "target_link_options".
> Call Stack (most recent call first):
> cmake/modules/AddSwift.cmake:2182 (_add_swift_library_single)
> stdlib/toolchain/Compatibility50/CMakeLists.txt:3 (add_swift_target_library)
> 
> ```
> 
> Did something change recently? Ninja has a similar issue (related to CMake) so it doesn't seem to be related to Xcode.

---

<div class="post-metadata">

**Author:** ![mishal\_shah](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/mishal_shah/32/247_2.png) [@mishal\_shah](https://forums.swift.org/u/mishal_shah)\
**Post date:** [February 10, 2020, 9:24pm UTC](https://forums.swift.org/t/build-issues/33685/2 "2020-02-10T21:24:55Z")

</div>

Can you try the build with CMake 3.15.1 or newer?

---

<div class="post-metadata">

**Author:** ![suyashsrijan](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/suyashsrijan/32/5292_2.png) [@suyashsrijan](https://forums.swift.org/u/suyashsrijan)\
**Post date:** [February 10, 2020, 9:26pm UTC](https://forums.swift.org/t/build-issues/33685/3 "2020-02-10T21:26:24Z")

</div>

I have upgraded to CMake 3.16.3 (via `brew`) and that seems to have fixed the problem! Thanks for the help anyway! Maybe the upgrade from 10.15.1 to 10.15.3 messed up something...
