Skip to content

build: simplify condition and IWYU CMake edition #22600

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 15, 2019
Merged
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
2 changes: 2 additions & 0 deletions cmake/modules/SwiftSharedCMakeConfig.cmake
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
include(CMakeParseArguments)
include(SwiftXcodeSupport)

include(CheckCXXCompilerFlag)

macro(swift_common_standalone_build_config_llvm product is_cross_compiling)
option(LLVM_ENABLE_WARNINGS "Enable compiler warnings." ON)

Expand Down
4 changes: 2 additions & 2 deletions stdlib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ set(HOST_CMAKE_CXX_COMPILER ${CMAKE_CXX_COMPILER})
set(HOST_CMAKE_C_COMPILER_INITIAL ${CMAKE_C_COMPILER})

if(SWIFT_BUILD_RUNTIME_WITH_HOST_COMPILER)
if((NOT "${CMAKE_C_COMPILER_ID}" STREQUAL "Clang") AND
(NOT "${CMAKE_C_COMPILER_ID}" STREQUAL "AppleClang"))
if(NOT "${CMAKE_C_COMPILER_ID}" MATCHES "Clang")
message(FATAL_ERROR "Building the swift runtime is not supported with ${CMAKE_C_COMPILER_ID}. Use the just-built clang instead.")
else()
message(WARNING "Building the swift runtime using the host compiler, and not the just-built clang.")
Expand All @@ -32,6 +31,7 @@ else()

set(CMAKE_C_COMPILER_LAUNCHER "")
set(CMAKE_CXX_COMPILER_LAUNCHER "")

# The sanitizers require using the same version of the compiler for
# everything and there are various places where we link runtime code with
# code built by the host compiler. Disable sanitizers for the runtime for
Expand Down
1 change: 1 addition & 0 deletions stdlib/public/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

set(SWIFT_RUNTIME_CXX_FLAGS)
set(SWIFT_RUNTIME_LINK_FLAGS)
set(SWIFT_RUNTIME_SWIFT_COMPILE_FLAGS)
Expand Down