From 027b78357172275168882aea12dacb4f439e28e0 Mon Sep 17 00:00:00 2001 From: dongresource Date: Wed, 16 Sep 2020 23:13:06 +0200 Subject: [PATCH] Visual studio doesn't use -ldl. --- CMakeLists.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e3c9189..10b2713 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -41,8 +41,6 @@ configure_file(version.h.in ${CMAKE_SOURCE_DIR}/version.h @ONLY) add_executable(openfusion ${SOURCES}) -target_link_libraries(openfusion dl) - set_target_properties(openfusion PROPERTIES OUTPUT_NAME ${BIN_NAME}) # Use pthreads if not generating a VS solution or MinGW makefile (because MinGW will prefer Win32 threads) @@ -51,4 +49,5 @@ set_target_properties(openfusion PROPERTIES OUTPUT_NAME ${BIN_NAME}) if (NOT CMAKE_GENERATOR MATCHES "Visual Studio" AND NOT CMAKE_CXX_COMPILER_ID STREQUAL "MSVC" AND NOT CMAKE_GENERATOR MATCHES "MinGW Makefiles") find_package(Threads REQUIRED) target_link_libraries(openfusion pthread) + target_link_libraries(openfusion dl) endif()