From 6aa24bb203c4b6787fc919b49604744c878be7e8 Mon Sep 17 00:00:00 2001 From: Alexandre Teoi Date: Sat, 22 Apr 2023 22:57:45 -0300 Subject: [PATCH] explicit link libm only on non-windows platforms --- CMakeLists.txt | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d156c34..52864a4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -94,17 +94,17 @@ set (LUAC ${LUA_SRC}/luac.c ) -include(CheckLibraryExists) -check_library_exists(m pow "" LIBEXISTS) -if(LIBEXISTS) - set(LIBM "m") -endif() - add_executable(lua ${LUA} ${LIB}) -target_link_libraries(lua PUBLIC ${LIBM}) - add_executable(luac ${LUAC} ${LIB}) -target_link_libraries(luac PUBLIC ${LIBM}) + +if(NOT WIN32) + include(CheckLibraryExists) + check_library_exists(m pow "" LIBEXISTS) + if(LIBEXISTS) + target_link_libraries(lua PUBLIC m) + target_link_libraries(luac PUBLIC m) + endif() +endif() add_library(lualib SHARED ${LIB}) target_sources(lualib