mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-11-18 02:01:39 +00:00
2cbe211e7c
The EDuke32 and RedNukem frontends are working, Blood isn't yet. Notes: many of the CMake variables and its output still refer to zdoom. Before changing that I wanted to make sure to be able to commit something that works. support code for Windows XP has been entirely removed. On Windows this will only target Vista and up. the crc32.h header had to be renamed to deconflict from zlib. several Windows API calls were changed to call the A-versions directly. Weirdly enough there were places that defined their parameters as T types but in a non-working way. removed some remaining editor files and support for the native software rendering only Windows backend. in a few simple cases, replaced 'char' with 'uint8_t'. The code as-is depends on chars being unsigned which is non-portable. This needs to be carefully reviewed.
45 lines
No EOL
1.8 KiB
CMake
45 lines
No EOL
1.8 KiB
CMake
#
|
|
# Christoph Heindl 2010
|
|
# Precompiled Headers Demo
|
|
# http://cheind.wordpress.com
|
|
#
|
|
|
|
# Instructs the MSVC toolset to use the precompiled header PRECOMPILED_HEADER
|
|
# for each source file given in the collection named by SOURCE_VARIABLE_NAME.
|
|
function(enable_precompiled_headers PRECOMPILED_HEADER SOURCE_VARIABLE_NAME)
|
|
if(MSVC)
|
|
set(files ${${SOURCE_VARIABLE_NAME}})
|
|
|
|
# Generate precompiled header translation unit
|
|
get_filename_component(pch_basename ${PRECOMPILED_HEADER} NAME_WE)
|
|
set(pch_abs ${CMAKE_CURRENT_SOURCE_DIR}/${PRECOMPILED_HEADER})
|
|
set(pch_unity ${CMAKE_CURRENT_BINARY_DIR}/${pch_basename}.cpp)
|
|
set(pch_content "// Precompiled header unity generated by CMake\n#include <${pch_abs}>\n")
|
|
# Read .cpp if exists
|
|
if(EXISTS ${pch_unity})
|
|
file(READ ${pch_unity} pch_content_prev)
|
|
endif()
|
|
# Compare existing .cpp content with the actual one
|
|
if (pch_content_prev AND pch_content STREQUAL pch_content_prev)
|
|
unset(pch_content)
|
|
endif()
|
|
# Write .cpp if it's out-of-date
|
|
if (pch_content)
|
|
FILE(WRITE ${pch_unity} "${pch_content}")
|
|
endif()
|
|
set_source_files_properties(${pch_unity} PROPERTIES COMPILE_FLAGS "/Yc\"${pch_abs}\"")
|
|
|
|
# Update properties of source files to use the precompiled header.
|
|
# Additionally, force the inclusion of the precompiled header at beginning of each source file.
|
|
foreach(source_file ${files} )
|
|
set_source_files_properties(
|
|
${source_file}
|
|
PROPERTIES COMPILE_FLAGS
|
|
"/Yu\"${pch_abs}\" /FI\"${pch_abs}\""
|
|
)
|
|
endforeach(source_file)
|
|
|
|
# Finally, update the source file collection to contain the precompiled header translation unit
|
|
set(${SOURCE_VARIABLE_NAME} ${${SOURCE_VARIABLE_NAME}} ${pch_unity} PARENT_SCOPE)
|
|
endif(MSVC)
|
|
endfunction(enable_precompiled_headers) |