From 8bc0adb9ba23368ac970908d971a853bc5765b09 Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Sat, 13 Apr 2019 06:56:34 -0700 Subject: [PATCH] Get rid of obsolete cmake stuff --- CMakeLists.txt | 13 ++++++++----- support/cmake/cxx14.cmake | 28 +--------------------------- support/cmake/run-cmake.bat | 11 ----------- test/CMakeLists.txt | 5 +---- 4 files changed, 10 insertions(+), 47 deletions(-) delete mode 100644 support/cmake/run-cmake.bat diff --git a/CMakeLists.txt b/CMakeLists.txt index 760ff1fe..7c981587 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -34,7 +34,8 @@ if (MASTER_PROJECT AND NOT CMAKE_BUILD_TYPE) endif () option(FMT_PEDANTIC "Enable extra warnings and expensive tests." OFF) -option(FMT_WERROR "Halt the compilation with an error on compiler warnings." OFF) +option(FMT_WERROR "Halt the compilation with an error on compiler warnings." + OFF) # Options that control generation of various targets. option(FMT_DOC "Generate the doc target." ${MASTER_PROJECT}) @@ -95,7 +96,8 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "GNU") endif () if (CMAKE_CXX_COMPILER_ID MATCHES "Clang") - set(PEDANTIC_COMPILE_FLAGS -Wall -Wextra -pedantic -Wconversion -Wno-sign-conversion) + set(PEDANTIC_COMPILE_FLAGS -Wall -Wextra -pedantic -Wconversion + -Wno-sign-conversion) check_cxx_compiler_flag(-Wzero-as-null-pointer-constant HAS_NULLPTR_WARNING) if (HAS_NULLPTR_WARNING) set(PEDANTIC_COMPILE_FLAGS ${PEDANTIC_COMPILE_FLAGS} @@ -195,7 +197,7 @@ if (FMT_INSTALL) include(GNUInstallDirs) include(CMakePackageConfigHelpers) set(FMT_CMAKE_DIR ${CMAKE_INSTALL_LIBDIR}/cmake/fmt CACHE STRING - "Installation directory for cmake files, relative to ${CMAKE_INSTALL_PREFIX}.") + "Installation directory for cmake files, relative to ${CMAKE_INSTALL_PREFIX}.") set(version_config ${PROJECT_BINARY_DIR}/fmt-config-version.cmake) set(project_config ${PROJECT_BINARY_DIR}/fmt-config.cmake) set(pkgconfig ${PROJECT_BINARY_DIR}/fmt.pc) @@ -213,7 +215,7 @@ if (FMT_INSTALL) "Installation directory for include files, relative to ${CMAKE_INSTALL_PREFIX}.") set(FMT_PKGCONFIG_DIR ${CMAKE_INSTALL_LIBDIR}/pkgconfig CACHE PATH - "Installation directory for pkgconfig (.pc) files, relative to ${CMAKE_INSTALL_PREFIX}.") + "Installation directory for pkgconfig (.pc) files, relative to ${CMAKE_INSTALL_PREFIX}.") # Generate the version, config and target files into the build directory. write_basic_package_version_file( @@ -244,7 +246,8 @@ if (FMT_INSTALL) install(TARGETS ${INSTALL_TARGETS} EXPORT ${targets_export_name} DESTINATION ${FMT_LIB_DIR}) - install(FILES $ DESTINATION ${FMT_LIB_DIR} OPTIONAL) + install(FILES $ + DESTINATION ${FMT_LIB_DIR} OPTIONAL) install(FILES ${FMT_HEADERS} DESTINATION ${FMT_INC_DIR}) install(FILES "${pkgconfig}" DESTINATION "${FMT_PKGCONFIG_DIR}") endif () diff --git a/support/cmake/cxx14.cmake b/support/cmake/cxx14.cmake index 1866cdcc..de8a0b42 100644 --- a/support/cmake/cxx14.cmake +++ b/support/cmake/cxx14.cmake @@ -50,6 +50,7 @@ set(CMAKE_REQUIRED_FLAGS ${CXX_STANDARD_FLAG}) # Check if variadic templates are working and not affected by GCC bug 39653: # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=39653 +# Can be removed once gcc 4.4 support is dropped. check_cxx_source_compiles(" template struct S { typedef typename S::type type; }; @@ -58,33 +59,6 @@ if (NOT SUPPORTS_VARIADIC_TEMPLATES) set (SUPPORTS_VARIADIC_TEMPLATES OFF) endif () -# Check if initializer lists are supported. -check_cxx_source_compiles(" - #include - int main() {}" SUPPORTS_INITIALIZER_LIST) -if (NOT SUPPORTS_INITIALIZER_LIST) - set (SUPPORTS_INITIALIZER_LIST OFF) -endif () - -# Check if enum bases are available -check_cxx_source_compiles(" - enum C : char {A}; - int main() {}" - SUPPORTS_ENUM_BASE) -if (NOT SUPPORTS_ENUM_BASE) - set (SUPPORTS_ENUM_BASE OFF) -endif () - -# Check if type traits are available -check_cxx_source_compiles(" - #include - class C { void operator=(const C&); }; - int main() { static_assert(!std::is_copy_assignable::value, \"\"); }" - SUPPORTS_TYPE_TRAITS) -if (NOT SUPPORTS_TYPE_TRAITS) - set (SUPPORTS_TYPE_TRAITS OFF) -endif () - # Check if user-defined literals are available check_cxx_source_compiles(" void operator\"\" _udl(long double); diff --git a/support/cmake/run-cmake.bat b/support/cmake/run-cmake.bat deleted file mode 100644 index f18bb055..00000000 --- a/support/cmake/run-cmake.bat +++ /dev/null @@ -1,11 +0,0 @@ -@echo on -rem This scripts configures build environment and runs CMake. -rem Use it instead of running CMake directly when building with -rem the Microsoft SDK toolchain rather than Visual Studio. -rem It is used in the same way as cmake, for example: -rem -rem run-cmake -G "Visual Studio 10 Win64" . - -for /F "delims=" %%i IN ('cmake "-DPRINT_PATH=1" -P %~dp0/FindSetEnv.cmake') DO set setenv=%%i -if NOT "%setenv%" == "" call "%setenv%" -cmake %* diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index e44bdcd4..6940c1bb 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -17,7 +17,7 @@ else () target_compile_definitions(gmock PUBLIC GTEST_HAS_PTHREAD=0) endif () -if (NOT SUPPORTS_VARIADIC_TEMPLATES OR NOT SUPPORTS_INITIALIZER_LIST) +if (NOT SUPPORTS_VARIADIC_TEMPLATES) target_compile_definitions(gmock PUBLIC GTEST_LANG_CXX11=0) endif () @@ -74,9 +74,6 @@ function(add_fmt_test name) target_link_libraries(${name} test-main) # Define if certain C++ features can be used. - target_compile_definitions(${name} PRIVATE - FMT_USE_TYPE_TRAITS=$ - FMT_USE_ENUM_BASE=$) if (FMT_PEDANTIC) target_compile_options(${name} PRIVATE ${PEDANTIC_COMPILE_FLAGS}) endif ()