Skip to content

Commit

Permalink
move headers into include/mapbox folder - closes #99
Browse files Browse the repository at this point in the history
  • Loading branch information
Dane Springmeyer committed May 7, 2016
1 parent 35ca16c commit f00b24b
Show file tree
Hide file tree
Showing 26 changed files with 41 additions and 40 deletions.
20 changes: 11 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ ifeq (sizes,$(firstword $(MAKECMDGOALS)))
.PHONY: $(RUN_ARGS)
endif

ALL_HEADERS = $(shell find include/mapbox/ '(' -name '*.hpp' ')')

all: out/bench-variant out/unique_ptr_test out/unique_ptr_test out/recursive_wrapper_test out/binary_visitor_test

./deps/gyp:
Expand All @@ -36,23 +38,23 @@ gyp: ./deps/gyp
make V=1 -C ./out tests
./out/Release/tests

out/bench-variant-debug: Makefile test/bench_variant.cpp variant.hpp recursive_wrapper.hpp
out/bench-variant-debug: Makefile test/bench_variant.cpp
mkdir -p ./out
$(CXX) -o out/bench-variant-debug test/bench_variant.cpp -I./ -pthreads $(DEBUG_FLAGS) $(COMMON_FLAGS) $(CXXFLAGS) $(LDFLAGS) $(BOOST_LIBS)

out/bench-variant: Makefile test/bench_variant.cpp variant.hpp recursive_wrapper.hpp
out/bench-variant: Makefile test/bench_variant.cpp
mkdir -p ./out
$(CXX) -o out/bench-variant test/bench_variant.cpp -I./ $(RELEASE_FLAGS) $(COMMON_FLAGS) $(CXXFLAGS) $(LDFLAGS) $(BOOST_LIBS)

out/unique_ptr_test: Makefile test/unique_ptr_test.cpp variant.hpp recursive_wrapper.hpp
out/unique_ptr_test: Makefile test/unique_ptr_test.cpp
mkdir -p ./out
$(CXX) -o out/unique_ptr_test test/unique_ptr_test.cpp -I./ $(RELEASE_FLAGS) $(COMMON_FLAGS) $(CXXFLAGS) $(LDFLAGS) $(BOOST_LIBS)

out/recursive_wrapper_test: Makefile test/recursive_wrapper_test.cpp variant.hpp recursive_wrapper.hpp
out/recursive_wrapper_test: Makefile test/recursive_wrapper_test.cpp
mkdir -p ./out
$(CXX) -o out/recursive_wrapper_test test/recursive_wrapper_test.cpp -I./ $(RELEASE_FLAGS) $(COMMON_FLAGS) $(CXXFLAGS) $(LDFLAGS) $(BOOST_LIBS)

out/binary_visitor_test: Makefile test/binary_visitor_test.cpp variant.hpp variant_io.hpp recursive_wrapper.hpp
out/binary_visitor_test: Makefile test/binary_visitor_test.cpp
mkdir -p ./out
$(CXX) -o out/binary_visitor_test test/binary_visitor_test.cpp -I./ $(RELEASE_FLAGS) $(COMMON_FLAGS) $(CXXFLAGS) $(LDFLAGS) $(BOOST_LIBS)

Expand All @@ -66,7 +68,7 @@ out/unit.o: Makefile test/unit.cpp
mkdir -p ./out
$(CXX) -c -o $@ test/unit.cpp -Itest/include $(DEBUG_FLAGS) $(COMMON_FLAGS) $(CXXFLAGS)

out/%.o: test/t/%.cpp Makefile optional.hpp recursive_wrapper.hpp variant.hpp variant_io.hpp
out/%.o: test/t/%.cpp Makefile $(ALL_HEADERS)
mkdir -p ./out
$(CXX) -c -o $@ $< -I. -Itest/include $(DEBUG_FLAGS) $(COMMON_FLAGS) $(CXXFLAGS)

Expand All @@ -81,9 +83,9 @@ coverage:
mkdir -p ./out
$(CXX) -o out/cov-test --coverage test/unit.cpp test/t/*.cpp -I./ -Itest/include $(DEBUG_FLAGS) $(COMMON_FLAGS) $(CXXFLAGS) $(LDFLAGS)

sizes: Makefile variant.hpp recursive_wrapper.hpp
sizes: Makefile
mkdir -p ./out
@$(CXX) -o ./out/our_variant_hello_world.out variant.hpp $(RELEASE_FLAGS) $(COMMON_FLAGS) $(CXXFLAGS) && du -h ./out/our_variant_hello_world.out
@$(CXX) -o ./out/our_variant_hello_world.out include/mapbox/variant.hpp $(RELEASE_FLAGS) $(COMMON_FLAGS) $(CXXFLAGS) && du -h ./out/our_variant_hello_world.out
@$(CXX) -o ./out/boost_variant_hello_world.out $(RUN_ARGS) $(RELEASE_FLAGS) $(COMMON_FLAGS) $(CXXFLAGS) && du -h ./out/boost_variant_hello_world.out
@$(CXX) -o ./out/our_variant_hello_world ./test/our_variant_hello_world.cpp -I./ $(RELEASE_FLAGS) $(COMMON_FLAGS) $(CXXFLAGS) && du -h ./out/our_variant_hello_world
@$(CXX) -o ./out/boost_variant_hello_world ./test/boost_variant_hello_world.cpp -I./ $(RELEASE_FLAGS) $(COMMON_FLAGS) $(CXXFLAGS) && du -h ./out/boost_variant_hello_world
Expand All @@ -102,7 +104,7 @@ clean:
rm -f test/*gcov
rm -f *.gcda *.gcno

pgo: out Makefile variant.hpp recursive_wrapper.hpp
pgo: out Makefile
$(CXX) -o out/bench-variant test/bench_variant.cpp -I./ $(RELEASE_FLAGS) $(COMMON_FLAGS) $(CXXFLAGS) $(LDFLAGS) $(BOOST_LIBS) -pg -fprofile-generate
./test-variant 500000 >/dev/null 2>/dev/null
$(CXX) -o out/bench-variant test/bench_variant.cpp -I./ $(RELEASE_FLAGS) $(COMMON_FLAGS) $(CXXFLAGS) $(LDFLAGS) $(BOOST_LIBS) -fprofile-use
Expand Down
2 changes: 1 addition & 1 deletion optional.hpp → include/mapbox/optional.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include <type_traits>
#include <utility>

#include "variant.hpp"
#include <mapbox/variant.hpp>

namespace mapbox {
namespace util {
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion variant.hpp → include/mapbox/variant.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include <typeinfo>
#include <utility>

#include "recursive_wrapper.hpp"
#include <mapbox/recursive_wrapper.hpp>

// clang-format off
// [[deprecated]] is only available in C++14, use this for the time being
Expand Down
2 changes: 1 addition & 1 deletion variant_io.hpp → include/mapbox/variant_io.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#include <iosfwd>

#include "variant.hpp"
#include <mapbox/variant.hpp>

namespace mapbox {
namespace util {
Expand Down
3 changes: 1 addition & 2 deletions test/bench_variant.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

#include <algorithm>
#include <cstdlib>
#include <iostream>
Expand All @@ -11,7 +10,7 @@
#include <boost/timer/timer.hpp>
#include <boost/variant.hpp>

#include "variant.hpp"
#include <mapbox/variant.hpp>

#define TEXT_SHORT "Test"
#define TEXT_LONG "Testing various variant implementations with a longish string ........................................."
Expand Down
4 changes: 2 additions & 2 deletions test/binary_visitor_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
#include <utility>
#include <vector>

#include "variant.hpp"
#include "variant_io.hpp"
#include <mapbox/variant.hpp>
#include <mapbox/variant_io.hpp>

using namespace mapbox;

Expand Down
2 changes: 1 addition & 1 deletion test/our_variant_hello_world.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "variant.hpp"
#include <mapbox/variant.hpp>

#include <stdexcept>

Expand Down
2 changes: 1 addition & 1 deletion test/recursive_wrapper_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

#include <boost/timer/timer.hpp>

#include "variant.hpp"
#include <mapbox/variant.hpp>

using namespace mapbox;

Expand Down
2 changes: 1 addition & 1 deletion test/reference_wrapper_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include <utility>
#include <vector>

#include "variant.hpp"
#include <mapbox/variant.hpp>

using namespace mapbox;

Expand Down
2 changes: 1 addition & 1 deletion test/t/binary_visitor_1.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

#include "variant.hpp"
#include <mapbox/variant.hpp>

#define NAME_EXT " i-d"
using variant_type = mapbox::util::variant<int, double>;
Expand Down
2 changes: 1 addition & 1 deletion test/t/binary_visitor_2.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

#include "variant.hpp"
#include <mapbox/variant.hpp>

#define NAME_EXT " b-i-d"
using variant_type = mapbox::util::variant<bool, int, double>;
Expand Down
2 changes: 1 addition & 1 deletion test/t/binary_visitor_3.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

#include "variant.hpp"
#include <mapbox/variant.hpp>

#define NAME_EXT " i-d-b"
using variant_type = mapbox::util::variant<int, double, bool>;
Expand Down
2 changes: 1 addition & 1 deletion test/t/binary_visitor_4.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

#include "variant.hpp"
#include <mapbox/variant.hpp>

#define NAME_EXT " b-i-d-c"
using variant_type = mapbox::util::variant<bool, int, double, char>;
Expand Down
2 changes: 1 addition & 1 deletion test/t/binary_visitor_5.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

#include "variant.hpp"
#include <mapbox/variant.hpp>

#define NAME_EXT " b-i-c-d-i"
using variant_type = mapbox::util::variant<bool, int, char, double, int>;
Expand Down
2 changes: 1 addition & 1 deletion test/t/binary_visitor_6.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

#include "variant.hpp"
#include <mapbox/variant.hpp>

#define NAME_EXT " b-i-i-d-c-u"
using variant_type = mapbox::util::variant<bool, int, int, double, char, short int>;
Expand Down
2 changes: 1 addition & 1 deletion test/t/binary_visitor_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#include "catch.hpp"

#include "variant_io.hpp"
#include <mapbox/variant_io.hpp>

struct add_visitor
{
Expand Down
4 changes: 2 additions & 2 deletions test/t/issue21.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@

#include "catch.hpp"

#include "variant.hpp"
#include "variant_io.hpp"
#include <mapbox/variant.hpp>
#include <mapbox/variant_io.hpp>

// https://github.com/mapbox/variant/issues/21

Expand Down
4 changes: 2 additions & 2 deletions test/t/mutating_visitor.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@

#include "catch.hpp"

#include "variant.hpp"
#include "variant_io.hpp"
#include <mapbox/variant.hpp>
#include <mapbox/variant_io.hpp>

#include <string>

Expand Down
2 changes: 1 addition & 1 deletion test/t/optional.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

#include "catch.hpp"

#include "optional.hpp"
#include <mapbox/optional.hpp>

struct dummy
{
Expand Down
2 changes: 1 addition & 1 deletion test/t/recursive_wrapper.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

#include "catch.hpp"

#include "recursive_wrapper.hpp"
#include <mapbox/recursive_wrapper.hpp>

#include <type_traits>
#include <utility>
Expand Down
4 changes: 2 additions & 2 deletions test/t/sizeof.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

#include "catch.hpp"

#include "variant.hpp"
#include "variant_io.hpp"
#include <mapbox/variant.hpp>
#include <mapbox/variant_io.hpp>

struct some_struct
{
Expand Down
4 changes: 2 additions & 2 deletions test/t/unary_visitor.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@

#include "catch.hpp"

#include "variant.hpp"
#include "variant_io.hpp"
#include <mapbox/variant.hpp>
#include <mapbox/variant_io.hpp>

#include <string>

Expand Down
4 changes: 2 additions & 2 deletions test/t/variant.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "catch.hpp"

#include "variant.hpp"
#include "variant_io.hpp"
#include <mapbox/variant.hpp>
#include <mapbox/variant_io.hpp>

#include <algorithm>
#include <cstdint>
Expand Down
2 changes: 1 addition & 1 deletion test/unique_ptr_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

#include <boost/timer/timer.hpp>

#include "variant.hpp"
#include <mapbox/variant.hpp>

using namespace mapbox;

Expand Down
2 changes: 1 addition & 1 deletion variant.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"SUPPORTED_PLATFORMS":["macosx"]
},
"include_dirs": [
"./",
"./include",
"test/include"
]
}
Expand Down

0 comments on commit f00b24b

Please sign in to comment.