fix host build
[oweals/ucert.git] / CMakeLists.txt
index 5b6331280fa0080aa427b5d24cc1a85fab3e9612..a44ff234e08ea0564f6cfabe595ea009b4975fc3 100644 (file)
@@ -7,6 +7,17 @@ SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "")
 
 find_library(json NAMES json-c json)
 
 
 find_library(json NAMES json-c json)
 
-ADD_EXECUTABLE(ucert ucert.c)
+IF(UCERT_HOST_BUILD)
+ADD_DEFINITIONS(-DUCERT_HOST_BUILD)
+ENDIF()
+
+ADD_EXECUTABLE(ucert ucert.c usign-exec.c)
+IF(UCERT_FULL)
+ADD_DEFINITIONS(-DUCERT_FULL)
 TARGET_LINK_LIBRARIES(ucert ubox blobmsg_json ${json})
 TARGET_LINK_LIBRARIES(ucert ubox blobmsg_json ${json})
+ELSE()
+ADD_DEFINITIONS(-DUCERT_STRIP_MESSAGES)
+TARGET_LINK_LIBRARIES(ucert ubox)
+ENDIF()
+
 INSTALL(TARGETS ucert RUNTIME DESTINATION bin)
 INSTALL(TARGETS ucert RUNTIME DESTINATION bin)