From dda70fce366272b3bf1f57763cdbb7a17607b801 Mon Sep 17 00:00:00 2001 From: Ed_ Date: Tue, 4 Feb 2025 21:23:51 -0500 Subject: [PATCH] can't use static globals on static libs --- base/dependencies/macros.hpp | 2 +- scripts/build.ci.ps1 | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/base/dependencies/macros.hpp b/base/dependencies/macros.hpp index 82235d8..c8ad2d7 100644 --- a/base/dependencies/macros.hpp +++ b/base/dependencies/macros.hpp @@ -26,7 +26,7 @@ #endif // GEN_API #ifndef global // Global variables -# ifdef GEN_DYN_EXPORT +# if defined(GEN_STATIC_LINK) || defined(GEN_DYN_LINK) # define global # else # define global static diff --git a/scripts/build.ci.ps1 b/scripts/build.ci.ps1 index 1ae81b9..3809bf3 100644 --- a/scripts/build.ci.ps1 +++ b/scripts/build.ci.ps1 @@ -263,6 +263,7 @@ if ( $c_lib_static ) $compiler_args += $flag_all_c $compiler_args += $flag_updated_cpp_macro $compiler_args += $flag_c11 + $compiler_args += ($flag_define + 'GEN_STATIC_LINK') $linker_args = @() $result = build-simple $path_build $includes $compiler_args $linker_args $unit $path_lib