From 8cc1671db2aab60b3f0876171ad76e1f77b0ce0c Mon Sep 17 00:00:00 2001 From: Matt Ihnen Date: Wed, 6 Mar 2024 21:21:14 -0600 Subject: [PATCH 1/3] Add ability to disable example apps --- CMakeLists.txt | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 55fc44a1..ca7271a7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,12 +9,18 @@ set(LWIP_DIR ${CMAKE_CURRENT_SOURCE_DIR}) set (LWIP_DEFINITIONS LWIP_DEBUG=1) -if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows") - add_subdirectory(${LWIP_DIR}/contrib/ports/win32/example_app) -elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Linux" OR ${CMAKE_SYSTEM_NAME} STREQUAL "Darwin") - add_subdirectory(${LWIP_DIR}/contrib/ports/unix/example_app) +OPTION(LWIP_OPTION_ENABLE_EXAMPLE_APPS "Build example apps on win32/unix/darwin" ON) + +if (LWIP_OPTION_ENABLE_EXAMPLE_APPS) + if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows") + add_subdirectory(${LWIP_DIR}/contrib/ports/win32/example_app) + elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Linux" OR ${CMAKE_SYSTEM_NAME} STREQUAL "Darwin") + add_subdirectory(${LWIP_DIR}/contrib/ports/unix/example_app) + else() + message(WARNING "Host ${CMAKE_SYSTEM_NAME} is not supported to build example_app") + endif() else() - message(WARNING "Host ${CMAKE_SYSTEM_NAME} is not supported to build example_app") + message(STATUS "example_app build disabled") endif() # Source package generation From 0382126c8ace8ff2d452960bf980a4a27460d7e1 Mon Sep 17 00:00:00 2001 From: Matt Ihnen Date: Wed, 6 Mar 2024 21:28:14 -0600 Subject: [PATCH 2/3] Keep "option" lower case to be consistent with the rest of the cmake files. --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ca7271a7..b664574b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,7 +9,7 @@ set(LWIP_DIR ${CMAKE_CURRENT_SOURCE_DIR}) set (LWIP_DEFINITIONS LWIP_DEBUG=1) -OPTION(LWIP_OPTION_ENABLE_EXAMPLE_APPS "Build example apps on win32/unix/darwin" ON) +option(LWIP_OPTION_ENABLE_EXAMPLE_APPS "Build example apps on win32/unix/darwin" ON) if (LWIP_OPTION_ENABLE_EXAMPLE_APPS) if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows") From 94d687d9e5fcf37a74142b28858ef56ecd65ace1 Mon Sep 17 00:00:00 2001 From: Matt Ihnen Date: Wed, 20 Mar 2024 10:04:53 -0500 Subject: [PATCH 3/3] Update option description to indicate linux instead of unix as per PR feedback. --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b664574b..ed9ba399 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,7 +9,7 @@ set(LWIP_DIR ${CMAKE_CURRENT_SOURCE_DIR}) set (LWIP_DEFINITIONS LWIP_DEBUG=1) -option(LWIP_OPTION_ENABLE_EXAMPLE_APPS "Build example apps on win32/unix/darwin" ON) +option(LWIP_OPTION_ENABLE_EXAMPLE_APPS "Build example apps on win32/linux/darwin" ON) if (LWIP_OPTION_ENABLE_EXAMPLE_APPS) if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows")