From 2ef1a000384664290c5c35ab586659ff12cf034d Mon Sep 17 00:00:00 2001 From: Alexander Klingenbeck Date: Wed, 2 Aug 2023 20:23:35 +0200 Subject: [PATCH] Remove static flag on platforms other than windows --- CMakeLists.txt | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0edb910..23ee8cd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,12 @@ cmake_minimum_required(VERSION 3.1) set(CMAKE_OSX_ARCHITECTURES "arm64;x86_64" CACHE STRING "" FORCE) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static") -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -static") + +# Workaround for windows to prevent static linking of pthread +IF (WIN32) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -static") +ENDIF() + project(rayjs) message("=== Configure raylib ===")