Ver Fonte

Add filtering for Zephyr buildsystem

Zephyr runs cmake on every module it is provided, so we add filtering
not to build CivetWeb unless explicitly configured.

This commit also tightens the verification if we're actually building
Zephyr or not (KERNEL_NAME can be modified).
Piotr Zierhoffer há 6 anos atrás
pai
commit
ac92f0a630
1 ficheiros alterados com 4 adições e 1 exclusões
  1. 4 1
      CMakeLists.txt

+ 4 - 1
CMakeLists.txt

@@ -38,7 +38,7 @@ determine_target_architecture(CIVETWEB_ARCHITECTURE)
 include(GNUInstallDirs)
 include(GNUInstallDirs)
 
 
 # Detect the platform reliably
 # Detect the platform reliably
-if(${KERNEL_NAME} MATCHES "zephyr")
+if(ZEPHYR_BASE)
     SET(ZEPHYR YES)
     SET(ZEPHYR YES)
 elseif(NOT MACOSX AND ${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
 elseif(NOT MACOSX AND ${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
     SET(DARWIN YES)
     SET(DARWIN YES)
@@ -421,6 +421,9 @@ if (NOT ZEPHYR)
   add_c_compiler_flag(-fstack-protector-strong RELEASE)
   add_c_compiler_flag(-fstack-protector-strong RELEASE)
   add_c_compiler_flag(-fstack-protector-all DEBUG)
   add_c_compiler_flag(-fstack-protector-all DEBUG)
 else()
 else()
+  if (NOT CONFIG_CIVETWEB)
+    return()
+  endif()
   # This policy is needed to override options with variables
   # This policy is needed to override options with variables
   cmake_policy(SET CMP0077 NEW)
   cmake_policy(SET CMP0077 NEW)