CMakeLists upgrade to 3.16 and cleanup

* Remove precompiled header hack
* Fixes for compilation on VS2022 Debug configurations
This commit is contained in:
Cacodemon345 2023-08-14 16:20:50 +06:00 committed by Christoph Oelckers
commit 14a3cf8fc2
6 changed files with 38 additions and 42 deletions

View file

@ -1,4 +1,4 @@
cmake_minimum_required( VERSION 3.1.0 )
cmake_minimum_required( VERSION 3.16.0 )
include(precompiled_headers)
@ -409,7 +409,7 @@ set( PLAT_WIN32_SOURCES
)
if (HAVE_VULKAN)
set (PLAT_WIN32_SOURCES ${PLAT_WIN32_SOURCES} common/platform/win32/win32vulkanvideo.cpp )
list (APPEND PLAT_WIN32_SOURCES common/platform/win32/win32vulkanvideo.cpp )
endif()
# todo: implement an actual crash catcher for ARM
@ -697,10 +697,6 @@ set( VM_JIT_SOURCES
common/scripting/jit/jit_store.cpp
)
# This is disabled for now because I cannot find a way to give the .pch file a different name.
# Visual C++ 2015 seems hell-bent on only allowing one .pch file with the same name as the executable.
#enable_precompiled_headers( g_pch2.h FASTMATH_PCH_SOURCES )
# Enable fast math for some sources
set( FASTMATH_SOURCES
rendering/swrenderer/r_all.cpp
@ -773,11 +769,11 @@ if (HAVE_GLES2)
common/rendering/gles/glad/src/glad.c
)
set (FASTMATH_SOURCES ${FASTMATH_SOURCES} ${GLES_SOURCES})
list (APPEND FASTMATH_SOURCES ${GLES_SOURCES})
endif()
if (HAVE_VULKAN)
set (FASTMATH_SOURCES ${FASTMATH_SOURCES} ${VULKAN_SOURCES})
list (APPEND FASTMATH_SOURCES ${VULKAN_SOURCES})
endif()
set (FASTMATH_SOURCES ${FASTMATH_SOURCES})
@ -1186,14 +1182,7 @@ else()
set( NOT_COMPILED_SOURCE_FILES ${NOT_COMPILED_SOURCE_FILES} ${VM_JIT_SOURCES} )
endif()
if( MSVC )
enable_precompiled_headers( g_pch.h PCH_SOURCES )
else()
# Temporary solution for compilers other than MSVC
set_source_files_properties( ${PCH_SOURCES} PROPERTIES COMPILE_FLAGS "-include g_pch.h" )
endif()
add_executable( zdoom WIN32 MACOSX_BUNDLE
set( ZDOOM_SOURCES
${HEADER_FILES}
${NOT_COMPILED_SOURCE_FILES}
${SYSTEM_SOURCES}
@ -1224,10 +1213,18 @@ add_executable( zdoom WIN32 MACOSX_BUNDLE
common/thirdparty/math/fastsin.cpp
)
set( ZDOOM_NONPCH_SOURCES ${ZDOOM_SOURCES} )
list( REMOVE_ITEM ZDOOM_NONPCH_SOURCES ${PCH_SOURCES} )
add_executable( zdoom WIN32 MACOSX_BUNDLE ${ZDOOM_SOURCES} )
target_precompile_headers( zdoom PRIVATE g_pch.h )
set_source_files_properties( ${FASTMATH_SOURCES} PROPERTIES COMPILE_FLAGS ${ZD_FASTMATH_FLAG} )
set_source_files_properties( xlat/parse_xlat.cpp PROPERTIES OBJECT_DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/xlat_parser.c" )
set_source_files_properties( common/engine/sc_man.cpp PROPERTIES OBJECT_DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/sc_man_scanner.h" )
set_source_files_properties( ${NOT_COMPILED_SOURCE_FILES} PROPERTIES HEADER_FILE_ONLY TRUE )
set_source_files_properties( ${ZDOOM_NONPCH_SOURCES} PROPERTIES SKIP_PRECOMPILE_HEADERS TRUE )
if(${CMAKE_SYSTEM_NAME} STREQUAL "SunOS")

View file

@ -38,6 +38,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <stdexcept>
#include <memory>
#include "i_sound.h"
#include "i_music.h"

View file

@ -1,5 +1,8 @@
#pragma once
#include "zstring.h"
#include "tarray.h"
enum class PostProcessUniformType
{
Undefined,

View file

@ -36,6 +36,7 @@
*/
#include <time.h>
#include <string.h>
#include "common/engine/printf.h"
#include "discord_rpc.h"

View file

@ -30,6 +30,8 @@
struct event_t;
#include <functional>
#include "dobjgc.h"
#include "name.h"
#include "gamestate.h"