From cbe0423149efa82c183758fc9d1783c745490928 Mon Sep 17 00:00:00 2001 From: Peter Powell Date: Thu, 31 Dec 2015 09:09:10 +0000 Subject: Cleanup CMake policy usage. - CMP0003 has been the default since 2.6 so there is no need to enable this. - CMP0007 and CMP0026 always exist on 3.0+ so there is no need to check that they exists. --- CMakeLists.txt | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 477d54e55..d39624323 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,13 +1,8 @@ # This usage of CMake requires at least version 3.0 cmake_minimum_required(VERSION 3.0 FATAL_ERROR) -cmake_policy(SET CMP0003 NEW) -if(POLICY CMP0026) - cmake_policy(SET CMP0026 OLD) -endif() -if(POLICY CMP0007) - cmake_policy(SET CMP0007 OLD) -endif() +cmake_policy(SET CMP0007 OLD) +cmake_policy(SET CMP0026 OLD) # Set the project as C++ primarily, but have C enabled for the checks required later project(Anope CXX) -- cgit From 6699c0454f80350a7671ef366946a94dec556da3 Mon Sep 17 00:00:00 2001 From: Peter Powell Date: Tue, 12 Apr 2016 16:28:18 +0100 Subject: Don't use the -pipe compiler flag. On modern hardware this makes no difference to build times. --- CMakeLists.txt | 7 ------- 1 file changed, 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d39624323..af2dd4d43 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -111,13 +111,6 @@ endif() # If we are not using Visual Studio, we'll run the following checks if(NOT MSVC) - # Check if the C++ compiler can accept the -pipe flag, and add it to the compile flags if it works - check_cxx_compiler_flag(-pipe HAVE_PIPE_FLAG) - # If the flag was accepted, add it to the list of flags - if(HAVE_PIPE_FLAG) - set(CXXFLAGS "${CXXFLAGS} -pipe") - endif() - # The following are additional library checks, they are not required for Windows if(NOT WIN32) # Check if socket is within the socket library (if the library exists), and add it to the linker flags if needed -- cgit From 2de964ffa42221d5d1ad73643dfc46f6fe318021 Mon Sep 17 00:00:00 2001 From: Peter Powell Date: Sun, 12 Feb 2017 22:06:18 +0000 Subject: Clean up conditionals merged from the 2.0 branch. --- CMakeLists.txt | 4 ++-- cmake/FindSqlite.cmake | 2 +- modules/CMakeLists.txt | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index af2dd4d43..ff9a89fb7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -68,7 +68,7 @@ include_directories(${Anope_BINARY_DIR}/include ${Anope_SOURCE_DIR}/include) # Pass on REPRODUCIBLE_BUILD if(REPRODUCIBLE_BUILD) add_definitions(-DREPRODUCIBLE_BUILD) -endif(REPRODUCIBLE_BUILD) +endif() # If using Windows, always add the _WIN32 define if(WIN32) @@ -277,7 +277,7 @@ install(CODE "file(MAKE_DIRECTORY \"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${DB_ install(CODE "file(MAKE_DIRECTORY \"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${LOGS_DIR}\")") if(WIN32) install(CODE "file(MAKE_DIRECTORY \"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${DB_DIR}/runtime\")") -endif(WIN32) +endif() # On non-Windows platforms, if RUNGROUP is set, change the permissions of the below directories, as well as the group of the data directory if(NOT WIN32 AND RUNGROUP) install(CODE "execute_process(COMMAND ${CHMOD} 2775 \"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/\${DB_DIR}/backups\")") diff --git a/cmake/FindSqlite.cmake b/cmake/FindSqlite.cmake index 1bd862551..9ddab533e 100644 --- a/cmake/FindSqlite.cmake +++ b/cmake/FindSqlite.cmake @@ -44,7 +44,7 @@ if( NOT WIN32 ) pkg_check_modules(PC_SQLITE sqlite3) set(SQLITE_DEFINITIONS ${PC_SQLITE_CFLAGS_OTHER}) -endif( NOT WIN32 ) +endif() FIND_PATH(SQLITE_INCLUDE_DIR NAMES sqlite3.h PATHS diff --git a/modules/CMakeLists.txt b/modules/CMakeLists.txt index 4a2781caa..0422be7f7 100644 --- a/modules/CMakeLists.txt +++ b/modules/CMakeLists.txt @@ -15,7 +15,7 @@ macro(build_modules SRC) string(REGEX MATCH "\\.c$" ANOPE18MODULE ${MODULE_SRC}) if(ANOPE18MODULE) message(FATAL_ERROR "Anope 1 modules are not compatible with Anope 2!\nOffending module: ${MODULE_SRC}") - endif(ANOPE18MODULE) + endif() string(REGEX MATCH "\\.cpp$" CPP ${MODULE_SRC}) if(CPP) set_source_files_properties(${MODULE_SRC} PROPERTIES LANGUAGE CXX COMPILE_FLAGS "${CXXFLAGS}") @@ -155,7 +155,7 @@ macro(build_subdir) if(APPLE) # Mark undefined symbols as having to be looked up at runtime set(MOD_EXTRA_LDFLAGS "-undefined dynamic_lookup") - endif(APPLE) + endif() # Generate the module and set its linker flags, also set it to depend on the main Anope executable to be built beforehand add_library(${SO} SHARED ${MODULES_SUBDIR_SRCS}) -- cgit