From: "cron2 (Code Review)" Date: Fri, 14 Feb 2025 13:06:52 +0000 In-Reply-To: References: Reply-To: gert@...1296..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, frank@...2641... Message-ID: <60dbd6d239dda9933fcfa6080ea455a0a158b727-EmailReplacePatchSet-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="V3qIrCCc+eg="; charset=UTF-8 Subject: [Openvpn-devel] [S] Change in openvpn[master]: Add (fake) Android cmake building List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: plaisthos , flichtenheld Cc: openvpn-devel --V3qIrCCc+eg= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable cron2 has uploaded a new patch set (#4) to the change originally created by= plaisthos. ( http://gerrit.openvpn.net/c/openvpn/+/895?usp=3Demail ) The following approvals got outdated and were removed: Code-Review+2 by flichtenheld Change subject: Add (fake) Android cmake building ...................................................................... Add (fake) Android cmake building There is a mode to build with a real Android NDK that requires setting up cmake to build with the NDK and so. For quick&dirty compile tests that do not actually use the Android NDK on Linux, -DFAKE_ANDROID on Linux can be used to compile a binary using TARGET_ANDROID. Change-Id: If6afa1108f9234f98afdbe0de7b7320403871772 Signed-off-by: Arne Schwabe Acked-by: Frank Lichtenheld Message-Id: <20250214125238.17558-1-gert@...1296...> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg30= 885.html Signed-off-by: Gert Doering --- M CMakeLists.txt M config.h.cmake.in 2 files changed, 12 insertions(+), 1 deletion(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/95/895/4 diff --git a/CMakeLists.txt b/CMakeLists.txt index 5081e81..b04adce 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -39,6 +39,7 @@ option(ENABLE_LZO "BUILD with lzo" ON) option(ENABLE_PKCS11 "BUILD with pkcs11-helper" ON) option(USE_WERROR "Treat compiler warnings as errors (-Werror)" ON) +option(FAKE_ANDROID "Target Android but do not use actual cross compile/An= droid cmake to build for simple compile checks on Linux") set(PLUGIN_DIR /usr/local/lib/openvpn/plugins CACHE FILEPATH "Location of = the plugin directory") @@ -122,7 +123,14 @@ set(CMAKE_C_STANDARD 11) # Set the various defines for config.h.cmake.in -if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux") +if (${CMAKE_SYSTEM_NAME} STREQUAL "Android" OR ${FAKE_ANDROID}) + set(TARGET_ANDROID YES) + set(ENABLE_ASYNC_PUSH YES) + set(ENABLE_SITNL YES) + set(HAVE_LINUX_TYPES_H 1) + # Wacky workaround as OpenSSL package detection is otherwise broken (h= ttps://stackoverflow.com/questions/45958214/android-cmake-could-not-find-op= enssl) + list(APPEND CMAKE_FIND_ROOT_PATH ${OPENSSL_ROOT_DIR}) +elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Linux") set(TARGET_LINUX YES) set(ENABLE_ASYNC_PUSH YES) set(ENABLE_LINUXDCO YES) diff --git a/config.h.cmake.in b/config.h.cmake.in index 74a53a6..2f7b43d 100644 --- a/config.h.cmake.in +++ b/config.h.cmake.in @@ -432,6 +432,9 @@ /* Are we running WIN32? */ #cmakedefine TARGET_WIN32 +/* Are we targeting Android? */ +#cmakedefine TARGET_ANDROID + #define TARGET_ALIAS "@CMAKE_SYSTEM_NAME@" /* Enable GNU extensions on systems that have them. */ -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/895?usp=3Demail To unsubscribe, or for help writing mail filters, visit http://gerrit.openv= pn.net/settings Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: If6afa1108f9234f98afdbe0de7b7320403871772 Gerrit-Change-Number: 895 Gerrit-PatchSet: 4 Gerrit-Owner: plaisthos Gerrit-Reviewer: flichtenheld Gerrit-CC: openvpn-devel Gerrit-MessageType: newpatchset --V3qIrCCc+eg= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

cron2 uploaded patch set #4 to the change originally cr= eated by plaisthos.

View Change

The following approvals got outdated= and were removed: Code-Review+2 by flichtenheld

Add (fake) Android cmake building

Ther= e is a mode to build with a real Android NDK that requires setting
up cm= ake to build with the NDK and so.
For quick&dirty compile tests that= do not actually use the Android NDK
on Linux, -DFAKE_ANDROID on Linux c= an be used to compile a binary using
TARGET_ANDROID.

Change-Id: I= f6afa1108f9234f98afdbe0de7b7320403871772
Signed-off-by: Arne Schwabe <= ;arne@...1227...>
Acked-by: Frank Lichtenheld <frank@...2641...>= ;
Message-Id: <20250214125238.17558-1-gert@...1296...>
URL: htt= ps://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg30885.html=
Signed-off-by: Gert Doering <gert@...1296...>
---
M CMakeLi= sts.txt
M config.h.cmake.in
2 files changed, 12 insertions(+), 1 dele= tion(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/chan=
ges/95/895/4
diff --git a/CMakeLists.txt b/CMakeLists.txtindex 5081e81..b04adce 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -39,6 +39,7 @@
option(ENABLE_LZO "BUILD with lzo" ON)
option(ENABLE_PKCS11 "BUILD with pkcs11-helper" ON)

= option(USE_WERROR "Treat compiler warnings as errors (-Werror)&= quot; ON)
+option(FAK= E_ANDROID "Target Android but do not use actual cross compile/Android = cmake to build for simple compile checks on Linux")
<= /span>
set(PLUGIN_DIR /usr/local/lib/openvpn/plugins CACHE FILEPA= TH "Location of the plugin directory")
@@ -122,7 +123,14 @@
set(CMAKE_C_STANDARD 11)

# Set the various defines for config.h.cmake= .in
-if (${CMAKE_SYSTEM= _NAME} STREQUAL "Linux")
+if (${CMAKE_SYSTEM_NAME} STREQUAL "Android" OR ${F= AKE_ANDROID})
+ se= t(TARGET_ANDROID YES)
+ set(ENABLE_ASYNC_PUSH YES)
+ set(ENABLE_SITNL YES)
+ set(HAVE_LINUX_TYPES_H 1)
+ # Wacky workaround as OpenSSL package dete= ction is otherwise broken (https://stackoverflow.com/questions/45958214/and= roid-cmake-could-not-find-openssl)
+ list(APPEND CMAKE_FIND_ROOT_PATH ${OPENSSL_ROOT_DIR})
+elseif (${CMAKE_SYSTEM= _NAME} STREQUAL "Linux")
set(TARGET_LINUX YE= S)
set(ENABLE_ASYNC_PUSH YES)
set= (ENABLE_LINUXDCO YES)
diff --git a/config.h.cmake.in b/conf= ig.h.cmake.in
index 74a53a6..2f7b43d 100644
--- a/config.h.cmake.in

+++ b/config.h.cmake.in
= @@ -432,6 +432,9 @@
/* Are we running WIN32? */
#cmakedefine TARGET_WIN32

+/* Are we targeting Android? */=
+#cmakedefine TARGET_ANDROI= D
+
= #define TARGET_ALIAS "@CMAKE_SYSTEM_NAME@"

/* Enable GNU extensions on systems that have them. */=

To view, visit change 895. To unsubscribe, or for = help writing mail filters, visit settings.

=
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: If6afa1108f9234f98afdbe0de7b= 7320403871772
Gerrit-Change-Number: 895
Gerrit-PatchSet: 4
Gerrit-Owner: plaisthos <arne-openvpn@...1711...= 27...>
Gerrit-Reviewer: flichtenheld <frank@...2716...= 1...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
Gerrit-MessageType: newpatchset
--V3qIrCCc+eg=--