Precompile sol.hpp in order to reduce compilation time.

switch-to-ppa
Petr Mikheev 2 years ago committed by Evil Eye
parent 4d346fefd6
commit d3df3efaf1

@ -414,7 +414,8 @@ else(USE_LUAJIT)
endif(USE_LUAJIT)
# C++ library binding to Lua
set(SOL_INCLUDE_DIRS ${OpenMW_SOURCE_DIR}/extern/sol3.2.2 ${OpenMW_SOURCE_DIR}/extern/sol_config)
set(SOL_INCLUDE_DIR ${OpenMW_SOURCE_DIR}/extern/sol3.2.2)
set(SOL_CONFIG_DIR ${OpenMW_SOURCE_DIR}/extern/sol_config)
include_directories(
BEFORE SYSTEM
@ -426,7 +427,8 @@ include_directories(
${OPENGL_INCLUDE_DIR}
${BULLET_INCLUDE_DIRS}
${LUA_INCLUDE_DIR}
${SOL_INCLUDE_DIRS}
${SOL_INCLUDE_DIR}
${SOL_CONFIG_DIR}
)
link_directories(${SDL2_LIBRARY_DIRS} ${Boost_LIBRARY_DIRS})

@ -153,9 +153,12 @@ target_link_libraries(openmw
"osg-ffmpeg-videoplayer"
"oics"
components
${LUA_LIBRARIES}
)
if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.16)
target_precompile_headers(openmw PRIVATE ${SOL_INCLUDE_DIR}/sol/sol.hpp)
endif ()
if (ANDROID)
target_link_libraries(openmw EGL android log z)
endif (ANDROID)

@ -1,4 +1,6 @@
#ifndef stderr
int stderr = 0; // Hack: fix linker error
#endif
#include "SDL_main.h"
#include <SDL_gamecontroller.h>

@ -70,7 +70,7 @@ if (GTEST_FOUND AND GMOCK_FOUND)
openmw_add_executable(openmw_test_suite openmw_test_suite.cpp ${UNITTEST_SRC_FILES})
target_link_libraries(openmw_test_suite ${GMOCK_LIBRARIES} components ${LUA_LIBRARIES})
target_link_libraries(openmw_test_suite ${GMOCK_LIBRARIES} components)
# Fix for not visible pthreads functions for linker with glibc 2.15
if (UNIX AND NOT APPLE)
target_link_libraries(openmw_test_suite ${CMAKE_THREAD_LIBS_INIT})

@ -283,6 +283,7 @@ target_link_libraries(components
${SDL2_LIBRARIES}
${OPENGL_gl_LIBRARY}
${MyGUI_LIBRARIES}
${LUA_LIBRARIES}
LZ4::LZ4
RecastNavigation::DebugUtils
RecastNavigation::Detour
@ -371,3 +372,7 @@ endif(OSG_STATIC)
if(USE_QT)
set_property(TARGET components_qt PROPERTY AUTOMOC ON)
endif(USE_QT)
if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.16)
target_precompile_headers(components PRIVATE ${SOL_INCLUDE_DIR}/sol/sol.hpp)
endif ()

Loading…
Cancel
Save