Skip to content

Commit

Permalink
Дорабатываем сборку под разные OS
Browse files Browse the repository at this point in the history
  • Loading branch information
anyks committed Dec 21, 2022
1 parent 960ae61 commit 5bb0b58
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
22 changes: 14 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
set(GLB_PARAMS "-Wno-cpp -Wno-deprecated")
elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
set(GLB_PARAMS "-lutil -Wno-cpp -Wno-deprecated ")
set(GLB_PARAMS "-Wno-cpp -Wno-deprecated")
else()
set(GLB_PARAMS "-Wno-unknown-attributes")
endif()
Expand Down Expand Up @@ -154,10 +154,15 @@ add_library(${ASC_LIB_NAME} STATIC ${SOURCE_FILES})
# Если установлен флаг ENABLE_CONSOLE_APP собираем консольное приложение
if (ENABLE_CONSOLE_APP)

if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
set(WINFLAGS -lws2_32 -lgdi32 -lcrypt32 -lIphlpapi)
else()
set(WINFLAGS "")
# Проставляем платформозависимые зависимости
if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
set(OS_FLAGS "-lutil -Xlinker -export-dynamic")
elseif(${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD")
set(OS_FLAGS "-lutil -Xlinker -export-dynamic")
elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
set(OS_FLAGS -lws2_32 -lgdi32 -lcrypt32 -lIphlpapi)
elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
set(OS_FLAGS "")
endif()

# Устанавливаем иконку для windows под MinGW.
Expand All @@ -176,19 +181,20 @@ if (ENABLE_CONSOLE_APP)
target_link_libraries(${ASC_APP_NAME}
${ASC_LIB_NAME}
${ALM_LIBRARY}
${ZLIB_LIBRARY}
${PYTHON_LIBRARY}
${OPENSSL_LIBRARIES}
${WINFLAGS}
${ZLIB_LIBRARY}
${OS_FLAGS}
)
# Для всех остальных операционных систем
else()
target_link_libraries(${ASC_APP_NAME}
${ASC_LIB_NAME}
${ALM_LIBRARY}
${ZLIB_LIBRARY}
${PYTHON_LIBRARY}
${OPENSSL_LIBRARIES}
${ZLIB_LIBRARY}
${OS_FLAGS}
)
endif()

Expand Down
2 changes: 1 addition & 1 deletion submodules/alm
Submodule alm updated 2 files
+14 −8 CMakeLists.txt
+0 −6 build_third_party.sh

0 comments on commit 5bb0b58

Please sign in to comment.