summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSadie Powell <sadie@witchery.services>2022-01-03 16:24:04 +0000
committerSadie Powell <sadie@witchery.services>2022-01-03 16:27:15 +0000
commitaee1e53cb3bec6d30f171bfbc14a69be46a3f31c (patch)
tree62280ac77eb40253981ca2a747fc30508c736724
parentfd1ca96e2c1013cc747f0bc6def1e5da13b44386 (diff)
Remove support for precompiled headers.
This might have been useful two decades ago but on recent hardware this just makes builds take longer than without them.
-rw-r--r--CMakeLists.txt6
-rwxr-xr-xConfig31
-rw-r--r--include/CMakeLists.txt43
3 files changed, 4 insertions, 76 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ba29007c7..f3e94feed 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -163,12 +163,8 @@ endif()
# Find gettext
find_package(Gettext)
-option(USE_PCH "Use precompiled headers" OFF)
-
# Use the following directories as includes
-# Note that it is important the binary include directory comes before the
-# source include directory so the precompiled headers work correctly.
-include_directories(${Anope_BINARY_DIR}/include ${Anope_SOURCE_DIR}/include ${Anope_BINARY_DIR}/language ${Anope_SOURCE_DIR}/modules/pseudoclients)
+include_directories(${Anope_BINARY_DIR}/include ${Anope_SOURCE_DIR}/include)
# Pass on REPRODUCIBLE_BUILD
if(REPRODUCIBLE_BUILD)
diff --git a/Config b/Config
index 2d5e9f1eb..1d5db1000 100755
--- a/Config
+++ b/Config
@@ -62,12 +62,6 @@ Run_Build_System () {
BUILD_TYPE="-DCMAKE_BUILD_TYPE:STRING=RELEASE"
fi
- if [ "$USE_PCH" = "yes" ] ; then
- PCH="-DUSE_PCH:BOOLEAN=ON"
- else
- PCH="-DUSE_PCH:BOOLEAN=OFF"
- fi
-
if [ "$EXTRA_INCLUDE_DIRS" != "" ] ; then
EXTRA_INCLUDE="-DEXTRA_INCLUDE:STRING=$EXTRA_INCLUDE_DIRS"
fi
@@ -91,9 +85,9 @@ Run_Build_System () {
REAL_SOURCE_DIR="$SOURCE_DIR"
fi
- echo "cmake $GEN_TYPE $WITH_INST $WITH_RUN $WITH_PERM $BUILD_TYPE $PCH $EXTRA_INCLUDE $EXTRA_LIBS $EXTRA_CONFIG_ARGS $REAL_SOURCE_DIR"
+ echo "cmake $GEN_TYPE $WITH_INST $WITH_RUN $WITH_PERM $BUILD_TYPE $EXTRA_INCLUDE $EXTRA_LIBS $EXTRA_CONFIG_ARGS $REAL_SOURCE_DIR"
- cmake $GEN_TYPE $WITH_INST $WITH_RUN $WITH_PERM $BUILD_TYPE $PCH $EXTRA_INCLUDE $EXTRA_LIBS $EXTRA_CONFIG_ARGS $REAL_SOURCE_DIR
+ cmake $GEN_TYPE $WITH_INST $WITH_RUN $WITH_PERM $BUILD_TYPE $EXTRA_INCLUDE $EXTRA_LIBS $EXTRA_CONFIG_ARGS $REAL_SOURCE_DIR
if [ $? -ne 0 ]; then
echo "You should fix these issues and then run ./Config -quick to rerun CMake."
exit 1
@@ -129,7 +123,6 @@ INSTDIR=$HOME/anope
RUNGROUP=
UMASK=
DEBUG="no"
-USE_PCH="no"
EXTRA_INCLUDE_DIRS=
EXTRA_LIB_DIRS=
EXTRA_CONFIG_ARGS=
@@ -321,25 +314,6 @@ echo ""
####
-TEMP_YN="n"
-if [ "$USE_PCH" = "yes" ] ; then
- TEMP_YN="y"
-fi
-echo "Do you want to build using precompiled headers? This can speed up"
-echo "the build, but uses more disk space."
-echo2 "[$TEMP_YN] "
-read YN
-if [ "$YN" ] ; then
- if [ "$YN" = "y" ] ; then
- USE_PCH="yes"
- else
- USE_PCH="no"
- fi
-fi
-echo ""
-
-####
-
echo "Are there any extra include directories you wish to use?"
echo "You may only need to do this if CMake is unable to locate"
echo "missing dependencies without hints."
@@ -402,7 +376,6 @@ INSTDIR="$INSTDIR"
RUNGROUP="$RUNGROUP"
UMASK=$UMASK
DEBUG="$DEBUG"
-USE_PCH="$USE_PCH"
EXTRA_INCLUDE_DIRS="$EXTRA_INCLUDE_DIRS"
EXTRA_LIB_DIRS="$EXTRA_LIB_DIRS"
EXTRA_CONFIG_ARGS="$EXTRA_CONFIG_ARGS"
diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt
index 3026c56b2..448e7fdac 100644
--- a/include/CMakeLists.txt
+++ b/include/CMakeLists.txt
@@ -18,46 +18,5 @@ if(NOT WIN32)
add_to_cpack_ignored_files("build.h$" TRUE)
endif()
-set(PCH_SOURCES_GCH "")
-if(USE_PCH AND CMAKE_COMPILER_IS_GNUCXX)
- string(REPLACE " " ";" PCH_CXXFLAGS "${CXXFLAGS} ${CMAKE_CXX_FLAGS}")
-
- file(GLOB PCH_SOURCES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*.h")
- list(SORT PCH_SOURCES)
-
- foreach(PCH_SOURCE ${PCH_SOURCES})
- find_includes(${PCH_SOURCE} INCLUDES)
- set(INCLUDES_LIST)
- list(APPEND INCLUDES_LIST ${PCH_SOURCE})
- foreach(INCLUDE ${INCLUDES})
- # Extract the filename from the #include line
- extract_include_filename(${INCLUDE} FILENAME QUOTE_TYPE)
- if(QUOTE_TYPE STREQUAL "quotes")
- if(NOT ${FILENAME} IN_LIST PCH_SOURCES)
- list(APPEND INCLUDES_LIST ${FILENAME})
- endif()
- endif()
- endforeach()
-
- set(PCH_EXTRAFLAGS "")
- if(DEBUG_BUILD)
- set(PCH_EXTRAFLAGS "-g")
- endif()
- if(PCH_SOURCE STREQUAL "module.h")
- set(PCH_EXTRAFLAGS ${PCH_EXTRAFLAGS} -fPIC)
- endif()
- if(GETTEXT_INCLUDE)
- set(PCH_GETTEXT_INCLUDE "-I${GETTEXT_INCLUDE}")
- endif()
-
- set(PCH_SOURCES_GCH "${PCH_SOURCES_GCH};${CMAKE_CURRENT_BINARY_DIR}/${PCH_SOURCE}.gch")
- add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${PCH_SOURCE}.gch
- COMMAND ${CMAKE_CXX_COMPILER} ARGS ${PCH_CXXFLAGS} ${PCH_EXTRAFLAGS}
- ${PCH_GETTEXT_INCLUDE} -I${CMAKE_CURRENT_BINARY_DIR} -I${Anope_SOURCE_DIR}/modules/pseudoclients ${CMAKE_CURRENT_SOURCE_DIR}/${PCH_SOURCE} -o ${CMAKE_CURRENT_BINARY_DIR}/${PCH_SOURCE}.gch
- DEPENDS ${INCLUDES_LIST} VERBATIM
- )
- endforeach()
-endif()
-
# Add a custom target to the above file
-add_custom_target(headers DEPENDS version-bin ${CMAKE_CURRENT_BINARY_DIR}/version_build ${PCH_SOURCES_GCH})
+add_custom_target(headers DEPENDS version-bin ${CMAKE_CURRENT_BINARY_DIR}/version_build)