diff --git a/src/game/meson.build b/src/game/meson.build index 760270fa66f..fe73a37116e 100644 --- a/src/game/meson.build +++ b/src/game/meson.build @@ -117,7 +117,6 @@ game_sources = [ 'Arena/ArenaTeam.cpp', 'Arena/ArenaTeamHandler.cpp', 'VoiceChat/VoiceChatHandler.cpp', - 'pchdef.cpp', 'DBScripts/ScriptMgr.cpp', 'Maps/SpawnGroup.cpp', 'Maps/GridMap.cpp', diff --git a/src/shared/meson.build b/src/shared/meson.build index c6fd0a67271..85fd4bd9dde 100644 --- a/src/shared/meson.build +++ b/src/shared/meson.build @@ -4,7 +4,6 @@ shared_sources = [ 'Util.cpp', 'Multithreading/Messager.cpp', 'Log.cpp', - 'pchdef.cpp', 'ProgressBar.cpp', 'Threading.cpp', 'ByteBuffer.cpp', @@ -74,11 +73,18 @@ actual_rev = vcs_tag( replace_string: '@REVISION_DATE@' ) +if not get_option('PCH') + pch_files = [] +else + pch_files = ['../shared/pchdef.h', '../shared/pchdef.cpp'] +endif + if get_option('BUILD_GAME_SERVER') or get_option('BUILD_LOGIN_SERVER') sharedlib = static_library('shared', [actual_rev, shared_sources], include_directories: [global_includes, shared_inc], dependencies: [zlib_dep, boost_dep, mariadb_dep, mysql_dep, postgresql_dep, openssl_dep, utfcpp_dep], + cpp_pch: pch_files, link_with: [frameworklib], install : false )