Browse Source

Compile with clang...

Former-commit-id: 7c977788d6318f1a7d81690923b7ae8f1538bfb8
Alec Jacobson (jalec 11 years ago
parent
commit
a31a81248d
2 changed files with 11 additions and 7 deletions
  1. 10 6
      examples/quicklook-mesh/Makefile
  2. 1 1
      examples/quicklook-mesh/src/render_to_buffer.cpp

+ 10 - 6
examples/quicklook-mesh/Makefile

@@ -2,8 +2,10 @@
 
 # Seems that we unfortunately must use llvm or else we get issues trying to
 # include the Foundation headers
-CXX=llvm-g++
-C=llvm-gcc
+#CXX=llvm-g++
+#C=llvm-gcc
+CXX=clang
+C=clang
 
 EIGEN=/opt/local/include/eigen3/
 EIGEN3_INC=-I$(EIGEN) -I$(EIGEN)/unsupported
@@ -35,6 +37,8 @@ install:
 #CFLAGS += -Wall -g -O0
 # openmp is unfortunately not supported by llvm
 CFLAGS += -O3 -Wall -DNDEBUG -Winvalid-pch -m64 -msse4.2
+CXXFLAGS += -stdlib=libc++ -std=c++11
+OBJCFLAGS += -O3 -Wall -DNDEBUG -Winvalid-pch -m64 -msse4.2
 
 CPP_FILES=$(wildcard src/*.cpp)
 C_FILES=$(wildcard src/*.c)
@@ -44,7 +48,7 @@ OBJ_FILES=$(addprefix obj/,$(notdir $(CPP_FILES:.cpp=.o))) \
   $(addprefix obj/,$(notdir $(C_FILES:.c=.o)))
 
 LIB+=$(LIBIGL_LIB) $(GLU_LIB) $(MESA_LIB) $(OBJC_LIB) -framework Foundation \
-  -framework AppKit -framework QuickLook
+  -framework AppKit -framework QuickLook -lc++
 INC+=$(EIGEN3_INC) $(LIBIGL_INC) $(GLU_INC) $(MESA_INC)
 
 .PHONY:
@@ -64,16 +68,16 @@ Mesh.qlgenerator/Contents/Resources/:
 	mkdir -p $@
 
 Mesh.qlgenerator/Contents/MacOS/Mesh: $(OBJ_FILES)
-	${CXX} $(CFLAGS) -bundle -o $@ $(OBJ_FILES) $(LIB)
+	${CXX} $(CFLAGS) $(CXXFLAGS) -bundle -o $@ $(OBJ_FILES) $(LIB)
 
 obj:
 	mkdir -p obj
 
 obj/%.o: src/%.cpp src/%.h
-	${CXX} $(CFLAGS) -o $@ -c $< $(INC) 
+	${CXX} $(CFLAGS) $(CXXFLAGS) -o $@ -c $< $(INC) 
 
 obj/%.o: src/%.m
-	${CXX} $(CFLAGS) -o $@ -c $< $(INC)
+	${CXX} $(OBJCFLAGS) -o $@ -c $< $(INC)
 
 obj/%.o: src/%.c
 	${C} $(CFLAGS) -o $@ -c $< $(INC)

+ 1 - 1
examples/quicklook-mesh/src/render_to_buffer.cpp

@@ -21,7 +21,7 @@ extern "C" {
 #include <igl/barycenter.h>
 #include <igl/doublearea.h>
 #include <igl/EPS.h>
-#include <igl/camera.h>
+#include <igl/Camera.h>
 #include <igl/canonical_quaternions.h>
 #include <igl/quat_to_mat.h>