From 8637612908d4d874ef52f057b8f1a539926b8fb3 Mon Sep 17 00:00:00 2001 From: Zbigniew Mandziejewicz Date: Tue, 2 Feb 2016 00:52:55 +0100 Subject: [PATCH] Add GLFW_DLL to target interface --- examples/CMakeLists.txt | 1 - src/CMakeLists.txt | 1 + tests/CMakeLists.txt | 1 - 3 files changed, 1 insertion(+), 2 deletions(-) diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 3b6e54ce..7b40ecb9 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -2,7 +2,6 @@ link_libraries(glfw) if (BUILD_SHARED_LIBS) - add_definitions(-DGLFW_DLL) link_libraries("${MATH_LIBRARY}") else() link_libraries(${glfw_LIBRARIES}) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 590a10f8..7c7dd973 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -99,6 +99,7 @@ if (BUILD_SHARED_LIBS) target_compile_options(glfw PRIVATE "-fvisibility=hidden") endif() + target_compile_definitions(glfw INTERFACE -DGLFW_DLL) target_link_libraries(glfw ${glfw_LIBRARIES}) endif() diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index af211600..f1bce371 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -2,7 +2,6 @@ link_libraries(glfw) if (BUILD_SHARED_LIBS) - add_definitions(-DGLFW_DLL) link_libraries("${MATH_LIBRARY}") else() link_libraries(${glfw_LIBRARIES})