Removed pch.h:

- Under linux pch.h won't work as expected, instead it will slow down build time. In order to fix this, target_precompile_headers cmake function must have every header that will be used in pch.hxx generation.
- Using the opportunity i've removed headers that aren't essential in precompiled header
This commit is contained in:
Patrix
2023-01-09 20:21:46 +01:00
parent 22b53bd3d5
commit 2e427b0c5d
4 changed files with 13 additions and 11 deletions

View File

@@ -18,7 +18,17 @@ file(GLOB SRC
) )
add_library(squirrel-template SHARED ${SRC}) add_library(squirrel-template SHARED ${SRC})
target_precompile_headers(squirrel-template PRIVATE "src/pch.h")
target_compile_definitions(squirrel-template
PRIVATE
SCRAT_EXPORT
)
target_precompile_headers(squirrel-template
PRIVATE
"src/api/module_api.h"
"src/api/squirrel_api.h"
)
target_include_directories(squirrel-template target_include_directories(squirrel-template
INTERFACE INTERFACE

View File

@@ -1,4 +1,4 @@
#include "pch.h" #include "module_api.h"
namespace SqModule namespace SqModule
{ {

View File

@@ -1,8 +0,0 @@
#define QUOTIFY(arg) #arg
#define STRINGIFY(arg) QUOTIFY(arg)
#define SCRAT_EXPORT // Used to get SQRAT_API macro for sqmodule_load func (export function)
#include "api/module_api.h"
#include "api/squirrel_api.h"
#include "sqrat.h"

View File

@@ -1,4 +1,4 @@
#include "pch.h" #include <sqrat.h>
extern "C" SQRESULT SQRAT_API sqmodule_load(HSQUIRRELVM vm, HSQAPI api) extern "C" SQRESULT SQRAT_API sqmodule_load(HSQUIRRELVM vm, HSQAPI api)
{ {