diff --git a/library/unix/Makefile b/library/unix/Makefile new file mode 100644 index 00000000..3b50301c --- /dev/null +++ b/library/unix/Makefile @@ -0,0 +1,12 @@ +all: debug + +debug: + @+make -f debug.mk all + +release: + @+make -f release.mk all + +clean: + @+make -f build.mk clean + +.PHONY: all clean debug release diff --git a/library/unix/build.mk b/library/unix/build.mk new file mode 100644 index 00000000..42bd6866 --- /dev/null +++ b/library/unix/build.mk @@ -0,0 +1,48 @@ +CFLAGS += +CXXFLAGS := $(CFLAGS) -std=gnu++17 -fpic +DEFINES += -DTRACY_ENABLE +INCLUDES := +LIBS := -lpthread -ldl +PROJECT := libtracy +IMAGE := $(PROJECT)-$(BUILD).so + +SRC := ../../TracyClient.cpp + +OBJDIRBASE := obj/$(BUILD) +OBJDIR := $(OBJDIRBASE)/o/o/o + +OBJ := $(addprefix $(OBJDIR)/,$(SRC:%.cpp=%.o)) + +all: $(IMAGE) + +$(OBJDIR)/%.o: %.cpp + $(CXX) -c $(INCLUDES) $(CXXFLAGS) $(DEFINES) $< -o $@ + +$(OBJDIR)/%.d : %.cpp + @echo Resolving dependencies of $< + @mkdir -p $(@D) + @$(CXX) -MM $(INCLUDES) $(CXXFLAGS) $(DEFINES) $< > $@.$$$$; \ + sed 's,.*\.o[ :]*,$(OBJDIR)/$(<:.cpp=.o) $@ : ,g' < $@.$$$$ > $@; \ + rm -f $@.$$$$ + +$(OBJDIR)/%.o: %.c + $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@ + +$(OBJDIR)/%.d : %.c + @echo Resolving dependencies of $< + @mkdir -p $(@D) + @$(CC) -MM $(INCLUDES) $(CFLAGS) $(DEFINES) $< > $@.$$$$; \ + sed 's,.*\.o[ :]*,$(OBJDIR)/$(<:.c=.o) $@ : ,g' < $@.$$$$ > $@; \ + rm -f $@.$$$$ + +$(IMAGE): $(OBJ) + $(CXX) $(CXXFLAGS) $(DEFINES) $(OBJ) $(LIBS) -shared -o $@ + +ifneq "$(MAKECMDGOALS)" "clean" +-include $(addprefix $(OBJDIR)/,$(SRC:.cpp=.d)) +endif + +clean: + rm -rf $(OBJDIRBASE) $(PROJECT)*.so + +.PHONY: clean all diff --git a/library/unix/debug.mk b/library/unix/debug.mk new file mode 100644 index 00000000..04d925a6 --- /dev/null +++ b/library/unix/debug.mk @@ -0,0 +1,11 @@ +ARCH := $(shell uname -m) + +CFLAGS := -g3 -Wall +DEFINES := -DDEBUG +BUILD := debug + +ifeq ($(ARCH),x86_64) +CFLAGS += -msse4.1 +endif + +include build.mk diff --git a/library/unix/release.mk b/library/unix/release.mk new file mode 100644 index 00000000..030063e3 --- /dev/null +++ b/library/unix/release.mk @@ -0,0 +1,11 @@ +ARCH := $(shell uname -m) + +CFLAGS := -O3 -s -fomit-frame-pointer +DEFINES := -DNDEBUG +BUILD := release + +ifeq ($(ARCH),x86_64) +CFLAGS += -msse4.1 +endif + +include build.mk diff --git a/library/win32/TracyProfiler.sln b/library/win32/TracyProfiler.sln new file mode 100644 index 00000000..0b1aaffe --- /dev/null +++ b/library/win32/TracyProfiler.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.29709.97 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TracyProfiler", "TracyProfiler.vcxproj", "{C5B825D3-F140-45AB-8A47-B740E56631FB}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Release|x64 = Release|x64 + ReleaseOnDemand|x64 = ReleaseOnDemand|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {C5B825D3-F140-45AB-8A47-B740E56631FB}.Release|x64.ActiveCfg = Release|x64 + {C5B825D3-F140-45AB-8A47-B740E56631FB}.Release|x64.Build.0 = Release|x64 + {C5B825D3-F140-45AB-8A47-B740E56631FB}.ReleaseOnDemand|x64.ActiveCfg = ReleaseOnDemand|x64 + {C5B825D3-F140-45AB-8A47-B740E56631FB}.ReleaseOnDemand|x64.Build.0 = ReleaseOnDemand|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {E739AC0A-0937-46D7-8807-1EE95CEB576D} + EndGlobalSection +EndGlobal diff --git a/library/win32/TracyProfiler.vcxproj b/library/win32/TracyProfiler.vcxproj new file mode 100644 index 00000000..b1e476c3 --- /dev/null +++ b/library/win32/TracyProfiler.vcxproj @@ -0,0 +1,229 @@ + + + + + Debug + Win32 + + + ReleaseOnDemand + Win32 + + + ReleaseOnDemand + x64 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + + + + 16.0 + {C5B825D3-F140-45AB-8A47-B740E56631FB} + Win32Proj + TracyProfiler + 10.0 + + + + DynamicLibrary + true + v142 + Unicode + + + DynamicLibrary + false + v142 + true + Unicode + + + DynamicLibrary + false + v142 + true + Unicode + + + DynamicLibrary + true + v142 + Unicode + + + DynamicLibrary + false + v142 + true + Unicode + + + DynamicLibrary + false + v142 + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + true + + + true + + + false + + + false + + + false + + + false + + + + Use + Level3 + true + WIN32;_DEBUG;TRACYPROFILER_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + true + pch.h + + + Windows + true + false + + + + + Use + Level3 + true + _DEBUG;TRACYPROFILER_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + true + pch.h + + + Windows + true + false + + + + + Use + Level3 + true + true + true + WIN32;NDEBUG;TRACYPROFILER_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + true + pch.h + + + Windows + true + true + true + false + + + + + Use + Level3 + true + true + true + WIN32;NDEBUG;TRACYPROFILER_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + true + pch.h + + + Windows + true + true + true + false + + + + + NotUsing + Level3 + true + true + true + TRACY_ENABLE;NDEBUG;TRACYPROFILER_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + true + + + Windows + true + true + true + false + + + + + NotUsing + Level3 + true + true + true + TRACY_ON_DEMAND;TRACY_ENABLE;NDEBUG;TRACYPROFILER_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + true + + + Windows + true + true + true + false + + + + + + \ No newline at end of file diff --git a/library/win32/TracyProfiler.vcxproj.filters b/library/win32/TracyProfiler.vcxproj.filters new file mode 100644 index 00000000..124f58f2 --- /dev/null +++ b/library/win32/TracyProfiler.vcxproj.filters @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file