diff --git a/libaegisub/include/lagi_pre.h b/libaegisub/include/lagi_pre.h index 50ce877e2..7dcf1cb2e 100644 --- a/libaegisub/include/lagi_pre.h +++ b/libaegisub/include/lagi_pre.h @@ -1,7 +1,5 @@ #ifdef __cplusplus -#ifndef _WIN32 #include "../acconf.h" -#endif #define WIN32_LEAN_AND_MEAN diff --git a/libaegisub/include/lagi_pre_c.h b/libaegisub/include/lagi_pre_c.h new file mode 100644 index 000000000..622cf2215 --- /dev/null +++ b/libaegisub/include/lagi_pre_c.h @@ -0,0 +1,3 @@ +#include "../acconf.h" + +#define WIN32_LEAN_AND_MEAN \ No newline at end of file diff --git a/libaegisub/meson.build b/libaegisub/meson.build index be19b4860..bb9842bfa 100644 --- a/libaegisub/meson.build +++ b/libaegisub/meson.build @@ -79,13 +79,12 @@ else endif libaegisub_cpp_pch = ['include/lagi_pre.h'] -if cxx.get_id() == 'msvc' - libaegisub_cpp_pch += 'include/lagi_pre.cpp' -endif +libaegisub_c_pch = ['include/lagi_pre_c.h'] libaegisub_inc = include_directories('include') libaegisub = static_library('aegisub', libaegisub_src, acconf, include_directories: [libaegisub_inc, deps_inc], cpp_pch: libaegisub_cpp_pch, + c_pch: libaegisub_c_pch, dependencies: deps) diff --git a/src/include/agi_pre.cpp b/src/include/agi_pre.cpp deleted file mode 100644 index d4d26d28c..000000000 --- a/src/include/agi_pre.cpp +++ /dev/null @@ -1,6 +0,0 @@ -// 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 index c40b0b862..e82216b88 100644 --- a/src/include/agi_pre.h +++ b/src/include/agi_pre.h @@ -48,9 +48,7 @@ #define _CRT_SECURE_NO_WARNINGS #endif -#ifndef _WIN32 #include "../../acconf.h" -#endif #define WIN32_LEAN_AND_MEAN diff --git a/src/include/agi_pre_c.h b/src/include/agi_pre_c.h new file mode 100644 index 000000000..c4d6924f4 --- /dev/null +++ b/src/include/agi_pre_c.h @@ -0,0 +1,46 @@ +// 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/ + +#include "../../acconf.h" + +#define WIN32_LEAN_AND_MEAN + +#ifdef _WIN32 +#include +#include +#else +#include +#endif + +#ifdef HAVE_OPENGL_GL_H +#include +#else +#include +#endif + diff --git a/src/meson.build b/src/meson.build index bf6a564f1..34d5da291 100644 --- a/src/meson.build +++ b/src/meson.build @@ -198,13 +198,12 @@ foreach opt: opt_src endforeach aegisub_cpp_pch = ['include/agi_pre.h'] -if cxx.get_id() == 'msvc' - aegisub_cpp_pch += 'include/agi_pre.cpp' -endif +aegisub_c_pch = ['include/agi_pre_c.h'] aegisub = executable('aegisub', aegisub_src, version_h, acconf, link_with: [libresrc, libluabins, libaegisub], include_directories: [libaegisub_inc, libresrc_inc, version_inc, deps_inc], cpp_pch: aegisub_cpp_pch, + c_pch: aegisub_c_pch, install: true, dependencies: deps)