Commit graph

112 commits

Author SHA1 Message Date
Maarten Bent
04cbeb0f8a
CMake: Fix finding threads on Android
See #24298
2024-02-25 14:58:54 +01:00
Maarten Bent
395a61fc9a
CMake: Use user-provided CMAKE_CXX_STANDARD
wxBUILD_CXX_STANDARD is initialized with CMAKE_CXX_STANDARD. But if the user changes
the value of CMAKE_CXX_STANDARD, it would keep using the old wxBUILD_CXX_STANDARD value.
2024-01-28 18:35:04 +01:00
Maarten Bent
57ed33978d
CMake: Group compiler-default checks into a function 2024-01-28 18:32:02 +01:00
Maarten Bent
8aad6ba37a
CMake: Abort if Chromium is enabled on Windows with unsupported compiler
The user has explicitly enabled chromium, so we shouldn't continue without it.
2024-01-28 18:31:35 +01:00
Maarten Bent
cf04523ece
CMake: Show wxWebview overview in configuration summary
Show a list of all the back-ends that are available, similar to what configure does.
Make sure to disable wxUSE_WEBVIEW_WEBKIT when it is not used.
2024-01-28 18:31:17 +01:00
Maarten Bent
cd7e6308cd
CMake: Generalize determining platform name
It is the same as CMAKE_VS_PLATFORM_NAME. Except for win32, which uses an empty name.
2024-01-28 18:19:20 +01:00
Vadim Zeitlin
5e1890c068 Merge branch 'cef-docs'
CEF-related documentation and build improvements.

See #24230.
2024-01-24 17:44:01 +01:00
Vadim Zeitlin
f05177db2a Improve CMake error message if C++17 is not used with CEF
The previous error didn't make sense if CMAKE_CXX_STANDARD wasn't set,
so use a slightly different message in this case.

Also improve the comment explaining why we need C++17 in the first
place.

Co-Authored-By: Maarten Bent <MaartenBent@users.noreply.github.com>
2024-01-24 00:08:04 +01:00
Vadim Zeitlin
fca0c75b2e Don't give an error if compiler supports C++17 by default
Previously CMake would give an error if CMAKE_CXX_STANDARD wasn't
explicitly set to C++17 or greater when using CEF, but this is not
really needed if the compiler supports C++17 without any non-default
options, so check for this too.
2024-01-23 03:45:59 +01:00
Vadim Zeitlin
5480296dd0 Use C++17 when using CEF and not C++14
CEF uses std::in_place_t which is not available in C++14.
2024-01-23 03:29:23 +01:00
Lauri Nurmi
99bc43cefe Introduce minimal MSW ARM support
wxMSW could already be compiled for ARM with MSVC, but due to not
defining any ARCH_SUFFIX for ARM, makefile.vc used to place objectsi
and libraries to the same folder as x86 objects and libraries.

A completely different question is what kind of Windows runs on 32-bit
ARM, and whether one can run regular desktop apps on it.

This commit mimics what f69dbaa1 did for ARM64, and adapts it for ARM.

Closes #24222.
2024-01-21 01:48:16 +01:00
Vadim Zeitlin
ff59ef301b Merge branch 'master' into webview-chromium 2024-01-17 00:22:39 +01:00
Vadim Zeitlin
3b06ab65ff Don't set CMAKE_CXX_STANDARD to 11 by default
Use the compiler default C++ dialect if it is C++11 or higher and only
explicitly request C++11 if the compiler can't compile a small test
using C++11 features by default.

This prevents from unnecessarily adding -std=c++11 to the compiler flags
under Unix, even with compilers using e.g. C++17 by default.
2024-01-06 13:59:09 +01:00
Vadim Zeitlin
adedb499f5 Relax C++ standard requirement when using wxWebviewChromium
Although building CEF itself requires C++17, C++14 is sufficient for
building libcef_dll_wrapper, so allow using it.

Also move the error message a bit more informative.
2023-12-30 02:27:11 +01:00
Paul Cornett
ce1d317768 Remove GLU dependency
See #23721
2023-12-28 14:49:42 -08:00
Maarten Bent
62c6533fa7
CMake: Update webview related checks 2023-12-21 21:26:41 +01:00
PB
10d09ec2b2 Remove outdated parts from build system
Remove support for unsupported MSVS versions earlier than 2015
and Windows versions earlier than 7 from CMake build as they are not
supported any longer.

Also update wxUSE_GRAPHICS_GDIPLUS and wxUSE_GRAPHICS_DIRECT2D comments
in wxMSW setup.h to remove mentions of unsupported Windows XP but do
mention that MinGW-w64 can use Direct2D.

Closes #23787.
2023-08-24 15:15:57 +02:00
Carlo Bramini
590cd0bd18 Fix linking with EGL under Cygwin in CMake builds
Link with OPENGL_egl_LIBRARY if OpenGL::EGL is not defined.

Closes #23673.
2023-07-04 01:37:15 +02:00
Maarten Bent
47041389f5
CMake: Don't show warning when webkit2 4.1 cannot be found
It will still show a warning when webkit2 4.00 can also not be found.

See #23633
2023-06-17 15:13:02 +02:00
Vadim Zeitlin
5cef6223c3 Merge branch 'cmake-imported-libs' of https://github.com/MaartenBent/wxWidgets
CMake: Improve finding library name or path of imported targets.

See #23635.
2023-06-15 23:47:44 +02:00
Vadim Zeitlin
d78399dcc9 Merge branch 'webkit2_support_4.1' of https://github.com/swt2c/wxWidgets
Add support for building WebView with libwebkit2gtk-4.1.

See #23633.
2023-06-15 23:42:11 +02:00
Scott Talbert
1b86644266 Add support for building WebView with libwebkit2gtk-4.1
libwebkit2gtk-4.1 has the same API as libwebkit2gtk-4.0, except that the
former links with libsoup-3.0 and the latter links with libsoup-2.4.

Fixes #23630.
2023-06-13 18:13:59 -04:00
Maarten Bent
e1f0a938f6
CMake: Fix using Cotire for precompiled headers
Cotire doesn't work when $<COMPILE_LANGUAGE:CXX> is used.
2023-06-13 21:19:44 +02:00
Maarten Bent
a801057f1a CMake: Check and enable use of libxkbcommon
CMake's has built-in support for checking xkbcommon using FindX11 since
3.18.

But because older CMake versions are supported, add our own module that
checks if the header and library is available.

See #23410.

Closes #23613.
2023-06-06 21:18:48 +02:00
Tobias Taschner
1edb38b548 Fix MSW lib names for ARM64 with CMake build
Any 64 platform had the added _x64 suffix. This will now be _arm64
when building for ARM64.

Fixes: #23347

Closes #23355.
2023-03-18 20:58:15 +01:00
Maarten Bent
865f7aced2
CMake: Apply no-RTTI compile options directly to targets
Don't set global compile options or defines.
2023-03-10 00:04:51 +01:00
Maarten Bent
1051dfd141
CMake: Enable large file support
Define HAVE_LARGEFILE_SUPPORT and add '_FILE_OFFSET_BITS=64' compile definition.
Make it a PUBLIC definition so it is part of the interface, and defined when importing a target.

Check if fseeko is available, which is used in the large file code.
Also add the compile definition to wxconfig's cppflags, because configure does this too.

Large file support can be disabled with the wxBUILD_LARGEFILE_SUPPORT option, similar to configure's --disable-largefile.

Fixes #22750
2023-03-09 23:55:19 +01:00
Vadim Zeitlin
be7860c766 Remove wxUSE_STD_STRING and wxUSE_STD_CONTAINERS_COMPATIBLY
Assume they are always 1 now, there is no good reason to ever set them
to 0 any more.

Note that we still keep wxUSE_STD_IOSTREAM for now, but we can drop
wxUSE_STD_DEFAULT as it's not worth having it just for this single
option (previously it was used as the default value for 3 of them).
2022-11-17 00:40:50 +01:00
Vadim Zeitlin
885ab36c11 Remove wxUSE_UNICODE option from CMake too
Keep it in build.cfg just in case it's needed for compatibility, but
always define it as 1.
2022-10-27 19:43:30 +02:00
Maarten Bent
7f8cca9245
CMake: Add GTK Printing support
See #22745
2022-08-31 00:22:36 +02:00
Maarten Bent
43aae40a11
CMake: Enable libnotify and gnomevfs for gtk3
Unlike configure, WXGTK2 is not defined internally when WXGTK3 is used.
2022-08-30 23:10:14 +02:00
Maarten Bent
6cb97e2208
CMake: show extra toolkit options in summary
Just like configure does.
2022-08-30 23:07:05 +02:00
PB
897673db64 Set default build compatibility in CMake builds to 3.2
Remove "2.8" and "3.1" from wxBUILD_COMPATIBILITY options.

Add "3.2" to wxBUILD_COMPATIBILITY options and set it as its default value.

Closes #22715.
2022-08-18 21:49:19 +02:00
Artur Wieczorek
8a64c8abdc Remove v2.8 compatibility flag, add v3.2 flag 2022-08-02 08:26:04 +02:00
Maarten Bent
667c5c843b CMake: Improve linking with OpenGL libraries
Don't replace OPENGL_LIBRARIES, but prepend existing targets too it.
Also add OPENGL_EGL_INCLUDE_DIRS to OPENGL_INCLUDE_DIR.

See #22649.

Closes #22677.
2022-07-30 15:02:34 +02:00
Maarten Bent
deaa43e32d CMake: Remove workaround for removing png headers from cairo
CAIRO_INCLUDE_DIRS does not include them with the current FindCairo.cmake.
2022-04-24 18:47:43 +02:00
Maarten Bent
24e20d80e3 CMake: Enable building with Cairo renderer on MSW without GTK 2022-04-20 20:33:18 +02:00
Maarten Bent
4fa3b8c276 CMake: Fix the minimum supported version
Change the minimum version to 3.0. Version 2.8.12 has never worked,
because it does not support the VERSION parameter in project().

Replace GREATER_EQUAL comparisons, these are only supported since 3.7.

Move PCH related code to a separate file, and include it after
options.cmake and init.cmake. Because only then the wxBUILD_PRECOMP
variable is fully initialized.

Closes #22312.
2022-04-16 15:35:49 +02:00
Maarten Bent
34afcb57a8 CMake: Improve Linux GTK2 build
Use version comparison instead of normal comparison for libnotify.
Fix warning if mismatched if statement in FindGNOMEVFS2.
Check for GREATER_EQUAL GTK versions, same as configure does.
Don't check for GTK 1 or define __WXGTK127__. CMake does not support GTK1 and it should not be defined when GTK 2/3/4 is used.
2022-04-14 22:59:08 +02:00
Maarten Bent
f4367b3fee CMake: Use target_precompile_headers when available
Keep using cotire for CMake versions older than 3.16, or when user specifies wxBUILD_PRECOMP=COTIRE.
The scintilla headers need to be specified for target_precompile_headers to work.
Enable it when the target has at least 2 source files (same as cotire does).
2022-04-10 20:46:56 +02:00
Maarten Bent
248927a090 CMake: Never add static runtime flags on macOS
This option is disabled in the GUI, but users can still specify it on the
command-line. Never add the linker flags to prevent errors (unsupported option
'-static-libgcc') or warnings (argument unused during compilation:
'-static-libstdc++').

Closes https://github.com/wxWidgets/wxWidgets/pull/2612

Closes #19330.
2021-12-09 19:59:15 +01:00
Maarten Bent
d2642b4c07 CMake: Enable wxUSE_SPELLCHECK
Find gspell-1 when using GTK3. Also need to find enchant.h.
2021-10-17 14:55:46 +02:00
Maarten Bent
b102afc316 CMake: Don't include generator expression in wxPLATFORM_LIB_DIR
So wxPLATFORM_LIB_DIR can be used in locations where generator expressions are not supported.
2021-10-17 11:52:30 +02:00
Scott Talbert
28f59e8900 cmake: also link with GLU when using EGL
Fixes #19282
2021-10-11 12:43:52 -04:00
Maarten Bent
cd9a35b997 CMake: generate build.cfg 2021-06-18 00:41:45 +02:00
Maarten Bent
3e0057757b CMake: Use a macro to get the flavour
Also include the flavour in builtin target names and include path.
2021-06-06 23:38:38 +02:00
Maarten Bent
f830bde25b CMake: Improve library names
Use the same output names as MSVC and makefile.gcc/vc on Windows, and the same as configure on other platforms.
2021-06-06 23:36:59 +02:00
Stefan Csomor
d1efcc374b Adding GLKit to console and cmake builds 2021-03-15 14:09:07 +01:00
Tobias Taschner
1ee05c54ed
CMake: Download SDK when wxUSE_WEBVIEW_EDGE=ON
Automatically download the WebView2 SDK from nuget (official repo for the SDK)
when enabling wxUSE_WEBVIEW_EDGE to simplify usage.
Copying to 3rdparty/webview2 is still supported optionally.
2021-02-08 21:29:08 +01:00
Maarten Bent
c8a71bc631 CMake: Enable wxUSE_WEBVIEW_EDGE when WebView2 SDK is detected
Only for MSVC >1800 (Visual Studio 2017, vc140) and later.
2021-01-19 22:43:09 +01:00