From d25e19b7900077d25a04155d13ce439db641ee8d Mon Sep 17 00:00:00 2001 From: Ave Milia Date: Mon, 8 Jul 2019 14:54:08 +0200 Subject: [PATCH] CMake: remove -DGLFW_DLL on non-Windows targets When using GLFW with CMake and installed GLFW binaries, `-DGLFW_DLL` is passed on Linux, which should not happen. Closes #1530. (cherry picked from commit d7fb01750ece465cfaae0493dfe3003da1e5f500) --- src/CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 4ff82d7b..80ee9691 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -134,6 +134,8 @@ if (BUILD_SHARED_LIBS) # Add a suffix to the import library to avoid naming conflicts set_target_properties(glfw PROPERTIES IMPORT_SUFFIX "dll.lib") endif() + + target_compile_definitions(glfw INTERFACE GLFW_DLL) elseif (APPLE) # Add -fno-common to work around a bug in Apple's GCC target_compile_options(glfw PRIVATE "-fno-common") @@ -147,7 +149,6 @@ if (BUILD_SHARED_LIBS) target_compile_options(glfw PRIVATE "-fvisibility=hidden") endif() - target_compile_definitions(glfw INTERFACE GLFW_DLL) target_link_libraries(glfw PRIVATE ${glfw_LIBRARIES}) else() target_link_libraries(glfw INTERFACE ${glfw_LIBRARIES})