mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 10:54:24 -04:00

The rationale for this is in a comment at the top of the main CMakeLists.txt file. It was getting harder to maintain support for a version this old, and pretty much no current system has CMake <3. Good riddance.
29 lines
930 B
CMake
29 lines
930 B
CMake
# Filename: MakeComposite.cmake
|
|
#
|
|
# Description: When run, creates a single C++ file which includes multiple
|
|
# other C++ files, to help facilitate unity builds.
|
|
# Unity builds provide significantly increased compile speed.
|
|
#
|
|
# Usage:
|
|
# This script is invoked via add_custom_target, like this:
|
|
# cmake -P MakeComposite.cmake -D COMPOSITE_FILE="x_composite1.cxx" -D COMPOSITE_SOURCES="a.cxx b.cxx"
|
|
#
|
|
|
|
if(CMAKE_SCRIPT_MODE_FILE)
|
|
if(NOT DEFINED COMPOSITE_FILE)
|
|
message(FATAL_ERROR "COMPOSITE_FILE should be defined when running MakeComposite.cmake!")
|
|
return()
|
|
endif()
|
|
|
|
file(WRITE "${COMPOSITE_FILE}" "/* Generated by CMake. DO NOT EDIT. */\n")
|
|
|
|
separate_arguments(COMPOSITE_SOURCES)
|
|
foreach(source ${COMPOSITE_SOURCES})
|
|
file(APPEND "${COMPOSITE_FILE}" "#include \"${source}\"\n")
|
|
endforeach()
|
|
|
|
else()
|
|
message(SEND_ERROR "MakeComposite.cmake should not be included but run in script mode.")
|
|
|
|
endif()
|