mirror of
https://github.com/jhasse/poly2tri.git
synced 2024-11-05 13:59:53 +01:00
Set the API export symbols based on CMake BUILD_SHARED_LIBS
By default poly2tri is built as a static library.
This commit is contained in:
parent
7f5846b72d
commit
49a12eb378
@ -11,6 +11,13 @@ file(GLOB HEADERS poly2tri/*.h poly2tri/common/*.h poly2tri/sweep/*.h)
|
||||
add_library(poly2tri ${SOURCES} ${HEADERS})
|
||||
target_include_directories(poly2tri INTERFACE ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
||||
get_target_property(poly2tri_target_type poly2tri TYPE)
|
||||
if(poly2tri_target_type STREQUAL SHARED_LIBRARY)
|
||||
target_compile_definitions(poly2tri PRIVATE P2T_SHARED_EXPORTS)
|
||||
else()
|
||||
target_compile_definitions(poly2tri PUBLIC P2T_STATIC_EXPORTS)
|
||||
endif()
|
||||
|
||||
if(P2T_BUILD_TESTS)
|
||||
enable_testing()
|
||||
add_subdirectory(unittest)
|
||||
|
Loading…
Reference in New Issue
Block a user