From 6727cc2da407eaa8cdd66b9be5ba0a3bb969aea5 Mon Sep 17 00:00:00 2001 From: Rokas Kupstys Date: Tue, 5 May 2020 13:21:59 +0300 Subject: Add empty TRACY_API instead of using dllexport for static builds on windows. Using dllexport is not correct, because it marks APIs in static lib for export and these APIs would get exported from a DLL that links to tracy. Make API use TRACY_EXPORTS, and replace TRACYPROFILER_EXPORTS with TRACY_EXPORTS in vcxproj projects. Swap dllimport with dllexport. Reason for this is a common idiom in CMake: target_compile_definitions(tracy PUBLIC -DTRACY_IMPORTS PRIVATE -DTRACY_EXPORTS). This idiom adds both defines in tracy target, but targets that link to tracy only get TRACY_IMPORTS. Swapped statements ensure that tracy always dllexports it's api and consuming targets always dllimport it. --- library/win32/TracyProfiler.vcxproj | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'library') diff --git a/library/win32/TracyProfiler.vcxproj b/library/win32/TracyProfiler.vcxproj index b1e476c3..ef035e22 100644 --- a/library/win32/TracyProfiler.vcxproj +++ b/library/win32/TracyProfiler.vcxproj @@ -124,7 +124,7 @@ Use Level3 true - WIN32;_DEBUG;TRACYPROFILER_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + WIN32;_DEBUG;TRACY_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) true pch.h @@ -139,7 +139,7 @@ Use Level3 true - _DEBUG;TRACYPROFILER_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + _DEBUG;TRACY_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) true pch.h @@ -156,7 +156,7 @@ true true true - WIN32;NDEBUG;TRACYPROFILER_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + WIN32;NDEBUG;TRACY_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) true pch.h @@ -175,7 +175,7 @@ true true true - WIN32;NDEBUG;TRACYPROFILER_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + WIN32;NDEBUG;TRACY_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) true pch.h @@ -194,7 +194,7 @@ true true true - TRACY_ENABLE;NDEBUG;TRACYPROFILER_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + TRACY_ENABLE;NDEBUG;TRACY_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) true @@ -212,7 +212,7 @@ true true true - TRACY_ON_DEMAND;TRACY_ENABLE;NDEBUG;TRACYPROFILER_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + TRACY_ON_DEMAND;TRACY_ENABLE;NDEBUG;TRACY_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) true -- cgit v1.2.3