-
Notifications
You must be signed in to change notification settings - Fork 0
/
PlatformFlags.cmake
27 lines (22 loc) · 1002 Bytes
/
PlatformFlags.cmake
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
cmake_minimum_required(VERSION 3.4)
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
function(find_platform_dynamic_linker_with_platform PLATFORM)
message(STATUS "Find dynamic linker for ${PLATFORM}:")
if(${PLATFORM} STREQUAL "Windows")
add_library(platform_dynamic_linker INTERFACE)
elseif(${PLATFORM} STREQUAL "Darwin")
add_library(platform_dynamic_linker INTERFACE)
target_link_libraries(platform_dynamic_linker INTERFACE ${CMAKE_DL_LIBS})
elseif(${PLATFORM} STREQUAL "Linux")
add_library(platform_dynamic_linker INTERFACE)
target_link_libraries(platform_dynamic_linker INTERFACE ${CMAKE_DL_LIBS})
endif()
if(TARGET platform_dynamic_linker)
message(STATUS "Found dynamic linker for ${PLATFORM}.")
else ()
message(STATUS "Could NOT find dynamic linker for ${PLATFORM}.")
endif()
endfunction()
function(find_platform_dynamic_linker)
find_platform_dynamic_linker_with_platform(${CMAKE_SYSTEM_NAME})
endfunction()