Skip to content

Commit

Permalink
- temporary solution to fix build of non-MSVC targets
Browse files Browse the repository at this point in the history
Precompilation of prefix header for GCC and Clang requires some efforts thanks to CMake which doesn't support this feature out of the box
Existing thirparty solutions must be tuned to our needs, and our configuration should be adjusted to a chosen module
  • Loading branch information
alexey-lysiuk committed Aug 22, 2019
1 parent a56bdda commit c3edfdd
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 7 deletions.
7 changes: 6 additions & 1 deletion src/CMakeLists.txt
Expand Up @@ -1328,7 +1328,12 @@ else()
set( NOT_COMPILED_SOURCE_FILES ${NOT_COMPILED_SOURCE_FILES} ${VM_JIT_SOURCES} )
endif()

enable_precompiled_headers( g_pch.h PCH_SOURCES )
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
${HEADER_FILES}
Expand Down
2 changes: 2 additions & 0 deletions src/g_pch.h
Expand Up @@ -16,8 +16,10 @@
#include <sys/stat.h>
#include <sys/types.h>
#include <cassert>
#ifdef _MSC_VER
#include <direct.h>
#include <io.h>
#endif // _MSC_VER
#include <limits>
#include <memory>
#include <tuple>
Expand Down
2 changes: 1 addition & 1 deletion src/maploader/glnodes.cpp
Expand Up @@ -1153,7 +1153,7 @@ UNSAFE_CCMD(clearnodecache)

if (!ScanDirectory(list, path))
{
Printf("Unable to scan node cache directory %s\n", path);
Printf("Unable to scan node cache directory %s\n", path.GetChars());
return;
}

Expand Down
1 change: 1 addition & 0 deletions src/utility/files.h
Expand Up @@ -36,6 +36,7 @@
#ifndef FILES_H
#define FILES_H

#include <stddef.h>
#include <stdio.h>
#include <stdint.h>
#include <functional>
Expand Down
5 changes: 0 additions & 5 deletions src/utility/palette.cpp
Expand Up @@ -35,11 +35,6 @@
#include "palette.h"
#include "palentry.h"

#include <float.h>
#include <math.h>
#include <stdlib.h>
#include <string.h>

/****************************/
/* Palette management stuff */
/****************************/
Expand Down

0 comments on commit c3edfdd

Please sign in to comment.