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})