diff --git a/libaegisub/include/lagi_pre.h b/libaegisub/include/lagi_pre.h deleted file mode 120000 index 13ed6ac57..000000000 --- a/libaegisub/include/lagi_pre.h +++ /dev/null @@ -1 +0,0 @@ -../lagi_pre.h \ No newline at end of file diff --git a/libaegisub/include/lagi_pre.h b/libaegisub/include/lagi_pre.h new file mode 100644 index 000000000..50ce877e2 --- /dev/null +++ b/libaegisub/include/lagi_pre.h @@ -0,0 +1,43 @@ +#ifdef __cplusplus +#ifndef _WIN32 +#include "../acconf.h" +#endif + +#define WIN32_LEAN_AND_MEAN + +// Common C +#include +#include +#include +#include +#include +#include + +// Common C++ +#ifdef _MSC_VER +#pragma warning(push) +#pragma warning(disable:4996) +#endif + +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef _MSC_VER +#pragma warning(pop) +#endif + +// Boost +#include +#include +#include +#define BOOST_NO_SCOPED_ENUMS +#include +#undef BOOST_NO_SCOPED_ENUMS +#include +#endif diff --git a/libaegisub/lagi_pre.h b/libaegisub/lagi_pre.h deleted file mode 100644 index 50ce877e2..000000000 --- a/libaegisub/lagi_pre.h +++ /dev/null @@ -1,43 +0,0 @@ -#ifdef __cplusplus -#ifndef _WIN32 -#include "../acconf.h" -#endif - -#define WIN32_LEAN_AND_MEAN - -// Common C -#include -#include -#include -#include -#include -#include - -// Common C++ -#ifdef _MSC_VER -#pragma warning(push) -#pragma warning(disable:4996) -#endif - -#include -#include -#include -#include -#include -#include -#include -#include - -#ifdef _MSC_VER -#pragma warning(pop) -#endif - -// Boost -#include -#include -#include -#define BOOST_NO_SCOPED_ENUMS -#include -#undef BOOST_NO_SCOPED_ENUMS -#include -#endif diff --git a/libaegisub/meson.build b/libaegisub/meson.build index a02cc8750..be19b4860 100644 --- a/libaegisub/meson.build +++ b/libaegisub/meson.build @@ -63,7 +63,6 @@ else 'windows/access.cpp', 'windows/charset_conv_win.cpp', 'windows/fs.cpp', - 'windows/lagi_pre.cpp', 'windows/log_win.cpp', 'windows/path_win.cpp', 'windows/util_win.cpp', @@ -79,10 +78,14 @@ else endif endif -libaegisub_cpp_pch = ['lagi_pre.h'] +libaegisub_cpp_pch = ['include/lagi_pre.h'] +if cxx.get_id() == 'msvc' + libaegisub_cpp_pch += 'include/lagi_pre.cpp' +endif + libaegisub_inc = include_directories('include') libaegisub = static_library('aegisub', libaegisub_src, acconf, - include_directories: libaegisub_inc, - cpp_pch: 'include/lagi_pre.h', + include_directories: [libaegisub_inc, deps_inc], + cpp_pch: libaegisub_cpp_pch, dependencies: deps) diff --git a/libaegisub/windows/lagi_pre.cpp b/libaegisub/windows/lagi_pre.cpp deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/agi_pre.cpp b/src/agi_pre.cpp deleted file mode 100644 index a9486c83e..000000000 --- a/src/agi_pre.cpp +++ /dev/null @@ -1 +0,0 @@ -// A dummy file for compiling the precompiled header with VC++ diff --git a/src/agi_pre.h b/src/agi_pre.h deleted file mode 100644 index 63e045dca..000000000 --- a/src/agi_pre.h +++ /dev/null @@ -1,217 +0,0 @@ -// Copyright (c) 2006, Rodrigo Braz Monteiro -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// * Redistributions of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// * Neither the name of the Aegisub Group nor the names of its contributors -// may be used to endorse or promote products derived from this software -// without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -// POSSIBILITY OF SUCH DAMAGE. -// -// Aegisub Project http://www.aegisub.org/ - -/// @file agi_pre.h -/// @brief Precompiled headers include file, including all headers that should be precompiled -/// @ingroup main -/// -/// In order to use it, set the project to use this header as precompiled and -/// insert it in every source file (under C/C++ -> Advanced -> Force Includes), -/// then set stdwx.cpp to generate the precompiled header -/// -/// @note Make sure that you disable use of precompiled headers on md5.c and -/// MatroskaParser.c, as well as any possible future .c files. - -#ifdef __cplusplus - -// Block msvc from complaining about not using msvc-specific versions for -// insecure C functions. -#ifdef _CRT_SECURE_NO_WARNINGS -#define _CRT_SECURE_NO_WARNINGS_DEFINED -#else -#define _CRT_SECURE_NO_WARNINGS -#endif - -#ifndef _WIN32 -#include "../acconf.h" -#endif - -#define WIN32_LEAN_AND_MEAN - -// Common C -#include -#include -#include -#include -#include -#include -#include - -#ifdef _MSC_VER -#pragma warning(push) -#pragma warning(disable:4996) -#endif - -// Common C++ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#ifdef _MSC_VER -#pragma warning(pop) -#endif - -#ifdef _WIN32 -#include -#include -#else -#include -#endif - -// Boost -#include -#include -#include -#include -#include -#include -#include -#include -#define BOOST_NO_SCOPED_ENUMS -#include -#undef BOOST_NO_SCOPED_ENUMS -#include -#include - -// wxWidgets headers -#include // Leave this first. - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#ifdef HAVE_OPENGL_GL_H -#include -#else -#include -#endif - -#ifndef _CRT_SECURE_NO_WARNINGS_DEFINED -#undef _CRT_SECURE_NO_WARNINGS -#endif - -#endif diff --git a/src/include/agi_pre.cpp b/src/include/agi_pre.cpp new file mode 100644 index 000000000..d4d26d28c --- /dev/null +++ b/src/include/agi_pre.cpp @@ -0,0 +1,6 @@ +// A dummy file for compiling the precompiled header with VC++ +#if !defined(_MSC_VER) +#error "This file is only for use with MSVC." +#endif + +#include "agi_pre.h" diff --git a/src/include/agi_pre.h b/src/include/agi_pre.h deleted file mode 120000 index 7b2f4b2e2..000000000 --- a/src/include/agi_pre.h +++ /dev/null @@ -1 +0,0 @@ -../agi_pre.h \ No newline at end of file diff --git a/src/include/agi_pre.h b/src/include/agi_pre.h new file mode 100644 index 000000000..63e045dca --- /dev/null +++ b/src/include/agi_pre.h @@ -0,0 +1,217 @@ +// Copyright (c) 2006, Rodrigo Braz Monteiro +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// * Neither the name of the Aegisub Group nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// +// Aegisub Project http://www.aegisub.org/ + +/// @file agi_pre.h +/// @brief Precompiled headers include file, including all headers that should be precompiled +/// @ingroup main +/// +/// In order to use it, set the project to use this header as precompiled and +/// insert it in every source file (under C/C++ -> Advanced -> Force Includes), +/// then set stdwx.cpp to generate the precompiled header +/// +/// @note Make sure that you disable use of precompiled headers on md5.c and +/// MatroskaParser.c, as well as any possible future .c files. + +#ifdef __cplusplus + +// Block msvc from complaining about not using msvc-specific versions for +// insecure C functions. +#ifdef _CRT_SECURE_NO_WARNINGS +#define _CRT_SECURE_NO_WARNINGS_DEFINED +#else +#define _CRT_SECURE_NO_WARNINGS +#endif + +#ifndef _WIN32 +#include "../acconf.h" +#endif + +#define WIN32_LEAN_AND_MEAN + +// Common C +#include +#include +#include +#include +#include +#include +#include + +#ifdef _MSC_VER +#pragma warning(push) +#pragma warning(disable:4996) +#endif + +// Common C++ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef _MSC_VER +#pragma warning(pop) +#endif + +#ifdef _WIN32 +#include +#include +#else +#include +#endif + +// Boost +#include +#include +#include +#include +#include +#include +#include +#include +#define BOOST_NO_SCOPED_ENUMS +#include +#undef BOOST_NO_SCOPED_ENUMS +#include +#include + +// wxWidgets headers +#include // Leave this first. + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef HAVE_OPENGL_GL_H +#include +#else +#include +#endif + +#ifndef _CRT_SECURE_NO_WARNINGS_DEFINED +#undef _CRT_SECURE_NO_WARNINGS +#endif + +#endif diff --git a/src/meson.build b/src/meson.build index 183cfb075..bf6a564f1 100644 --- a/src/meson.build +++ b/src/meson.build @@ -197,9 +197,14 @@ foreach opt: opt_src endif endforeach +aegisub_cpp_pch = ['include/agi_pre.h'] +if cxx.get_id() == 'msvc' + aegisub_cpp_pch += 'include/agi_pre.cpp' +endif + aegisub = executable('aegisub', aegisub_src, version_h, acconf, link_with: [libresrc, libluabins, libaegisub], - include_directories: [libaegisub_inc, libresrc_inc, version_inc], - cpp_pch: 'include/agi_pre.h', + include_directories: [libaegisub_inc, libresrc_inc, version_inc, deps_inc], + cpp_pch: aegisub_cpp_pch, install: true, dependencies: deps)