IX own module
This commit is contained in:
@@ -0,0 +1,99 @@
|
||||
|
||||
file(GLOB ixwebsocket CONFIGURE_DEPENDS ${CMAKE_SOURCE_DIR}/ixwebsocket/*.cpp)
|
||||
|
||||
add_library(ixwebsocket SHARED
|
||||
${ixwebsocket}
|
||||
)
|
||||
|
||||
target_include_directories(ixwebsocket PRIVATE
|
||||
${CMAKE_SOURCE_DIR}/ixwebsocket/include
|
||||
)
|
||||
|
||||
set_target_properties(ixwebsocket PROPERTIES
|
||||
PUBLIC_HEADER ${CMAKE_SOURCE_DIR}/ixwebsocket/include
|
||||
)
|
||||
target_compile_options(ixwebsocket PRIVATE
|
||||
-Wall
|
||||
-Wextra
|
||||
-pedantic
|
||||
#-fvisibility=hidden
|
||||
)
|
||||
if(DEBUG)
|
||||
target_compile_options(ixwebsocket PRIVATE
|
||||
-g
|
||||
)
|
||||
target_link_options(ixwebsocket PRIVATE
|
||||
-g
|
||||
)
|
||||
else()
|
||||
target_compile_options(ixwebsocket PRIVATE
|
||||
-O2
|
||||
)
|
||||
endif()
|
||||
|
||||
if(APPLE)
|
||||
message("Building ixwebsocket for MacOSX Universal into ${PROJECT_BINARY_DIR}/${PLUGIN_NAME}/${BIT}")
|
||||
|
||||
set_target_properties(ixwebsocket PROPERTIES
|
||||
LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/Plugin/${PLUGIN_NAME}
|
||||
BUILD_WITH_INSTALL_NAME_DIR TRUE
|
||||
)
|
||||
|
||||
target_compile_options(ixwebsocket PRIVATE
|
||||
#"SHELL:-arch i386"
|
||||
"SHELL:-arch x86_64"
|
||||
)
|
||||
target_link_options(ixwebsocket PRIVATE
|
||||
#"SHELL:-arch i386"
|
||||
"SHELL:-arch x86_64"
|
||||
)
|
||||
target_link_libraries(ixwebsocket PRIVATE
|
||||
"-framework Security"
|
||||
)
|
||||
elseif(UNIX)
|
||||
message("Building ixwebsocket for Linux ${BIT} into ${PROJECT_BINARY_DIR}/Plugin/${PLUGIN_NAME}/${BIT}")
|
||||
|
||||
set_target_properties(ixwebsocket PROPERTIES
|
||||
LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/Plugin/${PLUGIN_NAME}/${BIT}
|
||||
)
|
||||
|
||||
target_compile_options(ixwebsocket PRIVATE
|
||||
-nodefaultlibs
|
||||
)
|
||||
if(BIT STREQUAL "32")
|
||||
target_compile_options(ixwebsocket PRIVATE
|
||||
-m32
|
||||
)
|
||||
target_link_options(ixwebsocket PRIVATE
|
||||
-m32
|
||||
)
|
||||
endif()
|
||||
target_link_libraries(ixwebsocket PRIVATE
|
||||
crypto
|
||||
pthread
|
||||
)
|
||||
elseif(WIN32)
|
||||
message("Building ixwebsocket for Windows ${BIT} into ${PROJECT_BINARY_DIR}/Plugin/${PLUGIN_NAME}/${BIT}")
|
||||
|
||||
set_target_properties(ixwebsocket PROPERTIES
|
||||
RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/Plugin/${PLUGIN_NAME}/${BIT}
|
||||
)
|
||||
|
||||
if(DEBUG)
|
||||
target_compile_options(ixwebsocket PRIVATE
|
||||
-gcodeview
|
||||
)
|
||||
target_link_options(ixwebsocket PRIVATE
|
||||
-Wl,-pdb=
|
||||
)
|
||||
endif()
|
||||
target_link_options(ixwebsocket PRIVATE
|
||||
-static-libgcc
|
||||
-static-libstdc++
|
||||
)
|
||||
target_link_libraries(ixwebsocket PRIVATE
|
||||
ws2_32.lib
|
||||
)
|
||||
endif()
|
||||
|
||||
add_library(ixwebsocket::ixwebsocket ALIAS ixwebsocket)
|
||||
Reference in New Issue
Block a user