Commit Graph

84 Commits

Author SHA1 Message Date
Scott Talbert
df46add116 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.

(cherry picked from commit 1b8664426603376b68f8ca3c54de97ec630e5940)
2023-07-22 23:46:32 +02:00
Tobias Taschner
77db8b7d54 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.

See #23347, #23355.

(cherry picked from commit 1edb38b54892273f2f932339d49b91f7b60fd3a4)
2023-07-03 02:56:23 +02:00
Maarten Bent
8437eefbe5 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, #23613.

(cherry picked from commit a801057f1a7fba8e353be9481c1e621b8bf1dbe2)
2023-06-06 21:28:18 +02:00
Maarten Bent
6f0ecd48f0 CMake: Apply no-RTTI compile options directly to targets
Don't set global compile options or defines.

(cherry picked from commit 865f7aced21b03fc522b6b62b6f494221fa36cb8)
2023-03-12 21:10:31 +01:00
Maarten Bent
ba6e78ec62 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

(cherry picked from commit 1051dfd1410673a25a767fb3b448c858f493108a)
2023-03-12 21:10:28 +01:00
Vadim Zeitlin
109ae40aed Merge branch 'cmake-gtk-printing' of https://github.com/MaartenBent/wxWidgets
CMake: Add GTK Printing support.

And show the extra toolkit options in the CMake summary, fix using
libnotify and gnomevfs with gtk3 and fix some unused parameter warnings
when using gtk2 or gtk3 on Windows.

See #22745, #22762.

(cherry picked from commit d9a78be16c95ec9b6877cda93d2446b711cc3d4e)
2022-09-03 23:40:00 +02:00
Vadim Zeitlin
be7f1af640 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.

(cherry picked from commit 667c5c843b89ed46e3a64242f94487866cb8c3be)
2022-08-18 19:34:13 +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
Vadim Zeitlin
7b6c4cb9e9 Include required module before using check_c_source_compiles()
Fix CMake build with 3.10, which gave the following errors

CMake Error at build/cmake/init.cmake:321 (check_c_source_compiles):
  Unknown CMake command "check_c_source_compiles".
Call Stack (most recent call first):
  build/cmake/main.cmake:16 (include)
  CMakeLists.txt:69 (include)

previously. Apparently the required CheckCSourceCompiles module was
already included from somewhere else with later CMake versions, but not
with this one, so do include it explicitly.
2020-12-30 14:26:06 +01:00
Maarten Bent
ab795fa68c Check for winhttp.h presence in CMake too 2020-12-13 16:35:34 +01:00
Maarten Bent
b7450f52ff Fixes to CMake build files for wxWebRequest
Fix wrong library name in wx_add_sample() for webrequest.

Also prefer to disable wxWebRequest if no backends for it are available,
for consistency with the other libraries.
2020-12-13 14:36:31 +01:00
Maarten Bent
62896efd70 CMake: disable wxUSE_GLCANVAS_EGL in non-GTK3 builds
Closes #18947
2020-10-18 18:53:56 +02:00
Maarten Bent
0417dabdbd CMake: use correct media sources in WXQT build
Only check for gstreamer in Unix GTK builds.

Closes #18945
2020-10-18 15:21:31 +02:00
Scott Talbert
35f2fd4be7 Fix linking issues with wxGLCanvasEGL for cmake
1) Link with EGL and wayland-egl libraries (with check for GDK Wayland).
2) Provide a way to force disable the EGL backend.
2020-09-12 15:54:15 -07:00
Scott Talbert
7cd12a2bd6 Add EGL-based backend for wxGLCanvas
Among other things, this enables wxGLCanvas to be used natively on
Wayland.

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

Closes #17702.
2020-09-01 15:03:30 +02:00
Stefan Csomor
dedefa65c1 applying CMake patch from @MaartenBent 2020-07-05 15:54:27 +02:00
Maarten Bent
e4437c4974 Add iOS CMake build to Travis CI
Use the following CMake flags:
-DCMAKE_SYSTEM_NAME=iOS - for specifying it is an iOS build
-DCMAKE_FIND_ROOT_PATH=/usr/local - dir to search for the built wxWidgets libraries
-DCMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED=NO - don't require signing app packages
-DCMAKE_OSX_DEPLOYMENT_TARGET=10.12 - specify a target so both the libraries and sample will use the same architecture

Also use the code signing flag when testing precompiled header support.
Don't build the default samples, widgets sample has features that are not supported by the iOS build.

Xcode seems to rebuild the libraries when installing, so call CMake only once.
2020-06-18 21:20:21 +02:00
Maarten Bent
5041915001 CMake: fix building media and gl lib for iOS 2020-06-18 20:28:19 +02:00
Maarten Bent
1ed8197dfa CMake: prevent mismatched package name warnings
Use all caps for the packages.

Closes https://github.com/wxWidgets/wxWidgets/pull/1886
2020-06-09 23:57:53 +02:00
Maarten Bent
e69755c203 CMake: check if the compiler supports using precompiled headers
Build the cotire test project and check if it succeeds. Also check if the
'had text segment at different address' warning does not appear in the build
output. If it does not succeed, disable usage of precompiled headers.

If the PCH option was changed, clean the project and rebuild it again. Do not
clean everytime the project is configured because (re)building the cotire test
project takes some time.
2020-05-17 20:01:01 +02:00
Maarten Bent
5c2d186132 CMake: Add variable to indicate if c++11 or later is enabled
Use it in macOS checks.
2020-04-07 19:28:46 +02:00
Maarten Bent
c8209a5111 CMake: Set wxBUILD_CXX_STANDARD globally instead of only on targets
This way the tests in setup.cmake will use the correct c++ version.
2020-04-07 19:09:58 +02:00
Maarten Bent
016061311a CMake: Add wxBUILD_FLAVOUR option
It is similar to --with-flavour option from configure.

Mark some build options as advanced.
2020-02-16 21:33:44 +01:00
Maarten Bent
4196c67b72 CMake: Create wx-config for MinGW builds
Use the same output folder for setup.h and wx-config as configure does.
2020-02-16 16:35:24 +01:00
Maarten Bent
ce968d0ecb
Enable building without wxUSE_WEBVIEW_IE 2020-01-17 09:37:12 +01:00
Maarten Bent
a6bfd845b4 CMake: find PangoFT2 when wxUSE_PRIVATE_FONTS is enabled in GTK
Rewrite and simplify FindFontconfig.
2019-11-29 00:21:25 +01:00
Maarten Bent
b42de093f6 CMake: disable wxUSE_MIMETYPE when wxUSE_TEXTFILE is disabled 2019-11-27 21:24:32 +01:00
Maarten Bent
51fc85f16a CMake: disable options when ole or ActiveX is not available 2019-11-27 21:24:32 +01:00
Vadim Zeitlin
d7a640933d Remove wxUSE_WCHAR_T, it must always be 1 anyhow
This is not really an option as building requires it to be 1, so don't
make it one in setup.h/configure/cmake and just hardcode it as 1 for
compatibility.

Closes #18558.
2019-10-31 02:16:19 +01:00
Maarten Bent
7f5ca2a4cb CMake: Fix detecting AppleClang
Policies are now correctly initialized (before creating the project).
Policy CMP0025 changes the compilerID of Clang on Apple, handle this correctly.
2019-07-19 21:13:04 +02:00
Maarten Bent
60b0a1fde2 CMake: Fix MSVC warning when using NMake
Fix warning: Command line warning D9025 : overriding '/W3' with '/W4'
Remove /W3, either via a regex or via new policy CMP0092 (CMake 3.15).

The policy has to be set before calling project(), otherwise the
CMAKE_<LANG>_FLAGS are already initialized.

See https://trac.wxwidgets.org/ticket/18438
2019-07-19 01:09:36 +02:00
Maarten Bent
181a03fc73 CMake: Only use -fno-rtti for C++
Using it for C generates the following warning:
command line option '-fno-rtti' is valid for C++/D/ObjC++ but not for C
2019-07-19 01:09:36 +02:00
Deamhan
0be2d94189 CMake: add an option for using preferred release build flags
Add wxUSE_OPTIMISE build option.

See #18436.

Closes https://github.com/wxWidgets/wxWidgets/pull/1399
2019-07-16 18:34:57 +02:00
Vadim Zeitlin
c219b53a2d Merge branch 'cmake-gcc-static' of https://github.com/Deamhan/wxWidgets
Add support for using static CRT libraries with gcc to CMake build.

See https://github.com/wxWidgets/wxWidgets/pull/1398
2019-07-16 18:25:52 +02:00
Deamhan
7c8d5dd36d CMake: -Wl,--exclude-libs=ALL has been removed for MinGW 2019-07-16 08:24:24 +03:00
Deamhan
f4a0ac93e3 CMake: wxUSE_VISIBILITY is non windows option now & -Wl,--exclude-libs=ALL has been added in MinGW case. 2019-07-15 19:13:58 +03:00