diff options
-rw-r--r-- | CONTRIBUTING.rst | 24 | ||||
-rw-r--r-- | CTestCustom.cmake.in | 1 | ||||
-rw-r--r-- | CompileFlags.cmake | 7 | ||||
-rw-r--r-- | Modules/Platform/Windows-MSVC.cmake | 4 | ||||
-rw-r--r-- | Source/CMakeVersion.cmake | 2 | ||||
-rw-r--r-- | Source/cmMakefile.cxx | 21 | ||||
-rw-r--r-- | Source/cmVisualStudio10TargetGenerator.cxx | 3 | ||||
-rw-r--r-- | Tests/CMakeLists.txt | 23 | ||||
-rw-r--r-- | Tests/RunCMake/CMakeLists.txt | 2 | ||||
-rw-r--r-- | Tests/RunCMake/CPack/SOURCE_PACKAGE.cmake | 2 | ||||
-rw-r--r-- | Tests/RunCMake/project/ExplicitRC.cmake | 1 | ||||
-rw-r--r-- | Tests/RunCMake/project/RunCMakeTest.cmake | 3 |
12 files changed, 66 insertions, 27 deletions
diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index ddf8407..921ba7c 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -6,22 +6,26 @@ Community CMake is maintained and supported by `Kitware`_ and developed in collaboration with a productive community of contributors. +Please subscribe and post to the `CMake Developers List`_ to raise +discussion of development topics. .. _`Kitware`: http://www.kitware.com/cmake - -The preferred entry point for new contributors is the mailing list. -Please subscribe and post to the `CMake Developers List`_ to offer -contributions. Regular and productive contributors may be invited -to gain direct push access. - .. _`CMake Developers List`: https://cmake.org/mailman/listinfo/cmake-developers Patches ======= -Please base all new work on the ``master`` branch. Then use -``git format-patch`` to produce patches suitable to post to -the mailing list. +CMake uses `Kitware's GitLab Instance`_ to manage development and code review. +To contribute patches: + +#. Fork the upstream `CMake Repository`_ into a personal account. +#. Base all new work on the upstream ``master`` branch. +#. Create commits making incremental, distinct, logically complete changes. +#. Push a topic branch to a personal repository fork on GitLab. +#. Create a GitLab Merge Request targeting the upstream ``master`` branch. + +.. _`Kitware's GitLab Instance`: https://gitlab.kitware.com +.. _`CMake Repository`: https://gitlab.kitware.com/cmake/cmake Code Style ========== @@ -29,9 +33,11 @@ Code Style We use `clang-format`_ to define our style for C++ code in the CMake source tree. See the `.clang-format`_ configuration file for our style settings. Use ``clang-format`` version 3.8 or higher to format source files. +See also the `Utilities/Scripts/clang-format.bash`_ script. .. _`clang-format`: http://clang.llvm.org/docs/ClangFormat.html .. _`.clang-format`: .clang-format +.. _`Utilities/Scripts/clang-format.bash`: Utilities/Scripts/clang-format.bash License ======= diff --git a/CTestCustom.cmake.in b/CTestCustom.cmake.in index 710681c..48dd3de 100644 --- a/CTestCustom.cmake.in +++ b/CTestCustom.cmake.in @@ -67,6 +67,7 @@ list(APPEND CTEST_CUSTOM_WARNING_EXCEPTION "cm(StringCommand|CTestTestHandler)\\.cxx.*warning.*rand.*may return deterministic values" "cm(StringCommand|CTestTestHandler)\\.cxx.*warning.*rand.*isn.*t random" # we do not do crypto "cm(StringCommand|CTestTestHandler)\\.cxx.*warning.*srand.*seed choices are.*poor" # we do not do crypto + "IPA warning: function.*multiply defined in" # Ignore clang's summary warning, assuming prior text has matched some # other warning expression: diff --git a/CompileFlags.cmake b/CompileFlags.cmake index 382787c..c875e6f 100644 --- a/CompileFlags.cmake +++ b/CompileFlags.cmake @@ -71,6 +71,13 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL SunPro) endif() endif() +foreach(lang C CXX) + # Suppress warnings from PGI compiler. + if (CMAKE_${lang}_COMPILER_ID STREQUAL "PGI") + set(CMAKE_${lang}_FLAGS "${CMAKE_${lang}_FLAGS} -w") + endif() +endforeach() + # use the ansi CXX compile flag for building cmake if (CMAKE_ANSI_CXXFLAGS) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_ANSI_CXXFLAGS}") diff --git a/Modules/Platform/Windows-MSVC.cmake b/Modules/Platform/Windows-MSVC.cmake index 5055eef..d72ec66 100644 --- a/Modules/Platform/Windows-MSVC.cmake +++ b/Modules/Platform/Windows-MSVC.cmake @@ -182,7 +182,7 @@ else() if(_MSVC_C_ARCHITECTURE_FAMILY STREQUAL "ARM" OR _MSVC_CXX_ARCHITECTURE_FAMILY STREQUAL "ARM") set(CMAKE_C_STANDARD_LIBRARIES_INIT "kernel32.lib user32.lib") elseif(MSVC_VERSION GREATER 1310) - if(CMAKE_VS_PLATFORM_TOOLSET MATCHES "v[0-9]+_clang_.*") + if(CMAKE_VS_PLATFORM_TOOLSET MATCHES "(v[0-9]+_clang_.*|LLVM-vs[0-9]+.*)") # Clang/C2 in MSVC14 Update 1 seems to not support -fsantinize (yet?) # set(_RTC1 "-fsantinize=memory,safe-stack") set(_FLAGS_CXX " -frtti -fexceptions") @@ -281,7 +281,7 @@ macro(__windows_compiler_msvc lang) if("x${lang}" STREQUAL "xC" OR "x${lang}" STREQUAL "xCXX") - if(CMAKE_VS_PLATFORM_TOOLSET MATCHES "v[0-9]+_clang_.*") + if(CMAKE_VS_PLATFORM_TOOLSET MATCHES "(v[0-9]+_clang_.*|LLVM-vs[0-9]+.*)") # note: MSVC 14 2015 Update 1 sets -fno-ms-compatibility by default, but this does not allow one to compile many projects # that include MS's own headers. CMake itself is affected project too. string(APPEND CMAKE_${lang}_FLAGS_INIT " ${_PLATFORM_DEFINES}${_PLATFORM_DEFINES_${lang}} -fms-extensions -fms-compatibility -D_WINDOWS -Wall${_FLAGS_${lang}}") diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index e4f5e01..dd36349 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 6) -set(CMake_VERSION_PATCH 20160928) +set(CMake_VERSION_PATCH 20160929) #set(CMake_VERSION_RC 1) diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 48e6c61..df993ce 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -3142,7 +3142,26 @@ void cmMakefile::EnableLanguage(std::vector<std::string> const& lang, { this->AddDefinition("CMAKE_CFG_INTDIR", this->GetGlobalGenerator()->GetCMakeCFGIntDir()); - this->GetGlobalGenerator()->EnableLanguage(lang, this, optional); + // If RC is explicitly listed we need to do it after other languages. + // On some platforms we enable RC implicitly while enabling others. + // Do not let that look like recursive enable_language(RC). + std::vector<std::string> langs; + std::vector<std::string> langsRC; + langs.reserve(lang.size()); + for (std::vector<std::string>::const_iterator i = lang.begin(); + i != lang.end(); ++i) { + if (i->compare("RC") == 0) { + langsRC.push_back(*i); + } else { + langs.push_back(*i); + } + } + if (!langs.empty()) { + this->GetGlobalGenerator()->EnableLanguage(langs, this, optional); + } + if (!langsRC.empty()) { + this->GetGlobalGenerator()->EnableLanguage(langsRC, this, optional); + } } int cmMakefile::TryCompile(const std::string& srcdir, diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index b5fe754..d81f59d 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -1795,7 +1795,8 @@ void cmVisualStudio10TargetGenerator::WriteClOptions( } if (this->MSTools) { - cmsys::RegularExpression clangToolset("v[0-9]+_clang_.*"); + cmsys::RegularExpression clangToolset( + "(v[0-9]+_clang_.*|LLVM-vs[0-9]+.*)"); const char* toolset = this->GlobalGenerator->GetPlatformToolset(); if (toolset && clangToolset.find(toolset)) { this->WriteString("<ObjectFileName>" diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 3681843..c056fb8 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -83,6 +83,17 @@ if(BUILD_TESTING) set(MAKE_SUPPORTS_SPACES 0) endif() + # assume no resources building to test + set(CMake_TEST_RESOURCES FALSE) + # for windows and cygwin assume we have resources + if(WIN32 OR CYGWIN) + set(CMake_TEST_RESOURCES TRUE) + endif() + # for borland and watcom there is no resource support + if(WATCOM OR BORLAND) + set(CMake_TEST_RESOURCES FALSE) + endif() + set(build_generator_args --build-generator ${CMAKE_GENERATOR} ) @@ -262,17 +273,7 @@ if(BUILD_TESTING) ADD_TEST_MACRO(CompileFeatures CompileFeatures) ADD_TEST_MACRO(CMakeCommands.target_compile_features target_compile_features) - # assume no resources building to test - set(TEST_RESOURCES FALSE) - # for windows and cygwin assume we have resources - if(WIN32 OR CYGWIN) - set(TEST_RESOURCES TRUE) - endif() - # for borland and watcom there is no resource support - if(WATCOM OR BORLAND) - set(TEST_RESOURCES FALSE) - endif() - if(TEST_RESOURCES) + if(CMake_TEST_RESOURCES) ADD_TEST_MACRO(VSResource VSResource) if (CMAKE_GENERATOR MATCHES "Ninja") add_test_macro(VSResourceNinjaForceRSP VSResourceNinjaForceRSP) diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index 778982f..0eafbef 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -207,7 +207,7 @@ add_RunCMake_test(include) add_RunCMake_test(include_directories) add_RunCMake_test(list) add_RunCMake_test(message) -add_RunCMake_test(project) +add_RunCMake_test(project -DCMake_TEST_RESOURCES=${CMake_TEST_RESOURCES}) add_RunCMake_test(return) add_RunCMake_test(set_property) add_RunCMake_test(string) diff --git a/Tests/RunCMake/CPack/SOURCE_PACKAGE.cmake b/Tests/RunCMake/CPack/SOURCE_PACKAGE.cmake index 9958c2a..946439d 100644 --- a/Tests/RunCMake/CPack/SOURCE_PACKAGE.cmake +++ b/Tests/RunCMake/CPack/SOURCE_PACKAGE.cmake @@ -1,5 +1,5 @@ file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/main.cpp" - "int main() {return 0;}") + "int main() {return 0;}\n") add_executable(test_prog "${CMAKE_CURRENT_BINARY_DIR}/main.cpp") install(TARGETS test_prog DESTINATION foo COMPONENT applications) diff --git a/Tests/RunCMake/project/ExplicitRC.cmake b/Tests/RunCMake/project/ExplicitRC.cmake new file mode 100644 index 0000000..b3feaa9 --- /dev/null +++ b/Tests/RunCMake/project/ExplicitRC.cmake @@ -0,0 +1 @@ +project(ExplicitRC C RC) diff --git a/Tests/RunCMake/project/RunCMakeTest.cmake b/Tests/RunCMake/project/RunCMakeTest.cmake index 6ab0fc9..dba97d2 100644 --- a/Tests/RunCMake/project/RunCMakeTest.cmake +++ b/Tests/RunCMake/project/RunCMakeTest.cmake @@ -1,5 +1,8 @@ include(RunCMake) +if(CMake_TEST_RESOURCES) + run_cmake(ExplicitRC) +endif() run_cmake(LanguagesImplicit) run_cmake(LanguagesEmpty) run_cmake(LanguagesNONE) |