From 61112a0f7b4ab4e5468598f01dfc399f474ceaa2 Mon Sep 17 00:00:00 2001 From: Pere Mato Date: Thu, 5 Mar 2015 22:47:17 +0100 Subject: [PATCH] Changes needed to make Xcode generation working --- Module.mk | 2 +- lib/Interpreter/CMakeLists.txt | 2 +- lib/Interpreter/Interpreter.cpp | 6 ++++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Module.mk b/Module.mk index 091df9ff..f70d2dfa 100644 --- a/Module.mk +++ b/Module.mk @@ -171,5 +171,5 @@ $(call stripsrc,$(MODDIR)/lib/Interpreter/CIFactory.o): $(CLINGCOMPDH) $(call stripsrc,$(MODDIR)/lib/Interpreter/CIFactory.o): CLINGCXXFLAGS += -I$(dir $(CLINGCOMPDH)) $(call stripsrc,$(MODDIR)/lib/Interpreter/Interpreter.o): $(CLINGCOMPDH) $(call stripsrc,$(MODDIR)/lib/Interpreter/Interpreter.o): CLINGCXXFLAGS += -I$(dir $(CLINGCOMPDH)) -$(call stripsrc,$(MODDIR)/lib/Interpreter/Interpreter.o): CLINGCXXFLAGS += -DCLING_VERSION='"$(CLING_VERSION)"' +$(call stripsrc,$(MODDIR)/lib/Interpreter/Interpreter.o): CLINGCXXFLAGS += -DCLING_VERSION=$(CLING_VERSION) diff --git a/lib/Interpreter/CMakeLists.txt b/lib/Interpreter/CMakeLists.txt index 4b3a48e6..ac82739e 100644 --- a/lib/Interpreter/CMakeLists.txt +++ b/lib/Interpreter/CMakeLists.txt @@ -58,7 +58,7 @@ if(NOT WIN32) set_source_files_properties(RuntimeException.cpp COMPILE_FLAGS -fexceptions) endif() -set_source_files_properties(Interpreter.cpp COMPILE_FLAGS -DCLING_VERSION=\\\"${CLING_VERSION}\\\") +set_source_files_properties(Interpreter.cpp COMPILE_FLAGS -DCLING_VERSION=${CLING_VERSION}) #set_source_files_properties(RuntimeException.cpp COMPILE_FLAGS " /EHsc ") # the line above doesn't work, and it gives the following warnings: diff --git a/lib/Interpreter/Interpreter.cpp b/lib/Interpreter/Interpreter.cpp index 7138ec2a..222c11c8 100644 --- a/lib/Interpreter/Interpreter.cpp +++ b/lib/Interpreter/Interpreter.cpp @@ -47,6 +47,8 @@ #include #include +#define stringify(s) #s + using namespace clang; namespace { @@ -219,7 +221,7 @@ namespace cling { I != E; ++I) m_IncrParser->commitTransaction(*I); // Disable suggestions for ROOT - bool showSuggestions = !llvm::StringRef(CLING_VERSION).startswith("ROOT"); + bool showSuggestions = !llvm::StringRef(stringify(CLING_VERSION)).startswith("ROOT"); std::unique_ptr AutoLoadCB(new AutoloadCallback(this, showSuggestions)); setCallbacks(std::move(AutoLoadCB)); @@ -239,7 +241,7 @@ namespace cling { } const char* Interpreter::getVersion() const { - return CLING_VERSION; + return stringify(CLING_VERSION); } void Interpreter::handleFrontendOptions() {