diff options
60 files changed, 818 insertions, 21 deletions
diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index 01987be..9e67703 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -47,6 +47,20 @@ The merge request will enter the `CMake Review Process`_ for consideration. .. _`commit messages`: Help/dev/review.rst#commit-messages .. _`CMake Review Process`: Help/dev/review.rst +CMake Dashboard Client +====================== + +The *integration testing* step of the `CMake Review Process`_ uses a set of +testing machines that follow an integration branch on their own schedule to +drive testing and submit results to the `CMake CDash Page`_. Anyone is +welcome to provide testing machines in order to help keep support for their +platforms working. + +See documentation on `CMake Testing Process`_ for more information. + +.. _`CMake CDash Page`: https://open.cdash.org/index.php?project=CMake +.. _`CMake Testing Process`: Help/dev/testing.rst + License ======= diff --git a/Help/dev/testing.rst b/Help/dev/testing.rst index 1b29acf..23d0ca3 100644 --- a/Help/dev/testing.rst +++ b/Help/dev/testing.rst @@ -26,13 +26,14 @@ commands to set up a new integration testing client: $ git clone https://gitlab.kitware.com/cmake/dashboard-scripts.git CMakeScripts $ cd CMakeScripts -The ``cmake_common.cmake`` script contains comments at the top with +The `cmake_common.cmake`_ script contains comments at the top with instructions to set up a testing client. As it instructs, create a CTest script with local settings and include ``cmake_common.cmake``. .. _`CMake Review Process`: review.rst .. _`CMake CDash Page`: https://open.cdash.org/index.php?project=CMake .. _`CMake Dashboard Scripts Repository`: https://gitlab.kitware.com/cmake/dashboard-scripts +.. _`cmake_common.cmake`: https://gitlab.kitware.com/cmake/dashboard-scripts/blob/master/cmake_common.cmake Nightly Start Time ------------------ diff --git a/Help/manual/cmake-properties.7.rst b/Help/manual/cmake-properties.7.rst index 274206f..c9a38fc 100644 --- a/Help/manual/cmake-properties.7.rst +++ b/Help/manual/cmake-properties.7.rst @@ -339,6 +339,24 @@ Properties on Targets /prop_tgt/XCODE_ATTRIBUTE_an-attribute /prop_tgt/XCODE_EXPLICIT_FILE_TYPE /prop_tgt/XCODE_PRODUCT_TYPE + /prop_tgt/XCODE_SCHEME_ADDRESS_SANITIZER + /prop_tgt/XCODE_SCHEME_ADDRESS_SANITIZER_USE_AFTER_RETURN + /prop_tgt/XCODE_SCHEME_THREAD_SANITIZER + /prop_tgt/XCODE_SCHEME_THREAD_SANITIZER_STOP + /prop_tgt/XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER + /prop_tgt/XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER_STOP + /prop_tgt/XCODE_SCHEME_DISABLE_MAIN_THREAD_CHECKER + /prop_tgt/XCODE_SCHEME_MAIN_THREAD_CHECKER_STOP + /prop_tgt/XCODE_SCHEME_MALLOC_SCRIBBLE + /prop_tgt/XCODE_SCHEME_MALLOC_GUARD_EDGES + /prop_tgt/XCODE_SCHEME_GUARD_MALLOC + /prop_tgt/XCODE_SCHEME_ZOMBIE_OBJECTS + /prop_tgt/XCODE_SCHEME_MALLOC_STACK + /prop_tgt/XCODE_SCHEME_DYNAMIC_LINKER_API_USAGE + /prop_tgt/XCODE_SCHEME_DYNAMIC_LIBRARY_LOADS + /prop_tgt/XCODE_SCHEME_EXECUTABLE + /prop_tgt/XCODE_SCHEME_ARGUMENTS + /prop_tgt/XCODE_SCHEME_ENVIRONMENT /prop_tgt/XCTEST .. _`Test Properties`: diff --git a/Help/manual/cmake-variables.7.rst b/Help/manual/cmake-variables.7.rst index 48b1f20..5a3cd81 100644 --- a/Help/manual/cmake-variables.7.rst +++ b/Help/manual/cmake-variables.7.rst @@ -204,6 +204,21 @@ Variables that Change Behavior /variable/CMAKE_WARN_DEPRECATED /variable/CMAKE_WARN_ON_ABSOLUTE_INSTALL_DESTINATION /variable/CMAKE_XCODE_GENERATE_TOP_LEVEL_PROJECT_ONLY + /variable/CMAKE_XCODE_SCHEME_ADDRESS_SANITIZER + /variable/CMAKE_XCODE_SCHEME_ADDRESS_SANITIZER_USE_AFTER_RETURN + /variable/CMAKE_XCODE_SCHEME_THREAD_SANITIZER + /variable/CMAKE_XCODE_SCHEME_THREAD_SANITIZER_STOP + /variable/CMAKE_XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER + /variable/CMAKE_XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER_STOP + /variable/CMAKE_XCODE_SCHEME_DISABLE_MAIN_THREAD_CHECKER + /variable/CMAKE_XCODE_SCHEME_MAIN_THREAD_CHECKER_STOP + /variable/CMAKE_XCODE_SCHEME_MALLOC_SCRIBBLE + /variable/CMAKE_XCODE_SCHEME_MALLOC_GUARD_EDGES + /variable/CMAKE_XCODE_SCHEME_GUARD_MALLOC + /variable/CMAKE_XCODE_SCHEME_ZOMBIE_OBJECTS + /variable/CMAKE_XCODE_SCHEME_MALLOC_STACK + /variable/CMAKE_XCODE_SCHEME_DYNAMIC_LINKER_API_USAGE + /variable/CMAKE_XCODE_SCHEME_DYNAMIC_LIBRARY_LOADS /variable/PackageName_ROOT Variables that Describe the System diff --git a/Help/prop_tgt/XCODE_SCHEME_ADDRESS_SANITIZER.rst b/Help/prop_tgt/XCODE_SCHEME_ADDRESS_SANITIZER.rst new file mode 100644 index 0000000..694cd77 --- /dev/null +++ b/Help/prop_tgt/XCODE_SCHEME_ADDRESS_SANITIZER.rst @@ -0,0 +1,12 @@ +XCODE_SCHEME_ADDRESS_SANITIZER +------------------------------ + +Whether to enable ``Address Sanitizer`` in the Diagnostics +section of the generated Xcode scheme. + +This property is initialized by the value of the variable +:variable:`CMAKE_XCODE_SCHEME_ADDRESS_SANITIZER` if it is set +when a target is created. + +Please refer to the :variable:`CMAKE_XCODE_GENERATE_SCHEME` variable +documentation to see all Xcode schema related properties. diff --git a/Help/prop_tgt/XCODE_SCHEME_ADDRESS_SANITIZER_USE_AFTER_RETURN.rst b/Help/prop_tgt/XCODE_SCHEME_ADDRESS_SANITIZER_USE_AFTER_RETURN.rst new file mode 100644 index 0000000..2803da0 --- /dev/null +++ b/Help/prop_tgt/XCODE_SCHEME_ADDRESS_SANITIZER_USE_AFTER_RETURN.rst @@ -0,0 +1,12 @@ +XCODE_SCHEME_ADDRESS_SANITIZER_USE_AFTER_RETURN +----------------------------------------------- + +Whether to enable ``Detect use of stack after return`` +in the Diagnostics section of the generated Xcode scheme. + +This property is initialized by the value of the variable +:variable:`CMAKE_XCODE_SCHEME_ADDRESS_SANITIZER_USE_AFTER_RETURN` +if it is set when a target is created. + +Please refer to the :variable:`CMAKE_XCODE_GENERATE_SCHEME` variable +documentation to see all Xcode schema related properties. diff --git a/Help/prop_tgt/XCODE_SCHEME_ARGUMENTS.rst b/Help/prop_tgt/XCODE_SCHEME_ARGUMENTS.rst new file mode 100644 index 0000000..2eac4a9 --- /dev/null +++ b/Help/prop_tgt/XCODE_SCHEME_ARGUMENTS.rst @@ -0,0 +1,10 @@ +XCODE_SCHEME_ARGUMENTS +---------------------- + +Specify command line arguments that should be added to the Arguments +section of the generated Xcode scheme. + +If set to a list of arguments those will be added to the scheme. + +Please refer to the :variable:`CMAKE_XCODE_GENERATE_SCHEME` variable +documentation to see all Xcode schema related properties. diff --git a/Help/prop_tgt/XCODE_SCHEME_DISABLE_MAIN_THREAD_CHECKER.rst b/Help/prop_tgt/XCODE_SCHEME_DISABLE_MAIN_THREAD_CHECKER.rst new file mode 100644 index 0000000..75fc326 --- /dev/null +++ b/Help/prop_tgt/XCODE_SCHEME_DISABLE_MAIN_THREAD_CHECKER.rst @@ -0,0 +1,12 @@ +XCODE_SCHEME_DISABLE_MAIN_THREAD_CHECKER +---------------------------------------- + +Whether to disable the ``Main Thread Checker`` +in the Diagnostics section of the generated Xcode scheme. + +This property is initialized by the value of the variable +:variable:`CMAKE_XCODE_SCHEME_DISABLE_MAIN_THREAD_CHECKER` +if it is set when a target is created. + +Please refer to the :variable:`CMAKE_XCODE_GENERATE_SCHEME` variable +documentation to see all Xcode schema related properties. diff --git a/Help/prop_tgt/XCODE_SCHEME_DYNAMIC_LIBRARY_LOADS.rst b/Help/prop_tgt/XCODE_SCHEME_DYNAMIC_LIBRARY_LOADS.rst new file mode 100644 index 0000000..a7fab66 --- /dev/null +++ b/Help/prop_tgt/XCODE_SCHEME_DYNAMIC_LIBRARY_LOADS.rst @@ -0,0 +1,12 @@ +XCODE_SCHEME_DYNAMIC_LIBRARY_LOADS +---------------------------------- + +Whether to enable ``Dynamic Library Loads`` +in the Diagnostics section of the generated Xcode scheme. + +This property is initialized by the value of the variable +:variable:`CMAKE_XCODE_SCHEME_DYNAMIC_LIBRARY_LOADS` if it is set +when a target is created. + +Please refer to the :variable:`CMAKE_XCODE_GENERATE_SCHEME` variable +documentation to see all Xcode schema related properties. diff --git a/Help/prop_tgt/XCODE_SCHEME_DYNAMIC_LINKER_API_USAGE.rst b/Help/prop_tgt/XCODE_SCHEME_DYNAMIC_LINKER_API_USAGE.rst new file mode 100644 index 0000000..162fc45 --- /dev/null +++ b/Help/prop_tgt/XCODE_SCHEME_DYNAMIC_LINKER_API_USAGE.rst @@ -0,0 +1,12 @@ +XCODE_SCHEME_DYNAMIC_LINKER_API_USAGE +------------------------------------- + +Whether to enable ``Dynamic Linker API usage`` +in the Diagnostics section of the generated Xcode scheme. + +This property is initialized by the value of the variable +:variable:`CMAKE_XCODE_SCHEME_DYNAMIC_LINKER_API_USAGE` if it is set +when a target is created. + +Please refer to the :variable:`CMAKE_XCODE_GENERATE_SCHEME` variable +documentation to see all Xcode schema related properties. diff --git a/Help/prop_tgt/XCODE_SCHEME_ENVIRONMENT.rst b/Help/prop_tgt/XCODE_SCHEME_ENVIRONMENT.rst new file mode 100644 index 0000000..1dbd6c4 --- /dev/null +++ b/Help/prop_tgt/XCODE_SCHEME_ENVIRONMENT.rst @@ -0,0 +1,12 @@ +XCODE_SCHEME_ENVIRONMENT +------------------------ + +Specify environment variables that should be added to the Arguments +section of the generated Xcode scheme. + +If set to a list of environment variables and values of the form +``MYVAR=value`` those environment variables will be added to the +scheme. + +Please refer to the :variable:`CMAKE_XCODE_GENERATE_SCHEME` variable +documentation to see all Xcode schema related properties. diff --git a/Help/prop_tgt/XCODE_SCHEME_EXECUTABLE.rst b/Help/prop_tgt/XCODE_SCHEME_EXECUTABLE.rst new file mode 100644 index 0000000..d0427e2 --- /dev/null +++ b/Help/prop_tgt/XCODE_SCHEME_EXECUTABLE.rst @@ -0,0 +1,9 @@ +XCODE_SCHEME_EXECUTABLE +----------------------- + +Specify path to executable in the Info section of the generated +Xcode scheme. If not set the schema generator will select the +current target if it is actually executable. + +Please refer to the :variable:`CMAKE_XCODE_GENERATE_SCHEME` variable +documentation to see all Xcode schema related properties. diff --git a/Help/prop_tgt/XCODE_SCHEME_GUARD_MALLOC.rst b/Help/prop_tgt/XCODE_SCHEME_GUARD_MALLOC.rst new file mode 100644 index 0000000..64e1990 --- /dev/null +++ b/Help/prop_tgt/XCODE_SCHEME_GUARD_MALLOC.rst @@ -0,0 +1,12 @@ +XCODE_SCHEME_GUARD_MALLOC +------------------------------ + +Whether to enable ``Guard Malloc`` +in the Diagnostics section of the generated Xcode scheme. + +This property is initialized by the value of the variable +:variable:`CMAKE_XCODE_SCHEME_GUARD_MALLOC` if it is set +when a target is created. + +Please refer to the :variable:`CMAKE_XCODE_GENERATE_SCHEME` variable +documentation to see all Xcode schema related properties. diff --git a/Help/prop_tgt/XCODE_SCHEME_MAIN_THREAD_CHECKER_STOP.rst b/Help/prop_tgt/XCODE_SCHEME_MAIN_THREAD_CHECKER_STOP.rst new file mode 100644 index 0000000..99c112f --- /dev/null +++ b/Help/prop_tgt/XCODE_SCHEME_MAIN_THREAD_CHECKER_STOP.rst @@ -0,0 +1,13 @@ +XCODE_SCHEME_MAIN_THREAD_CHECKER_STOP +------------------------------------- + +Whether to enable the ``Main Thread Checker`` option +``Pause on issues`` +in the Diagnostics section of the generated Xcode scheme. + +This property is initialized by the value of the variable +:variable:`CMAKE_XCODE_SCHEME_MAIN_THREAD_CHECKER_STOP` if it is set +when a target is created. + +Please refer to the :variable:`CMAKE_XCODE_GENERATE_SCHEME` variable +documentation to see all Xcode schema related properties. diff --git a/Help/prop_tgt/XCODE_SCHEME_MALLOC_GUARD_EDGES.rst b/Help/prop_tgt/XCODE_SCHEME_MALLOC_GUARD_EDGES.rst new file mode 100644 index 0000000..ef3852a --- /dev/null +++ b/Help/prop_tgt/XCODE_SCHEME_MALLOC_GUARD_EDGES.rst @@ -0,0 +1,12 @@ +XCODE_SCHEME_MALLOC_GUARD_EDGES +------------------------------- + +Whether to enable ``Malloc Guard Edges`` +in the Diagnostics section of the generated Xcode scheme. + +This property is initialized by the value of the variable +:variable:`CMAKE_XCODE_SCHEME_MALLOC_GUARD_EDGES` if it is set +when a target is created. + +Please refer to the :variable:`CMAKE_XCODE_GENERATE_SCHEME` variable +documentation to see all Xcode schema related properties. diff --git a/Help/prop_tgt/XCODE_SCHEME_MALLOC_SCRIBBLE.rst b/Help/prop_tgt/XCODE_SCHEME_MALLOC_SCRIBBLE.rst new file mode 100644 index 0000000..75baba2 --- /dev/null +++ b/Help/prop_tgt/XCODE_SCHEME_MALLOC_SCRIBBLE.rst @@ -0,0 +1,12 @@ +XCODE_SCHEME_MALLOC_SCRIBBLE +------------------------------ + +Whether to enable ``Malloc Scribble`` +in the Diagnostics section of the generated Xcode scheme. + +This property is initialized by the value of the variable +:variable:`CMAKE_XCODE_SCHEME_MALLOC_SCRIBBLE` if it is set +when a target is created. + +Please refer to the :variable:`CMAKE_XCODE_GENERATE_SCHEME` variable +documentation to see all Xcode schema related properties. diff --git a/Help/prop_tgt/XCODE_SCHEME_MALLOC_STACK.rst b/Help/prop_tgt/XCODE_SCHEME_MALLOC_STACK.rst new file mode 100644 index 0000000..984022c --- /dev/null +++ b/Help/prop_tgt/XCODE_SCHEME_MALLOC_STACK.rst @@ -0,0 +1,12 @@ +XCODE_SCHEME_MALLOC_STACK +------------------------- + +Whether to enable ``Malloc Stack`` in the Diagnostics +section of the generated Xcode scheme. + +This property is initialized by the value of the variable +:variable:`CMAKE_XCODE_SCHEME_MALLOC_STACK` if it is set +when a target is created. + +Please refer to the :variable:`CMAKE_XCODE_GENERATE_SCHEME` variable +documentation to see all Xcode schema related properties. diff --git a/Help/prop_tgt/XCODE_SCHEME_THREAD_SANITIZER.rst b/Help/prop_tgt/XCODE_SCHEME_THREAD_SANITIZER.rst new file mode 100644 index 0000000..825ac5b --- /dev/null +++ b/Help/prop_tgt/XCODE_SCHEME_THREAD_SANITIZER.rst @@ -0,0 +1,12 @@ +XCODE_SCHEME_THREAD_SANITIZER +----------------------------- + +Whether to enable ``Thread Sanitizer`` in the Diagnostics +section of the generated Xcode scheme. + +This property is initialized by the value of the variable +:variable:`CMAKE_XCODE_SCHEME_THREAD_SANITIZER` if it is set +when a target is created. + +Please refer to the :variable:`CMAKE_XCODE_GENERATE_SCHEME` variable +documentation to see all Xcode schema related properties. diff --git a/Help/prop_tgt/XCODE_SCHEME_THREAD_SANITIZER_STOP.rst b/Help/prop_tgt/XCODE_SCHEME_THREAD_SANITIZER_STOP.rst new file mode 100644 index 0000000..86f894e --- /dev/null +++ b/Help/prop_tgt/XCODE_SCHEME_THREAD_SANITIZER_STOP.rst @@ -0,0 +1,12 @@ +XCODE_SCHEME_THREAD_SANITIZER_STOP +---------------------------------- + +Whether to enable ``Thread Sanitizer - Pause on issues`` +in the Diagnostics section of the generated Xcode scheme. + +This property is initialized by the value of the variable +:variable:`CMAKE_XCODE_SCHEME_THREAD_SANITIZER_STOP` if it is set +when a target is created. + +Please refer to the :variable:`CMAKE_XCODE_GENERATE_SCHEME` variable +documentation to see all Xcode schema related properties. diff --git a/Help/prop_tgt/XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER.rst b/Help/prop_tgt/XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER.rst new file mode 100644 index 0000000..829a62e --- /dev/null +++ b/Help/prop_tgt/XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER.rst @@ -0,0 +1,12 @@ +XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER +------------------------------------------ + +Whether to enable ``Undefined Behavior Sanitizer`` +in the Diagnostics section of the generated Xcode scheme. + +This property is initialized by the value of the variable +:variable:`CMAKE_XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER` +if it is set when a target is created. + +Please refer to the :variable:`CMAKE_XCODE_GENERATE_SCHEME` variable +documentation to see all Xcode schema related properties. diff --git a/Help/prop_tgt/XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER_STOP.rst b/Help/prop_tgt/XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER_STOP.rst new file mode 100644 index 0000000..5e382ca --- /dev/null +++ b/Help/prop_tgt/XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER_STOP.rst @@ -0,0 +1,13 @@ +XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER_STOP +----------------------------------------------- + +Whether to enable ``Undefined Behavior Sanitizer`` option +``Pause on issues`` +in the Diagnostics section of the generated Xcode scheme. + +This property is initialized by the value of the variable +:variable:`CMAKE_XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER_STOP` +if it is set when a target is created. + +Please refer to the :variable:`CMAKE_XCODE_GENERATE_SCHEME` variable +documentation to see all Xcode schema related properties. diff --git a/Help/prop_tgt/XCODE_SCHEME_ZOMBIE_OBJECTS.rst b/Help/prop_tgt/XCODE_SCHEME_ZOMBIE_OBJECTS.rst new file mode 100644 index 0000000..80b954a --- /dev/null +++ b/Help/prop_tgt/XCODE_SCHEME_ZOMBIE_OBJECTS.rst @@ -0,0 +1,12 @@ +XCODE_SCHEME_ZOMBIE_OBJECTS +------------------------------ + +Whether to enable ``Zombie Objects`` +in the Diagnostics section of the generated Xcode scheme. + +This property is initialized by the value of the variable +:variable:`CMAKE_XCODE_SCHEME_ZOMBIE_OBJECTS` if it is set +when a target is created. + +Please refer to the :variable:`CMAKE_XCODE_GENERATE_SCHEME` variable +documentation to see all Xcode schema related properties. diff --git a/Help/release/dev/FindMatlab-mcc.rst b/Help/release/dev/FindMatlab-mcc.rst new file mode 100644 index 0000000..71387f3 --- /dev/null +++ b/Help/release/dev/FindMatlab-mcc.rst @@ -0,0 +1,5 @@ +FindMatlab-mcc +-------------- + +* The :module:`FindMatlab` module gained a new ``MCC_COMPILER`` + component to request finding the Matlab Compiler add-on. diff --git a/Help/release/dev/xcode_schemes_config.rst b/Help/release/dev/xcode_schemes_config.rst new file mode 100644 index 0000000..f9b5314 --- /dev/null +++ b/Help/release/dev/xcode_schemes_config.rst @@ -0,0 +1,5 @@ +xcode_schemes_config +-------------------- + +* The :generator:`Xcode` generator learned to configure more Xcode Scheme + fields. See the :variable:`CMAKE_XCODE_GENERATE_SCHEME` variable. diff --git a/Help/variable/CMAKE_XCODE_GENERATE_SCHEME.rst b/Help/variable/CMAKE_XCODE_GENERATE_SCHEME.rst index c9fcc92..ed20bbe 100644 --- a/Help/variable/CMAKE_XCODE_GENERATE_SCHEME.rst +++ b/Help/variable/CMAKE_XCODE_GENERATE_SCHEME.rst @@ -9,3 +9,31 @@ actions from the command line. The Xcode Schema Generator is still experimental and subject to change. + +The following target properties overwrite the default of the +corresponding settings on the "Diagnostic" tab for each schema file. +Each of those is initialized by the respective ``CMAKE_`` variable +at target creation time. + +- :prop_tgt:`XCODE_SCHEME_ADDRESS_SANITIZER` +- :prop_tgt:`XCODE_SCHEME_ADDRESS_SANITIZER_USE_AFTER_RETURN` +- :prop_tgt:`XCODE_SCHEME_THREAD_SANITIZER` +- :prop_tgt:`XCODE_SCHEME_THREAD_SANITIZER_STOP` +- :prop_tgt:`XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER` +- :prop_tgt:`XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER_STOP` +- :prop_tgt:`XCODE_SCHEME_DISABLE_MAIN_THREAD_CHECKER` +- :prop_tgt:`XCODE_SCHEME_MAIN_THREAD_CHECKER_STOP` +- :prop_tgt:`XCODE_SCHEME_MALLOC_SCRIBBLE` +- :prop_tgt:`XCODE_SCHEME_MALLOC_GUARD_EDGES` +- :prop_tgt:`XCODE_SCHEME_GUARD_MALLOC` +- :prop_tgt:`XCODE_SCHEME_ZOMBIE_OBJECTS` +- :prop_tgt:`XCODE_SCHEME_MALLOC_STACK` +- :prop_tgt:`XCODE_SCHEME_DYNAMIC_LINKER_API_USAGE` +- :prop_tgt:`XCODE_SCHEME_DYNAMIC_LIBRARY_LOADS` + +The following target properties will be applied on the +"Info" and "Arguments" tab: + +- :prop_tgt:`XCODE_SCHEME_EXECUTABLE` +- :prop_tgt:`XCODE_SCHEME_ARGUMENTS` +- :prop_tgt:`XCODE_SCHEME_ENVIRONMENT` diff --git a/Help/variable/CMAKE_XCODE_SCHEME_ADDRESS_SANITIZER.rst b/Help/variable/CMAKE_XCODE_SCHEME_ADDRESS_SANITIZER.rst new file mode 100644 index 0000000..37dc0ce --- /dev/null +++ b/Help/variable/CMAKE_XCODE_SCHEME_ADDRESS_SANITIZER.rst @@ -0,0 +1,12 @@ +CMAKE_XCODE_SCHEME_ADDRESS_SANITIZER +------------------------------------ + +Whether to enable ``Address Sanitizer`` in the Diagnostics +section of the generated Xcode scheme. + +This variable initializes the +:prop_tgt:`XCODE_SCHEME_ADDRESS_SANITIZER` +property on all targets. + +Please refer to the :variable:`CMAKE_XCODE_GENERATE_SCHEME` variable +documentation to see all Xcode schema related properties. diff --git a/Help/variable/CMAKE_XCODE_SCHEME_ADDRESS_SANITIZER_USE_AFTER_RETURN.rst b/Help/variable/CMAKE_XCODE_SCHEME_ADDRESS_SANITIZER_USE_AFTER_RETURN.rst new file mode 100644 index 0000000..05949c3 --- /dev/null +++ b/Help/variable/CMAKE_XCODE_SCHEME_ADDRESS_SANITIZER_USE_AFTER_RETURN.rst @@ -0,0 +1,12 @@ +CMAKE_XCODE_SCHEME_ADDRESS_SANITIZER_USE_AFTER_RETURN +----------------------------------------------------- + +Whether to enable ``Detect use of stack after return`` +in the Diagnostics section of the generated Xcode scheme. + +This variable initializes the +:prop_tgt:`XCODE_SCHEME_ADDRESS_SANITIZER_USE_AFTER_RETURN` +property on all targets. + +Please refer to the :variable:`CMAKE_XCODE_GENERATE_SCHEME` variable +documentation to see all Xcode schema related properties. diff --git a/Help/variable/CMAKE_XCODE_SCHEME_DISABLE_MAIN_THREAD_CHECKER.rst b/Help/variable/CMAKE_XCODE_SCHEME_DISABLE_MAIN_THREAD_CHECKER.rst new file mode 100644 index 0000000..81f4974 --- /dev/null +++ b/Help/variable/CMAKE_XCODE_SCHEME_DISABLE_MAIN_THREAD_CHECKER.rst @@ -0,0 +1,12 @@ +CMAKE_XCODE_SCHEME_DISABLE_MAIN_THREAD_CHECKER +---------------------------------------------- + +Whether to disable the ``Main Thread Checker`` +in the Diagnostics section of the generated Xcode scheme. + +This variable initializes the +:prop_tgt:`XCODE_SCHEME_DISABLE_MAIN_THREAD_CHECKER` +property on all targets. + +Please refer to the :variable:`CMAKE_XCODE_GENERATE_SCHEME` variable +documentation to see all Xcode schema related properties. diff --git a/Help/variable/CMAKE_XCODE_SCHEME_DYNAMIC_LIBRARY_LOADS.rst b/Help/variable/CMAKE_XCODE_SCHEME_DYNAMIC_LIBRARY_LOADS.rst new file mode 100644 index 0000000..5e133ac --- /dev/null +++ b/Help/variable/CMAKE_XCODE_SCHEME_DYNAMIC_LIBRARY_LOADS.rst @@ -0,0 +1,12 @@ +CMAKE_XCODE_SCHEME_DYNAMIC_LIBRARY_LOADS +---------------------------------------- + +Whether to enable ``Dynamic Library Loads`` +in the Diagnostics section of the generated Xcode scheme. + +This variable initializes the +:prop_tgt:`XCODE_SCHEME_DYNAMIC_LIBRARY_LOADS` +property on all targets. + +Please refer to the :variable:`CMAKE_XCODE_GENERATE_SCHEME` variable +documentation to see all Xcode schema related properties. diff --git a/Help/variable/CMAKE_XCODE_SCHEME_DYNAMIC_LINKER_API_USAGE.rst b/Help/variable/CMAKE_XCODE_SCHEME_DYNAMIC_LINKER_API_USAGE.rst new file mode 100644 index 0000000..33162d9 --- /dev/null +++ b/Help/variable/CMAKE_XCODE_SCHEME_DYNAMIC_LINKER_API_USAGE.rst @@ -0,0 +1,12 @@ +CMAKE_XCODE_SCHEME_DYNAMIC_LINKER_API_USAGE +------------------------------------------- + +Whether to enable ``Dynamic Linker API usage`` +in the Diagnostics section of the generated Xcode scheme. + +This variable initializes the +:prop_tgt:`XCODE_SCHEME_DYNAMIC_LINKER_API_USAGE` +property on all targets. + +Please refer to the :variable:`CMAKE_XCODE_GENERATE_SCHEME` variable +documentation to see all Xcode schema related properties. diff --git a/Help/variable/CMAKE_XCODE_SCHEME_GUARD_MALLOC.rst b/Help/variable/CMAKE_XCODE_SCHEME_GUARD_MALLOC.rst new file mode 100644 index 0000000..03d88c2 --- /dev/null +++ b/Help/variable/CMAKE_XCODE_SCHEME_GUARD_MALLOC.rst @@ -0,0 +1,12 @@ +CMAKE_XCODE_SCHEME_GUARD_MALLOC +------------------------------- + +Whether to enable ``Guard Malloc`` +in the Diagnostics section of the generated Xcode scheme. + +This variable initializes the +:prop_tgt:`XCODE_SCHEME_GUARD_MALLOC` +property on all targets. + +Please refer to the :variable:`CMAKE_XCODE_GENERATE_SCHEME` variable +documentation to see all Xcode schema related properties. diff --git a/Help/variable/CMAKE_XCODE_SCHEME_MAIN_THREAD_CHECKER_STOP.rst b/Help/variable/CMAKE_XCODE_SCHEME_MAIN_THREAD_CHECKER_STOP.rst new file mode 100644 index 0000000..fd6135f --- /dev/null +++ b/Help/variable/CMAKE_XCODE_SCHEME_MAIN_THREAD_CHECKER_STOP.rst @@ -0,0 +1,13 @@ +CMAKE_XCODE_SCHEME_MAIN_THREAD_CHECKER_STOP +------------------------------------------- + +Whether to enable the ``Main Thread Checker`` option +``Pause on issues`` +in the Diagnostics section of the generated Xcode scheme. + +This variable initializes the +:prop_tgt:`XCODE_SCHEME_MAIN_THREAD_CHECKER_STOP` +property on all targets. + +Please refer to the :variable:`CMAKE_XCODE_GENERATE_SCHEME` variable +documentation to see all Xcode schema related properties. diff --git a/Help/variable/CMAKE_XCODE_SCHEME_MALLOC_GUARD_EDGES.rst b/Help/variable/CMAKE_XCODE_SCHEME_MALLOC_GUARD_EDGES.rst new file mode 100644 index 0000000..8fedc20 --- /dev/null +++ b/Help/variable/CMAKE_XCODE_SCHEME_MALLOC_GUARD_EDGES.rst @@ -0,0 +1,12 @@ +CMAKE_XCODE_SCHEME_MALLOC_GUARD_EDGES +------------------------------------- + +Whether to enable ``Malloc Guard Edges`` +in the Diagnostics section of the generated Xcode scheme. + +This variable initializes the +:prop_tgt:`XCODE_SCHEME_MALLOC_GUARD_EDGES` +property on all targets. + +Please refer to the :variable:`CMAKE_XCODE_GENERATE_SCHEME` variable +documentation to see all Xcode schema related properties. diff --git a/Help/variable/CMAKE_XCODE_SCHEME_MALLOC_SCRIBBLE.rst b/Help/variable/CMAKE_XCODE_SCHEME_MALLOC_SCRIBBLE.rst new file mode 100644 index 0000000..cddca7c --- /dev/null +++ b/Help/variable/CMAKE_XCODE_SCHEME_MALLOC_SCRIBBLE.rst @@ -0,0 +1,12 @@ +CMAKE_XCODE_SCHEME_MALLOC_SCRIBBLE +---------------------------------- + +Whether to enable ``Malloc Scribble`` +in the Diagnostics section of the generated Xcode scheme. + +This variable initializes the +:prop_tgt:`XCODE_SCHEME_MALLOC_SCRIBBLE` +property on all targets. + +Please refer to the :variable:`CMAKE_XCODE_GENERATE_SCHEME` variable +documentation to see all Xcode schema related properties. diff --git a/Help/variable/CMAKE_XCODE_SCHEME_MALLOC_STACK.rst b/Help/variable/CMAKE_XCODE_SCHEME_MALLOC_STACK.rst new file mode 100644 index 0000000..9c83698 --- /dev/null +++ b/Help/variable/CMAKE_XCODE_SCHEME_MALLOC_STACK.rst @@ -0,0 +1,12 @@ +CMAKE_XCODE_SCHEME_MALLOC_STACK +------------------------------- + +Whether to enable ``Malloc Stack`` in the Diagnostics +section of the generated Xcode scheme. + +This variable initializes the +:prop_tgt:`XCODE_SCHEME_MALLOC_STACK` +property on all targets. + +Please refer to the :variable:`CMAKE_XCODE_GENERATE_SCHEME` variable +documentation to see all Xcode schema related properties. diff --git a/Help/variable/CMAKE_XCODE_SCHEME_THREAD_SANITIZER.rst b/Help/variable/CMAKE_XCODE_SCHEME_THREAD_SANITIZER.rst new file mode 100644 index 0000000..c937369 --- /dev/null +++ b/Help/variable/CMAKE_XCODE_SCHEME_THREAD_SANITIZER.rst @@ -0,0 +1,12 @@ +CMAKE_XCODE_SCHEME_THREAD_SANITIZER +----------------------------------- + +Whether to enable ``Thread Sanitizer`` in the Diagnostics +section of the generated Xcode scheme. + +This variable initializes the +:prop_tgt:`XCODE_SCHEME_THREAD_SANITIZER` +property on all targets. + +Please refer to the :variable:`CMAKE_XCODE_GENERATE_SCHEME` variable +documentation to see all Xcode schema related properties. diff --git a/Help/variable/CMAKE_XCODE_SCHEME_THREAD_SANITIZER_STOP.rst b/Help/variable/CMAKE_XCODE_SCHEME_THREAD_SANITIZER_STOP.rst new file mode 100644 index 0000000..eed796c --- /dev/null +++ b/Help/variable/CMAKE_XCODE_SCHEME_THREAD_SANITIZER_STOP.rst @@ -0,0 +1,12 @@ +CMAKE_XCODE_SCHEME_THREAD_SANITIZER_STOP +---------------------------------------- + +Whether to enable ``Thread Sanitizer - Pause on issues`` +in the Diagnostics section of the generated Xcode scheme. + +This variable initializes the +:prop_tgt:`XCODE_SCHEME_THREAD_SANITIZER_STOP` +property on all targets. + +Please refer to the :variable:`CMAKE_XCODE_GENERATE_SCHEME` variable +documentation to see all Xcode schema related properties. diff --git a/Help/variable/CMAKE_XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER.rst b/Help/variable/CMAKE_XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER.rst new file mode 100644 index 0000000..d14ba3f --- /dev/null +++ b/Help/variable/CMAKE_XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER.rst @@ -0,0 +1,12 @@ +CMAKE_XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER +------------------------------------------------ + +Whether to enable ``Undefined Behavior Sanitizer`` +in the Diagnostics section of the generated Xcode scheme. + +This variable initializes the +:prop_tgt:`XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER` +property on all targets. + +Please refer to the :variable:`CMAKE_XCODE_GENERATE_SCHEME` variable +documentation to see all Xcode schema related properties. diff --git a/Help/variable/CMAKE_XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER_STOP.rst b/Help/variable/CMAKE_XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER_STOP.rst new file mode 100644 index 0000000..f8df304 --- /dev/null +++ b/Help/variable/CMAKE_XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER_STOP.rst @@ -0,0 +1,13 @@ +CMAKE_XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER_STOP +----------------------------------------------------- + +Whether to enable ``Undefined Behavior Sanitizer`` option +``Pause on issues`` +in the Diagnostics section of the generated Xcode scheme. + +This variable initializes the +:prop_tgt:`XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER_STOP` +property on all targets. + +Please refer to the :variable:`CMAKE_XCODE_GENERATE_SCHEME` variable +documentation to see all Xcode schema related properties. diff --git a/Help/variable/CMAKE_XCODE_SCHEME_ZOMBIE_OBJECTS.rst b/Help/variable/CMAKE_XCODE_SCHEME_ZOMBIE_OBJECTS.rst new file mode 100644 index 0000000..efc331a --- /dev/null +++ b/Help/variable/CMAKE_XCODE_SCHEME_ZOMBIE_OBJECTS.rst @@ -0,0 +1,12 @@ +CMAKE_XCODE_SCHEME_ZOMBIE_OBJECTS +--------------------------------- + +Whether to enable ``Zombie Objects`` +in the Diagnostics section of the generated Xcode scheme. + +This variable initializes the +:prop_tgt:`XCODE_SCHEME_ZOMBIE_OBJECTS` +property on all targets. + +Please refer to the :variable:`CMAKE_XCODE_GENERATE_SCHEME` variable +documentation to see all Xcode schema related properties. diff --git a/Modules/Compiler/NAG-Fortran.cmake b/Modules/Compiler/NAG-Fortran.cmake index 39aae18..9973feb 100644 --- a/Modules/Compiler/NAG-Fortran.cmake +++ b/Modules/Compiler/NAG-Fortran.cmake @@ -34,3 +34,4 @@ set(CMAKE_Fortran_FORMAT_FIXED_FLAG "-fixed") set(CMAKE_Fortran_FORMAT_FREE_FLAG "-free") set(CMAKE_Fortran_COMPILE_OPTIONS_PIC "-PIC") set(CMAKE_Fortran_COMPILE_OPTIONS_PIE "-PIC") +set(CMAKE_Fortran_RESPONSE_FILE_LINK_FLAG "-Wl,@") diff --git a/Modules/Compiler/XL.cmake b/Modules/Compiler/XL.cmake index a1d7ca1..21fe5e8 100644 --- a/Modules/Compiler/XL.cmake +++ b/Modules/Compiler/XL.cmake @@ -20,6 +20,7 @@ macro(__compiler_xl lang) # Feature flags. set(CMAKE_${lang}_VERBOSE_FLAG "-V") set(CMAKE_${lang}_COMPILE_OPTIONS_PIC "-qpic") + set(CMAKE_${lang}_COMPILE_OPTIONS_PIE "-qpic") set(CMAKE_${lang}_RESPONSE_FILE_FLAG "-qoptfile=") set(CMAKE_${lang}_RESPONSE_FILE_LINK_FLAG "-qoptfile=") diff --git a/Modules/FindCUDA/select_compute_arch.cmake b/Modules/FindCUDA/select_compute_arch.cmake index 22c04df..cf4fc39 100644 --- a/Modules/FindCUDA/select_compute_arch.cmake +++ b/Modules/FindCUDA/select_compute_arch.cmake @@ -18,8 +18,9 @@ # if(CMAKE_CUDA_COMPILER_LOADED) # CUDA as a language - if(CMAKE_CUDA_COMPILER_ID STREQUAL "NVIDIA") - set(CUDA_VERSION "${CMAKE_CUDA_COMPILER_VERSION}") + if(CMAKE_CUDA_COMPILER_ID STREQUAL "NVIDIA" + AND CMAKE_CUDA_COMPILER_VERSION MATCHES "^([0-9]+\\.[0-9]+)") + set(CUDA_VERSION "${CMAKE_MATCH_1}") endif() endif() diff --git a/Modules/FindMatlab.cmake b/Modules/FindMatlab.cmake index 54e62db..9e13fc3 100644 --- a/Modules/FindMatlab.cmake +++ b/Modules/FindMatlab.cmake @@ -25,6 +25,7 @@ # available on the MCR version, and will yield an error if the MCR is found # instead of the regular Matlab installation. # * ``MEX_COMPILER`` the MEX compiler. +# * ``MCC_COMPILER`` the MCC compiler, included with the Matlab Compiler add-on. # * ``SIMULINK`` the Simulink environment. # # .. note:: @@ -110,7 +111,10 @@ # the whole set of libraries of Matlab # ``Matlab_MEX_COMPILER`` # the mex compiler of Matlab. Currently not used. -# Available only if the component ``MEX_COMPILER`` is asked +# Available only if the component ``MEX_COMPILER`` is requested. +# ``Matlab_MCC_COMPILER`` +# the mcc compiler of Matlab. Included with the Matlab Compiler add-on. +# Available only if the component ``MCC_COMPILER`` is requested. # # Cached variables # """""""""""""""" @@ -1369,7 +1373,7 @@ else() # if the user does not specify the possible installation root, we look for # one installation using the appropriate heuristics. # There is apparently no standard way on Linux. - if(WIN32) + if(CMAKE_HOST_WIN32) _Matlab_find_instances_win32(_matlab_possible_roots_win32) list(APPEND _matlab_possible_roots ${_matlab_possible_roots_win32}) elseif(APPLE) @@ -1420,6 +1424,7 @@ if(DEFINED Matlab_ROOT_DIR_LAST_CACHED) Matlab_INCLUDE_DIRS Matlab_MEX_LIBRARY Matlab_MEX_COMPILER + Matlab_MCC_COMPILER Matlab_MAIN_PROGRAM Matlab_MX_LIBRARY Matlab_ENG_LIBRARY @@ -1660,6 +1665,22 @@ if(_matlab_find_simulink GREATER -1) endif() unset(_matlab_find_simulink) +# component MCC Compiler +list(FIND Matlab_FIND_COMPONENTS MCC_COMPILER _matlab_find_mcc_compiler) +if(_matlab_find_mcc_compiler GREATER -1) + find_program( + Matlab_MCC_COMPILER + "mcc" + PATHS ${Matlab_BINARIES_DIR} + DOC "Matlab MCC compiler" + NO_DEFAULT_PATH + ) + if(Matlab_MCC_COMPILER) + set(Matlab_MCC_COMPILER_FOUND TRUE) + endif() +endif() +unset(_matlab_find_mcc_compiler) + unset(_matlab_lib_dir_for_search) set(Matlab_LIBRARIES ${Matlab_MEX_LIBRARY} ${Matlab_MX_LIBRARY} ${Matlab_ENG_LIBRARY} ${Matlab_MAT_LIBRARY}) @@ -6,10 +6,12 @@ Introduction CMake is a cross-platform, open-source build system generator. For full documentation visit the `CMake Home Page`_ and the -`CMake Documentation Page`_. +`CMake Documentation Page`_. The `CMake Community Wiki`_ also +references useful guides and recipes. .. _`CMake Home Page`: https://cmake.org .. _`CMake Documentation Page`: https://cmake.org/cmake/help/documentation.html +.. _`CMake Community Wiki`: https://gitlab.kitware.com/cmake/community/wikis/home CMake is maintained and supported by `Kitware`_ and developed in collaboration with a productive community of contributors. diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 7363afe..209769e 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,5 +1,5 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 12) -set(CMake_VERSION_PATCH 20180803) +set(CMake_VERSION_PATCH 20180806) #set(CMake_VERSION_RC 1) diff --git a/Source/Checks/cm_cxx14_check.cmake b/Source/Checks/cm_cxx14_check.cmake index a78ba35..38606b9 100644 --- a/Source/Checks/cm_cxx14_check.cmake +++ b/Source/Checks/cm_cxx14_check.cmake @@ -1,5 +1,5 @@ set(CMake_CXX14_BROKEN 0) -if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang") +if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang|PGI") if(NOT CMAKE_CXX14_STANDARD_COMPILE_OPTION) set(CMake_CXX14_WORKS 0) endif() diff --git a/Source/Checks/cm_cxx14_check.cpp b/Source/Checks/cm_cxx14_check.cpp index f5806a9..9369ba2 100644 --- a/Source/Checks/cm_cxx14_check.cpp +++ b/Source/Checks/cm_cxx14_check.cpp @@ -1,5 +1,8 @@ #include <cstdio> +#include <memory> + int main() { - return 0; + std::unique_ptr<int> u(new int(0)); + return *u; } diff --git a/Source/Checks/cm_cxx17_check.cmake b/Source/Checks/cm_cxx17_check.cmake index 83d3971..4da2fd7 100644 --- a/Source/Checks/cm_cxx17_check.cmake +++ b/Source/Checks/cm_cxx17_check.cmake @@ -1,5 +1,5 @@ set(CMake_CXX17_BROKEN 0) -if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang") +if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang|PGI") if(NOT CMAKE_CXX17_STANDARD_COMPILE_OPTION) set(CMake_CXX17_WORKS 0) endif() diff --git a/Source/Checks/cm_cxx17_check.cpp b/Source/Checks/cm_cxx17_check.cpp index 2cbf1d5..4e89184 100644 --- a/Source/Checks/cm_cxx17_check.cpp +++ b/Source/Checks/cm_cxx17_check.cpp @@ -1,7 +1,9 @@ #include <cstdio> +#include <memory> #include <unordered_map> int main() { - return 0; + std::unique_ptr<int> u(new int(0)); + return *u; } diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx index 4c288f5..402ceb2 100644 --- a/Source/cmFileCommand.cxx +++ b/Source/cmFileCommand.cxx @@ -208,16 +208,20 @@ bool cmFileCommand::HandleWriteCommand(std::vector<std::string> const& args, cmSystemTools::MakeDirectory(dir); mode_t mode = 0; + bool writable = false; // Set permissions to writable if (cmSystemTools::GetPermissions(fileName.c_str(), mode)) { - cmSystemTools::SetPermissions(fileName.c_str(), #if defined(_MSC_VER) || defined(__MINGW32__) - mode | S_IWRITE + writable = mode & S_IWRITE; + mode_t newMode = mode | S_IWRITE; #else - mode | S_IWUSR | S_IWGRP + writable = mode & S_IWUSR; + mode_t newMode = mode | S_IWUSR | S_IWGRP; #endif - ); + if (!writable) { + cmSystemTools::SetPermissions(fileName.c_str(), newMode); + } } // If GetPermissions fails, pretend like it is ok. File open will fail if // the file is not writable @@ -242,7 +246,7 @@ bool cmFileCommand::HandleWriteCommand(std::vector<std::string> const& args, return false; } file.close(); - if (mode) { + if (mode && !writable) { cmSystemTools::SetPermissions(fileName.c_str(), mode); } return true; diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h index e0b97d2..1ed070e 100644 --- a/Source/cmGlobalGenerator.h +++ b/Source/cmGlobalGenerator.h @@ -353,6 +353,8 @@ public: i.e. "Can I build Debug and Release in the same tree?" */ virtual bool IsMultiConfig() const { return false; } + virtual bool IsXcode() const { return false; } + /** Return true if we know the exact location of object files. If false, store the reason in the given string. This is meaningful only after EnableLanguage has been called. */ diff --git a/Source/cmGlobalXCodeGenerator.h b/Source/cmGlobalXCodeGenerator.h index f7bca13..62f7030 100644 --- a/Source/cmGlobalXCodeGenerator.h +++ b/Source/cmGlobalXCodeGenerator.h @@ -96,6 +96,8 @@ public: i.e. "Can I build Debug and Release in the same tree?" */ bool IsMultiConfig() const override; + bool IsXcode() const override { return true; } + bool HasKnownObjectFileLocation(std::string* reason) const override; bool IsIPOSupported() const override { return true; } diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 803a0a9..380ac88 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -278,6 +278,31 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type, this->SetPropertyDefault("LINK_SEARCH_START_STATIC", nullptr); this->SetPropertyDefault("LINK_SEARCH_END_STATIC", nullptr); this->SetPropertyDefault("FOLDER", nullptr); +#ifdef __APPLE__ + if (this->GetGlobalGenerator()->IsXcode()) { + this->SetPropertyDefault("XCODE_SCHEME_ADDRESS_SANITIZER", nullptr); + this->SetPropertyDefault( + "XCODE_SCHEME_ADDRESS_SANITIZER_USE_AFTER_RETURN", nullptr); + this->SetPropertyDefault("XCODE_SCHEME_THREAD_SANITIZER", nullptr); + this->SetPropertyDefault("XCODE_SCHEME_THREAD_SANITIZER_STOP", nullptr); + this->SetPropertyDefault("XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER", + nullptr); + this->SetPropertyDefault( + "XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER_STOP", nullptr); + this->SetPropertyDefault("XCODE_SCHEME_DISABLE_MAIN_THREAD_CHECKER", + nullptr); + this->SetPropertyDefault("XCODE_SCHEME_MAIN_THREAD_CHECKER_STOP", + nullptr); + this->SetPropertyDefault("XCODE_SCHEME_MALLOC_SCRIBBLE", nullptr); + this->SetPropertyDefault("XCODE_SCHEME_MALLOC_GUARD_EDGES", nullptr); + this->SetPropertyDefault("XCODE_SCHEME_GUARD_MALLOC", nullptr); + this->SetPropertyDefault("XCODE_SCHEME_ZOMBIE_OBJECTS", nullptr); + this->SetPropertyDefault("XCODE_SCHEME_MALLOC_STACK", nullptr); + this->SetPropertyDefault("XCODE_SCHEME_DYNAMIC_LINKER_API_USAGE", + nullptr); + this->SetPropertyDefault("XCODE_SCHEME_DYNAMIC_LIBRARY_LOADS", nullptr); + } +#endif } // Collect the set of configuration types. diff --git a/Source/cmWriteFileCommand.cxx b/Source/cmWriteFileCommand.cxx index d3d2db0..c504ef4 100644 --- a/Source/cmWriteFileCommand.cxx +++ b/Source/cmWriteFileCommand.cxx @@ -45,16 +45,20 @@ bool cmWriteFileCommand::InitialPass(std::vector<std::string> const& args, cmSystemTools::MakeDirectory(dir); mode_t mode = 0; + bool writable = false; // Set permissions to writable if (cmSystemTools::GetPermissions(fileName.c_str(), mode)) { - cmSystemTools::SetPermissions(fileName.c_str(), #if defined(_MSC_VER) || defined(__MINGW32__) - mode | S_IWRITE + writable = mode & S_IWRITE; + mode_t newMode = mode | S_IWRITE; #else - mode | S_IWUSR | S_IWGRP + writable = mode & S_IWUSR; + mode_t newMode = mode | S_IWUSR | S_IWGRP; #endif - ); + if (!writable) { + cmSystemTools::SetPermissions(fileName.c_str(), newMode); + } } // If GetPermissions fails, pretend like it is ok. File open will fail if // the file is not writable @@ -69,7 +73,7 @@ bool cmWriteFileCommand::InitialPass(std::vector<std::string> const& args, } file << message << std::endl; file.close(); - if (mode) { + if (mode && !writable) { cmSystemTools::SetPermissions(fileName.c_str(), mode); } diff --git a/Source/cmXCodeScheme.cxx b/Source/cmXCodeScheme.cxx index f1dce64..58cb9c9 100644 --- a/Source/cmXCodeScheme.cxx +++ b/Source/cmXCodeScheme.cxx @@ -143,6 +143,41 @@ void cmXCodeScheme::WriteLaunchAction(cmXMLWriter& xout, xout.Attribute("debugServiceExtension", "internal"); xout.Attribute("allowLocationSimulation", "YES"); + // Diagnostics tab begin + + bool useAddressSanitizer = WriteLaunchActionAttribute( + xout, "enableAddressSanitizer", + "XCODE_SCHEME_ADDRESS_SANITIZER"); // not allowed with + // enableThreadSanitizer=YES + WriteLaunchActionAttribute( + xout, "enableASanStackUseAfterReturn", + "XCODE_SCHEME_ADDRESS_SANITIZER_USE_AFTER_RETURN"); + + bool useThreadSanitizer = false; + if (!useAddressSanitizer) { + useThreadSanitizer = WriteLaunchActionAttribute( + xout, "enableThreadSanitizer", + "XCODE_SCHEME_THREAD_SANITIZER"); // not allowed with + // enableAddressSanitizer=YES + } + + WriteLaunchActionAttribute(xout, "stopOnEveryThreadSanitizerIssue", + "XCODE_SCHEME_THREAD_SANITIZER_STOP"); + + WriteLaunchActionAttribute(xout, "enableUBSanitizer", + "XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER"); + WriteLaunchActionAttribute( + xout, "stopOnEveryUBSanitizerIssue", + "XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER_STOP"); + + WriteLaunchActionAttribute( + xout, "disableMainThreadChecker", + "XCODE_SCHEME_DISABLE_MAIN_THREAD_CHECKER"); // negative enabled! + WriteLaunchActionAttribute(xout, "stopOnEveryMainThreadCheckerIssue", + "XCODE_SCHEME_MAIN_THREAD_CHECKER_STOP"); + + // Diagnostics tab end + if (IsExecutable(this->Target)) { xout.StartElement("BuildableProductRunnable"); xout.BreakAttributes(); @@ -156,12 +191,144 @@ void cmXCodeScheme::WriteLaunchAction(cmXMLWriter& xout, xout.EndElement(); // MacroExpansion + // Info tab begin + + if (const char* exe = + this->Target->GetTarget()->GetProperty("XCODE_SCHEME_EXECUTABLE")) { + + xout.StartElement("PathRunnable"); + xout.BreakAttributes(); + + xout.Attribute("runnableDebuggingMode", "0"); + xout.Attribute("FilePath", exe); + + xout.EndElement(); // PathRunnable + } + + // Info tab end + + // Arguments tab begin + + if (const char* argList = + this->Target->GetTarget()->GetProperty("XCODE_SCHEME_ARGUMENTS")) { + std::vector<std::string> arguments; + cmSystemTools::ExpandListArgument(argList, arguments); + if (!arguments.empty()) { + xout.StartElement("CommandLineArguments"); + + for (auto argument : arguments) { + xout.StartElement("CommandLineArgument"); + xout.BreakAttributes(); + + xout.Attribute("argument", argument); + xout.Attribute("isEnabled", "YES"); + + xout.EndElement(); // CommandLineArgument + } + + xout.EndElement(); // CommandLineArguments + } + } + + if (const char* envList = + this->Target->GetTarget()->GetProperty("XCODE_SCHEME_ENVIRONMENT")) { + std::vector<std::string> envs; + cmSystemTools::ExpandListArgument(envList, envs); + if (!envs.empty()) { + xout.StartElement("EnvironmentVariables"); + + for (auto env : envs) { + + xout.StartElement("EnvironmentVariable"); + xout.BreakAttributes(); + + std::string envValue; + const auto p = env.find_first_of('='); + if (p != std::string::npos) { + envValue = env.substr(p + 1); + env.resize(p); + } + + xout.Attribute("key", env); + xout.Attribute("value", envValue); + xout.Attribute("isEnabled", "YES"); + + xout.EndElement(); // EnvironmentVariable + } + + xout.EndElement(); // EnvironmentVariables + } + } + + // Arguments tab end + xout.StartElement("AdditionalOptions"); + + if (!useThreadSanitizer) { + WriteLaunchActionAdditionalOption(xout, "MallocScribble", "", + "XCODE_SCHEME_MALLOC_SCRIBBLE"); + } + + if (!useThreadSanitizer && !useAddressSanitizer) { + WriteLaunchActionAdditionalOption(xout, "MallocGuardEdges", "", + "XCODE_SCHEME_MALLOC_GUARD_EDGES"); + } + + if (!useThreadSanitizer && !useAddressSanitizer) { + WriteLaunchActionAdditionalOption(xout, "DYLD_INSERT_LIBRARIES", + "/usr/lib/libgmalloc.dylib", + "XCODE_SCHEME_GUARD_MALLOC"); + } + + WriteLaunchActionAdditionalOption(xout, "NSZombieEnabled", "YES", + "XCODE_SCHEME_ZOMBIE_OBJECTS"); + + if (!useThreadSanitizer && !useAddressSanitizer) { + WriteLaunchActionAdditionalOption(xout, "MallocStackLogging", "", + "XCODE_SCHEME_MALLOC_STACK"); + } + + WriteLaunchActionAdditionalOption(xout, "DYLD_PRINT_APIS", "", + "XCODE_SCHEME_DYNAMIC_LINKER_API_USAGE"); + + WriteLaunchActionAdditionalOption(xout, "DYLD_PRINT_LIBRARIES", "", + "XCODE_SCHEME_DYNAMIC_LIBRARY_LOADS"); + xout.EndElement(); xout.EndElement(); // LaunchAction } +bool cmXCodeScheme::WriteLaunchActionAttribute(cmXMLWriter& xout, + const std::string& attrName, + const std::string& varName) +{ + if (Target->GetTarget()->GetPropertyAsBool(varName)) { + xout.Attribute(attrName.c_str(), "YES"); + return true; + } + return false; +} + +bool cmXCodeScheme::WriteLaunchActionAdditionalOption( + cmXMLWriter& xout, const std::string& key, const std::string& value, + const std::string& varName) +{ + if (Target->GetTarget()->GetPropertyAsBool(varName)) { + xout.StartElement("AdditionalOption"); + xout.BreakAttributes(); + + xout.Attribute("key", key); + xout.Attribute("value", value); + xout.Attribute("isEnabled", "YES"); + + xout.EndElement(); // AdditionalOption + + return true; + } + return false; +} + void cmXCodeScheme::WriteProfileAction(cmXMLWriter& xout, const std::string& configuration) { diff --git a/Source/cmXCodeScheme.h b/Source/cmXCodeScheme.h index e5e501a..96c76e6 100644 --- a/Source/cmXCodeScheme.h +++ b/Source/cmXCodeScheme.h @@ -41,6 +41,16 @@ private: const std::string& container); void WriteLaunchAction(cmXMLWriter& xout, const std::string& configuration, const std::string& container); + + bool WriteLaunchActionAttribute(cmXMLWriter& xout, + const std::string& attrName, + const std::string& varName); + + bool WriteLaunchActionAdditionalOption(cmXMLWriter& xout, + const std::string& attrName, + const std::string& value, + const std::string& varName); + void WriteProfileAction(cmXMLWriter& xout, const std::string& configuration); void WriteAnalyzeAction(cmXMLWriter& xout, const std::string& configuration); void WriteArchiveAction(cmXMLWriter& xout, const std::string& configuration); diff --git a/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake b/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake index 1150666..fb04005 100644 --- a/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake +++ b/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake @@ -219,6 +219,7 @@ endfunction() if(NOT XCODE_VERSION VERSION_LESS 7) XcodeSchemaGeneration() + run_cmake(XcodeSchemaProperty) endif() if(XCODE_VERSION VERSION_GREATER_EQUAL 8) diff --git a/Tests/RunCMake/XcodeProject/XcodeSchemaProperty-check.cmake b/Tests/RunCMake/XcodeProject/XcodeSchemaProperty-check.cmake new file mode 100644 index 0000000..f675d81 --- /dev/null +++ b/Tests/RunCMake/XcodeProject/XcodeSchemaProperty-check.cmake @@ -0,0 +1,33 @@ +function(check_property property matcher) + set(schema "${RunCMake_TEST_BINARY_DIR}/XcodeSchemaProperty.xcodeproj/xcshareddata/xcschemes/${property}.xcscheme") + file(STRINGS ${schema} actual-${property} + REGEX "${matcher}" LIMIT_COUNT 1) + if(NOT actual-${property}) + message(SEND_ERROR "Xcode schema property ${property}: Could not find ${matcher} in schema ${schema}") + endif() +endfunction() + +check_property("ADDRESS_SANITIZER" "enableAddressSanitizer") +check_property("ADDRESS_SANITIZER_USE_AFTER_RETURN" "enableASanStackUseAfterReturn") +check_property("THREAD_SANITIZER" "enableThreadSanitizer") +check_property("THREAD_SANITIZER_STOP" "stopOnEveryThreadSanitizerIssue") +check_property("UNDEFINED_BEHAVIOUR_SANITIZER" "enableUBSanitizer") +check_property("UNDEFINED_BEHAVIOUR_SANITIZER_STOP" "stopOnEveryUBSanitizerIssue") +check_property("DISABLE_MAIN_THREAD_CHECKER" "disableMainThreadChecker") +check_property("MAIN_THREAD_CHECKER_STOP" "stopOnEveryMainThreadCheckerIssue") + +check_property("MALLOC_SCRIBBLE" "MallocScribble") +check_property("MALLOC_GUARD_EDGES" "MallocGuardEdges") +check_property("GUARD_MALLOC" "DYLD_INSERT_LIBRARIES") +check_property("ZOMBIE_OBJECTS" "NSZombieEnabled") +check_property("MALLOC_STACK" "MallocStackLogging") +check_property("DYNAMIC_LINKER_API_USAGE" "DYLD_PRINT_APIS") +check_property("DYNAMIC_LIBRARY_LOADS" "DYLD_PRINT_LIBRARIES") + +check_property("EXECUTABLE" "myExecutable") +check_property("ARGUMENTS" [=["--foo"]=]) +check_property("ARGUMENTS" [=["--bar=baz"]=]) +check_property("ENVIRONMENT" [=[key="FOO"]=]) +check_property("ENVIRONMENT" [=[value="foo"]=]) +check_property("ENVIRONMENT" [=[key="BAR"]=]) +check_property("ENVIRONMENT" [=[value="bar"]=]) diff --git a/Tests/RunCMake/XcodeProject/XcodeSchemaProperty.cmake b/Tests/RunCMake/XcodeProject/XcodeSchemaProperty.cmake new file mode 100644 index 0000000..2b72a64 --- /dev/null +++ b/Tests/RunCMake/XcodeProject/XcodeSchemaProperty.cmake @@ -0,0 +1,37 @@ +cmake_minimum_required(VERSION 3.7) + +set(CMAKE_XCODE_GENERATE_SCHEME ON) + +project(XcodeSchemaProperty CXX) + +function(create_scheme_for_variable variable) + set(CMAKE_XCODE_SCHEME_${variable} ON) + add_executable(${variable} main.cpp) +endfunction() + +create_scheme_for_variable(ADDRESS_SANITIZER) +create_scheme_for_variable(ADDRESS_SANITIZER_USE_AFTER_RETURN) +create_scheme_for_variable(THREAD_SANITIZER) +create_scheme_for_variable(THREAD_SANITIZER_STOP) +create_scheme_for_variable(UNDEFINED_BEHAVIOUR_SANITIZER) +create_scheme_for_variable(UNDEFINED_BEHAVIOUR_SANITIZER_STOP) +create_scheme_for_variable(DISABLE_MAIN_THREAD_CHECKER) +create_scheme_for_variable(MAIN_THREAD_CHECKER_STOP) + +create_scheme_for_variable(MALLOC_SCRIBBLE) +create_scheme_for_variable(MALLOC_GUARD_EDGES) +create_scheme_for_variable(GUARD_MALLOC) +create_scheme_for_variable(ZOMBIE_OBJECTS) +create_scheme_for_variable(MALLOC_STACK) +create_scheme_for_variable(DYNAMIC_LINKER_API_USAGE) +create_scheme_for_variable(DYNAMIC_LIBRARY_LOADS) + +function(create_scheme_for_property property value) + set(XCODE_SCHEME_${property} ON) + add_executable(${property} main.cpp) + set_target_properties(${property} PROPERTIES XCODE_SCHEME_${property} "${value}") +endfunction() + +create_scheme_for_property(EXECUTABLE myExecutable) +create_scheme_for_property(ARGUMENTS "--foo;--bar=baz") +create_scheme_for_property(ENVIRONMENT "FOO=foo;BAR=bar") |