aboutsummaryrefslogtreecommitdiffstats
path: root/net/crtmpserver
diff options
context:
space:
mode:
authoramdmi3 <amdmi3@FreeBSD.org>2015-06-26 06:02:25 +0800
committeramdmi3 <amdmi3@FreeBSD.org>2015-06-26 06:02:25 +0800
commitd6e7bdca324ab527118922bc31f2b640e021b1e4 (patch)
treea7d5658d6edf35394ec3e362df057ca26334d5d6 /net/crtmpserver
parent7de154ad485fb42026d09e0e58cf56b5a8dcec0a (diff)
downloadfreebsd-ports-gnome-d6e7bdca324ab527118922bc31f2b640e021b1e4.tar.gz
freebsd-ports-gnome-d6e7bdca324ab527118922bc31f2b640e021b1e4.tar.zst
freebsd-ports-gnome-d6e7bdca324ab527118922bc31f2b640e021b1e4.zip
- Disable precompiled headers to fix build with old gcc on -current kernel
Approved by: portmgr blanket
Diffstat (limited to 'net/crtmpserver')
-rw-r--r--net/crtmpserver/files/patch-builders_cmake_cmake__find_modules_pch_support.cmake79
1 files changed, 79 insertions, 0 deletions
diff --git a/net/crtmpserver/files/patch-builders_cmake_cmake__find_modules_pch_support.cmake b/net/crtmpserver/files/patch-builders_cmake_cmake__find_modules_pch_support.cmake
new file mode 100644
index 000000000000..26783457f92f
--- /dev/null
+++ b/net/crtmpserver/files/patch-builders_cmake_cmake__find_modules_pch_support.cmake
@@ -0,0 +1,79 @@
+--- builders/cmake/cmake_find_modules/pch_support.cmake.orig 2013-10-01 03:50:34 UTC
++++ builders/cmake/cmake_find_modules/pch_support.cmake
+@@ -1,76 +1,6 @@
+ #This code is taken from here:
+ #http://www.mail-archive.com/cmake@cmake.org/msg04394.html
+
+-IF(CMAKE_COMPILER_IS_GNUCXX)
+- EXEC_PROGRAM(
+- ${CMAKE_CXX_COMPILER}
+- ARGS --version
+- OUTPUT_VARIABLE _compiler_output)
+- STRING(REGEX REPLACE ".* ([0-9]\\.[0-9]\\.[0-9]) .*" "\\1"
+- gcc_compiler_version ${_compiler_output})
+- #MESSAGE("GCC Version: ${gcc_compiler_version}")
+- IF(gcc_compiler_version MATCHES "4\\.[0-9]\\.[0-9]")
+- MESSAGE(STATUS "We have support for precompiled headers")
+- SET(PCHSupport_FOUND TRUE)
+- ELSE(gcc_compiler_version MATCHES "4\\.[0-9]\\.[0-9]")
+- IF(gcc_compiler_version MATCHES "3\\.4\\.[0-9]")
+- MESSAGE(STATUS "We have support for precompiled headers")
+- SET(PCHSupport_FOUND TRUE)
+- ENDIF(gcc_compiler_version MATCHES "3\\.4\\.[0-9]")
+- ENDIF(gcc_compiler_version MATCHES "4\\.[0-9]\\.[0-9]")
+-ENDIF(CMAKE_COMPILER_IS_GNUCXX)
+-
+ MACRO(ADD_PRECOMPILED_HEADER _targetName _input )
+- #get the file name (no path)
+- GET_FILENAME_COMPONENT(_name ${_input} NAME_WE)
+-
+- #locate the file
+- SET(_source "${_input}")
+-
+- #compute the output directory
+- SET(_outdir "${CMAKE_BINARY_DIR}/precompiled.gch/${CMAKE_BUILD_TYPE}.c++")
+-
+- #create the output directory
+- MAKE_DIRECTORY(${_outdir})
+-
+- #compute the output file
+- SET(_output "${_outdir}/${_name}.gch")
+-
+- #get the compiler flags
+- STRING(TOUPPER "CMAKE_CXX_FLAGS_${CMAKE_BUILD_TYPE}" _flags_var_name)
+- SET(_compiler_FLAGS ${CMAKE_CXX_FLAGS} ${${_flags_var_name}})
+-
+- #get the list of include directories for the current project and compute the new version of compiler flags by
+- #appinding -I
+- GET_DIRECTORY_PROPERTY(_directory_flags INCLUDE_DIRECTORIES)
+- FOREACH(item ${_directory_flags})
+- LIST(APPEND _compiler_FLAGS "-I${item}")
+- ENDFOREACH(item)
+-
+- #get the definitions of the current project and append them as well to the current compiler flags
+- GET_DIRECTORY_PROPERTY(_directory_flags DEFINITIONS)
+- LIST(APPEND _compiler_FLAGS ${_directory_flags})
+-
+- #now split the entire thing
+- SEPARATE_ARGUMENTS(_compiler_FLAGS)
+-
+- #compute the new command
+- ADD_CUSTOM_COMMAND(
+- OUTPUT ${_output}
+- COMMAND ${CMAKE_CXX_COMPILER} ${PCH_CXX_FLAGS} ${_compiler_FLAGS} -x c++-header -c -o ${_output} ${_source}
+- DEPENDS ${_source}
+- )
+-
+- #add a new target to the project
+- ADD_CUSTOM_TARGET(${_targetName}_${_name}_gch DEPENDS ${_output})
+- ADD_DEPENDENCIES(${_targetName} ${_targetName}_${_name}_gch)
+-
+- EXECUTE_PROCESS(COMMAND ${CMAKE_CXX_COMPILER} --version OUTPUT_VARIABLE _COMPILER_VERSION)
+- STRING(TOLOWER "${_COMPILER_VERSION}" _COMPILER_VERSION)
+- IF(_COMPILER_VERSION MATCHES ".*(clang|llvm).*")
+- SET_TARGET_PROPERTIES(${_targetName} PROPERTIES COMPILE_FLAGS "-include-pch ${_output} -Winvalid-pch")
+- ELSE()
+- SET_TARGET_PROPERTIES(${_targetName} PROPERTIES COMPILE_FLAGS "-I${_outdir} -include ${_name} -Winvalid-pch")
+- ENDIF()
+ ENDMACRO(ADD_PRECOMPILED_HEADER)
+