fix: 优化了CMakeLists.txt文件的顺序,可读性更好
This commit is contained in:
@@ -45,7 +45,6 @@ target_link_directories(${CMAKE_PROJECT_NAME} PRIVATE
|
|||||||
# Add sources to executable
|
# Add sources to executable
|
||||||
target_sources(${CMAKE_PROJECT_NAME} PRIVATE
|
target_sources(${CMAKE_PROJECT_NAME} PRIVATE
|
||||||
# Add user sources here
|
# Add user sources here
|
||||||
|
|
||||||
)
|
)
|
||||||
|
|
||||||
# Add include paths
|
# Add include paths
|
||||||
|
|||||||
@@ -1,12 +1,13 @@
|
|||||||
add_subdirectory(led)
|
|
||||||
|
|
||||||
add_library(driver INTERFACE)
|
add_library(driver INTERFACE)
|
||||||
target_link_libraries(driver INTERFACE led_lib)
|
|
||||||
target_sources(driver INTERFACE ./base/interface.cpp)
|
|
||||||
target_include_directories(driver INTERFACE ./base)
|
|
||||||
|
|
||||||
|
add_subdirectory(led)
|
||||||
if (DRIVER_CPP)
|
if (DRIVER_CPP)
|
||||||
add_subdirectory(base/gpio)
|
add_subdirectory(base/gpio)
|
||||||
target_compile_definitions(driver INTERFACE DRIVER_CPP)
|
target_compile_definitions(driver INTERFACE DRIVER_CPP)
|
||||||
endif ()
|
endif ()
|
||||||
|
target_link_libraries(driver INTERFACE led_lib)
|
||||||
|
target_sources(driver INTERFACE ./base/interface.cpp)
|
||||||
|
target_include_directories(driver INTERFACE ./base)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -9,9 +9,6 @@
|
|||||||
#include "main.h"
|
#include "main.h"
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
typedef struct {
|
typedef struct {
|
||||||
GPIO_TypeDef *port;
|
GPIO_TypeDef *port;
|
||||||
|
|||||||
Reference in New Issue
Block a user