Initialize Xcode project build settings (#9777)
This commit is contained in:
@@ -27,6 +27,8 @@ mbgl_platform_benchmark()
|
||||
|
||||
create_source_groups(mbgl-benchmark)
|
||||
|
||||
initialize_xcode_cxx_build_settings(mbgl-benchmark)
|
||||
|
||||
xcode_create_scheme(
|
||||
TARGET mbgl-benchmark
|
||||
OPTIONAL_ARGS
|
||||
|
||||
@@ -34,3 +34,5 @@ mbgl_platform_core()
|
||||
create_source_groups(mbgl-core)
|
||||
|
||||
xcode_create_scheme(TARGET mbgl-core)
|
||||
|
||||
initialize_xcode_cxx_build_settings(mbgl-core)
|
||||
|
||||
@@ -34,6 +34,8 @@ mbgl_platform_glfw()
|
||||
|
||||
create_source_groups(mbgl-glfw)
|
||||
|
||||
initialize_xcode_cxx_build_settings(mbgl-glfw)
|
||||
|
||||
xcode_create_scheme(
|
||||
TARGET mbgl-glfw
|
||||
OPTIONAL_ARGS
|
||||
|
||||
@@ -114,6 +114,32 @@ function(write_xcconfig_target_properties)
|
||||
)
|
||||
endfunction()
|
||||
|
||||
# Set Xcode project build settings to be consistent with the CXX flags we're
|
||||
# using. (Otherwise, Xcode's defaults may override some of these.)
|
||||
macro(initialize_xcode_cxx_build_settings target)
|
||||
# -Wall
|
||||
set_xcode_property(${target} GCC_WARN_SIGN_COMPARE YES)
|
||||
set_xcode_property(${target} GCC_WARN_UNINITIALIZED_AUTOS YES)
|
||||
set_xcode_property(${target} GCC_WARN_UNKNOWN_PRAGMAS YES)
|
||||
set_xcode_property(${target} GCC_WARN_UNUSED_FUNCTION YES)
|
||||
set_xcode_property(${target} GCC_WARN_UNUSED_LABEL YES)
|
||||
set_xcode_property(${target} GCC_WARN_UNUSED_PARAMETER YES)
|
||||
set_xcode_property(${target} GCC_WARN_UNUSED_VARIABLE YES)
|
||||
|
||||
# -Wextra
|
||||
set_xcode_property(${target} CLANG_WARN_EMPTY_BODY YES)
|
||||
set_xcode_property(${target} GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS YES)
|
||||
|
||||
# -Wshadow
|
||||
set_xcode_property(${target} GCC_WARN_SHADOW YES)
|
||||
|
||||
# -Wno-unknown-pragmas
|
||||
set_xcode_property(${target} GCC_WARN_UNKNOWN_PRAGMAS YES)
|
||||
|
||||
# -Wnon-virtual-dtor
|
||||
set_xcode_property(${target} GCC_WARN_NON_VIRTUAL_DESTRUCTOR YES)
|
||||
endmacro(initialize_xcode_cxx_build_settings)
|
||||
|
||||
# CMake 3.1 does not have this yet.
|
||||
set(CMAKE_CXX14_STANDARD_COMPILE_OPTION "-std=c++14")
|
||||
set(CMAKE_CXX14_EXTENSION_COMPILE_OPTION "-std=gnu++14")
|
||||
|
||||
@@ -54,6 +54,8 @@ mbgl_platform_node()
|
||||
|
||||
create_source_groups(mbgl-node)
|
||||
|
||||
initialize_xcode_cxx_build_settings(mbgl-node)
|
||||
|
||||
xcode_create_scheme(
|
||||
TARGET mbgl-node
|
||||
)
|
||||
|
||||
@@ -21,6 +21,8 @@ mbgl_platform_render()
|
||||
|
||||
create_source_groups(mbgl-render)
|
||||
|
||||
initialize_xcode_cxx_build_settings(mbgl-render)
|
||||
|
||||
xcode_create_scheme(
|
||||
TARGET mbgl-render
|
||||
OPTIONAL_ARGS
|
||||
|
||||
@@ -41,6 +41,8 @@ mbgl_platform_test()
|
||||
|
||||
create_source_groups(mbgl-test)
|
||||
|
||||
initialize_xcode_cxx_build_settings(mbgl-test)
|
||||
|
||||
xcode_create_scheme(
|
||||
TARGET mbgl-test
|
||||
OPTIONAL_ARGS
|
||||
|
||||
Reference in New Issue
Block a user