|
@@ -250,16 +250,12 @@ option(ENABLE_AMALGAMATION "Concatenate the library to a single file open62541.h
|
|
|
add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/open62541.h
|
|
|
PRE_BUILD
|
|
|
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/tools/amalgamate.py ${GIT_COMMIT_ID} ${CMAKE_CURRENT_BINARY_DIR}/open62541.h ${exported_headers}
|
|
|
-
|
|
|
-
|
|
|
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/tools/amalgamate.py ${exported_headers} ${internal_headers})
|
|
|
|
|
|
add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/open62541.c
|
|
|
PRE_BUILD
|
|
|
-
|
|
|
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/tools/amalgamate.py ${GIT_COMMIT_ID} ${CMAKE_CURRENT_BINARY_DIR}/open62541.c
|
|
|
${internal_headers} ${PROJECT_SOURCE_DIR}/src/server/ua_nodestore_hash.inc ${lib_sources}
|
|
|
-
|
|
|
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/tools/amalgamate.py ${internal_headers} ${PROJECT_SOURCE_DIR}/src/server/ua_nodestore_hash.inc ${lib_sources})
|
|
|
|
|
|
if(ENABLE_AMALGAMATION)
|
|
@@ -275,13 +271,19 @@ else()
|
|
|
include_directories(${PROJECT_BINARY_DIR}/src_generated)
|
|
|
endif()
|
|
|
target_compile_definitions(open62541-object PRIVATE -DUA_DYNAMIC_LINKING)
|
|
|
+
|
|
|
add_library(open62541 SHARED $<TARGET_OBJECTS:open62541-object>)
|
|
|
+add_library(open62541-static STATIC $<TARGET_OBJECTS:open62541-object>)
|
|
|
target_compile_definitions(open62541 PRIVATE -DUA_DYNAMIC_LINKING)
|
|
|
+target_compile_definitions(open62541-static PRIVATE -DUA_DYNAMIC_LINKING)
|
|
|
if(WIN32)
|
|
|
- target_link_libraries(open62541 ws2_32) #since networklayer_tcp is linked into the amalgate
|
|
|
+ # since networklayer_tcp is linked into the amalgate
|
|
|
+ target_link_libraries(open62541 ws2_32)
|
|
|
+ target_link_libraries(open62541-static ws2_32)
|
|
|
endif()
|
|
|
if(ENABLE_MULTITHREADING)
|
|
|
target_link_libraries(open62541 urcu-cds urcu urcu-common pthread)
|
|
|
+ target_link_libraries(open62541-static urcu-cds urcu urcu-common pthread)
|
|
|
endif()
|
|
|
|
|
|
# build language bindings for the library
|