diff options
-rw-r--r-- | zephyr/test/drivers/CMakeLists.txt | 5 | ||||
-rw-r--r-- | zephyr/test/drivers/chargesplash/CMakeLists.txt | 15 | ||||
-rw-r--r-- | zephyr/test/drivers/isl923x/CMakeLists.txt | 21 | ||||
-rw-r--r-- | zephyr/test/drivers/led_driver/CMakeLists.txt | 16 | ||||
-rw-r--r-- | zephyr/test/drivers/usb_malfunction_sink/CMakeLists.txt | 15 | ||||
-rw-r--r-- | zephyr/test/drivers/usbc_alt_mode/CMakeLists.txt | 9 |
6 files changed, 13 insertions, 68 deletions
diff --git a/zephyr/test/drivers/CMakeLists.txt b/zephyr/test/drivers/CMakeLists.txt index 91b90a9dc4..1db421dd7b 100644 --- a/zephyr/test/drivers/CMakeLists.txt +++ b/zephyr/test/drivers/CMakeLists.txt @@ -6,8 +6,9 @@ cmake_minimum_required(VERSION 3.13.1) find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) project(${ZMAKE_PROJECT_NAME}) -zephyr_include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include) -zephyr_include_directories("${PLATFORM_EC}/driver/ppc/") +target_include_directories(app PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR}/include + "${PLATFORM_EC}/driver/ppc/") # Common sources target_sources(app PRIVATE diff --git a/zephyr/test/drivers/chargesplash/CMakeLists.txt b/zephyr/test/drivers/chargesplash/CMakeLists.txt index aa8de2c683..1dbd58fd76 100644 --- a/zephyr/test/drivers/chargesplash/CMakeLists.txt +++ b/zephyr/test/drivers/chargesplash/CMakeLists.txt @@ -2,18 +2,5 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -# Create library name based on current directory -zephyr_library_get_current_dir_lib_name(${ZEPHYR_BASE} lib_name) - -# Create interface library -zephyr_interface_library_named(${lib_name}) - -# Add include paths -zephyr_include_directories("${CMAKE_CURRENT_SOURCE_DIR}") -zephyr_include_directories("${CMAKE_CURRENT_SOURCE_DIR}/include") - # Add source files -zephyr_library_sources("${CMAKE_CURRENT_SOURCE_DIR}/src/chargesplash.c") - -# Link in the library -zephyr_library_link_libraries(${lib_name}) +target_sources(app PRIVATE src/chargesplash.c) diff --git a/zephyr/test/drivers/isl923x/CMakeLists.txt b/zephyr/test/drivers/isl923x/CMakeLists.txt index 36a97589c1..809d9f0862 100644 --- a/zephyr/test/drivers/isl923x/CMakeLists.txt +++ b/zephyr/test/drivers/isl923x/CMakeLists.txt @@ -2,21 +2,8 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -# Create library name based on current directory -zephyr_library_get_current_dir_lib_name(${ZEPHYR_BASE} lib_name) - -# Create interface library -zephyr_interface_library_named(${lib_name}) - -# Add include paths -zephyr_include_directories("${CMAKE_CURRENT_SOURCE_DIR}") -zephyr_include_directories("${CMAKE_CURRENT_SOURCE_DIR}/include") - # Add source files -zephyr_library_sources_ifdef(CONFIG_PLATFORM_EC_CONSOLE_CMD_CHARGER_ADC_AMON_BMON - "${CMAKE_CURRENT_SOURCE_DIR}/src/console_cmd_amon_bmon.c") -zephyr_library_sources_ifdef(CONFIG_PLATFORM_EC_CHARGE_RAMP_HW - "${CMAKE_CURRENT_SOURCE_DIR}/src/charge_ramp_hw.c") - -# Link in the library -zephyr_library_link_libraries(${lib_name}) +target_sources_ifdef(CONFIG_PLATFORM_EC_CONSOLE_CMD_CHARGER_ADC_AMON_BMON + app PRIVATE src/console_cmd_amon_bmon.c) +target_sources_ifdef(CONFIG_PLATFORM_EC_CHARGE_RAMP_HW + app PRIVATE src/charge_ramp_hw.c) diff --git a/zephyr/test/drivers/led_driver/CMakeLists.txt b/zephyr/test/drivers/led_driver/CMakeLists.txt index 2f96eba2d3..3e4f48724d 100644 --- a/zephyr/test/drivers/led_driver/CMakeLists.txt +++ b/zephyr/test/drivers/led_driver/CMakeLists.txt @@ -2,19 +2,9 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -# Create library name based on current directory -zephyr_library_get_current_dir_lib_name(${ZEPHYR_BASE} lib_name) - -# Create interface library -zephyr_interface_library_named(${lib_name}) - # Add include paths -zephyr_include_directories("${CMAKE_CURRENT_SOURCE_DIR}") -zephyr_include_directories("${CMAKE_CURRENT_SOURCE_DIR}/include") -zephyr_include_directories("${PLATFORM_EC}/zephyr/shim/src/led_driver") +target_include_directories(app PRIVATE + "${PLATFORM_EC}/zephyr/shim/src/led_driver") # Add source files -zephyr_library_sources("${CMAKE_CURRENT_SOURCE_DIR}/src/led.c") - -# Link in the library -zephyr_library_link_libraries(${lib_name}) +target_sources(app PRIVATE src/led.c) diff --git a/zephyr/test/drivers/usb_malfunction_sink/CMakeLists.txt b/zephyr/test/drivers/usb_malfunction_sink/CMakeLists.txt index 770f01b6d9..719366cb86 100644 --- a/zephyr/test/drivers/usb_malfunction_sink/CMakeLists.txt +++ b/zephyr/test/drivers/usb_malfunction_sink/CMakeLists.txt @@ -2,18 +2,5 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -# Create library name based on current directory -zephyr_library_get_current_dir_lib_name(${ZEPHYR_BASE} lib_name) - -# Create interface library -zephyr_interface_library_named(${lib_name}) - -# Add include paths -zephyr_include_directories("${CMAKE_CURRENT_SOURCE_DIR}") -zephyr_include_directories("${CMAKE_CURRENT_SOURCE_DIR}/include") - # Add source files -zephyr_library_sources("${CMAKE_CURRENT_SOURCE_DIR}/src/usb_malfunction_sink.c") - -# Link in the library -zephyr_library_link_libraries(${lib_name}) +target_sources(app PRIVATE src/usb_malfunction_sink.c) diff --git a/zephyr/test/drivers/usbc_alt_mode/CMakeLists.txt b/zephyr/test/drivers/usbc_alt_mode/CMakeLists.txt index f8f265c021..1093c92968 100644 --- a/zephyr/test/drivers/usbc_alt_mode/CMakeLists.txt +++ b/zephyr/test/drivers/usbc_alt_mode/CMakeLists.txt @@ -2,11 +2,4 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -zephyr_library_get_current_dir_lib_name(${ZEPHYR_BASE} lib_name) -zephyr_interface_library_named(${lib_name}) - -zephyr_include_directories("${CMAKE_CURRENT_SOURCE_DIR}") -zephyr_include_directories("${CMAKE_CURRENT_SOURCE_DIR}/include") -zephyr_library_sources("${CMAKE_CURRENT_SOURCE_DIR}/src/usbc_alt_mode.c") - -zephyr_library_link_libraries(${lib_name}) +target_sources(app PRIVATE src/usbc_alt_mode.c) |