libplatforminfo: unify target implementations
Don't require a file for each subtarget, fall back to default.c.
This commit is contained in:
parent
036ad3e51e
commit
ee064ae430
|
@ -18,7 +18,6 @@ define Package/libplatforminfo
|
|||
SECTION:=libs
|
||||
CATEGORY:=Libraries
|
||||
TITLE:=Platform information library
|
||||
DEPENDS:=@(TARGET_ar71xx_generic||TARGET_ar71xx_mikrotik||TARGET_ar71xx_nand||TARGET_mpc85xx_generic||TARGET_x86_generic||TARGET_x86_geode||TARGET_x86_64||TARGET_ramips_mt7621||TARGET_ramips_mt7628||TARGET_ramips_rt305x||TARGET_brcm2708_bcm2708||TARGET_brcm2708_bcm2709||TARGET_sunxi||TARGET_mvebu)
|
||||
endef
|
||||
|
||||
CMAKE_OPTIONS += \
|
||||
|
|
|
@ -20,9 +20,18 @@ else(SUBTARGET)
|
|||
add_definitions(-DTARGET_${TARGET})
|
||||
endif(SUBTARGET)
|
||||
|
||||
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/targets/${FULL_TARGET}.c")
|
||||
set(TARGET_SOURCE "targets/${FULL_TARGET}.c")
|
||||
elseif(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/targets/${TARGET}.c")
|
||||
set(TARGET_SOURCE "targets/${TARGET}.c")
|
||||
else()
|
||||
set(TARGET_SOURCE "targets/default.c")
|
||||
endif()
|
||||
|
||||
|
||||
add_library(platforminfo SHARED
|
||||
common.c
|
||||
targets/${FULL_TARGET}.c
|
||||
${TARGET_SOURCE}
|
||||
)
|
||||
set_target_properties(platforminfo PROPERTIES
|
||||
COMPILE_FLAGS "-Wall -std=c99 -D_GNU_SOURCE"
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
template/default.c
|
|
@ -1 +0,0 @@
|
|||
template/default.c
|
|
@ -1 +0,0 @@
|
|||
template/default.c
|
|
@ -1 +0,0 @@
|
|||
template/default.c
|
|
@ -1 +0,0 @@
|
|||
template/default.c
|
|
@ -1 +0,0 @@
|
|||
template/default.c
|
|
@ -1 +0,0 @@
|
|||
template/default.c
|
|
@ -1 +0,0 @@
|
|||
template/default.c
|
|
@ -1 +0,0 @@
|
|||
template/default.c
|
|
@ -1 +0,0 @@
|
|||
template/default.c
|
|
@ -1 +0,0 @@
|
|||
template/x86.c
|
|
@ -1 +0,0 @@
|
|||
template/x86.c
|
|
@ -1 +0,0 @@
|
|||
template/x86.c
|
Loading…
Reference in New Issue