diff --git a/CMakeLists.txt b/CMakeLists.txt index b635b4c..66ad2dc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -212,7 +212,10 @@ find_package(Threads) if(NOT CMAKE_SYSTEM_NAME STREQUAL "WASI") list(APPEND qjs_libs ${CMAKE_THREAD_LIBS_INIT}) endif() -if(NOT MSVC) + +# try to find libm +find_library(M_LIBRARIES m) +if(M_LIBRARIES OR CMAKE_C_COMPILER_ID STREQUAL "TinyCC") list(APPEND qjs_libs m) endif()