diff options
-rw-r--r-- | CMakeLists.txt | 5 | ||||
-rw-r--r-- | Makefile | 9 | ||||
-rw-r--r-- | tests/allocator.cpp | 6 |
3 files changed, 12 insertions, 8 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 855045c..dbae2f1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -42,6 +42,11 @@ else() add_library(pugixml STATIC ${SOURCES}) endif() +# Export symbols for shared library builds +if(BUILD_SHARED_LIBS AND MSVC) + target_compile_definitions(pugixml PRIVATE "PUGIXML_API=__declspec(dllexport)") +endif() + # Enable C++11 long long for compilers that are capable of it if(NOT ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} STRLESS 3.1 AND ";${CMAKE_CXX_COMPILE_FEATURES};" MATCHES ";cxx_long_long_type;") target_compile_features(pugixml PUBLIC cxx_long_long_type) @@ -81,14 +81,9 @@ build/pugixml-%: .FORCE | $(RELEASE) $(EXECUTABLE): $(OBJECTS) $(CXX) $(OBJECTS) $(LDFLAGS) -o $@ -build/libFuzzer.o: - svn co http://llvm.org/svn/llvm-project/llvm/trunk/lib/Fuzzer build/Fuzzer - ls build/Fuzzer/*.cpp | xargs printf '#include "%s"\n' >build/libFuzzer.cpp - clang++ build/libFuzzer.cpp -c -g -O2 -fno-omit-frame-pointer -std=c++11 -I . -o build/libFuzzer.o - -$(BUILD)/fuzz_%: tests/fuzz_%.cpp src/pugixml.cpp build/libFuzzer.o +$(BUILD)/fuzz_%: tests/fuzz_%.cpp src/pugixml.cpp @mkdir -p $(BUILD) - clang++ $(CXXFLAGS) -fsanitize=address -fsanitize-coverage=trace-pc-guard $^ -o $@ + $(CXX) $(CXXFLAGS) -fsanitize=address,fuzzer $^ -o $@ $(BUILD)/%.o: % @mkdir -p $(dir $@) diff --git a/tests/allocator.cpp b/tests/allocator.cpp index c3ade48..588e456 100644 --- a/tests/allocator.cpp +++ b/tests/allocator.cpp @@ -8,7 +8,11 @@ #if defined(__has_feature) # define ADDRESS_SANITIZER __has_feature(address_sanitizer) #else -# define ADDRESS_SANITIZER defined(__SANITIZE_ADDRESS__) +# if defined(__SANITIZE_ADDRESS__) +# define ADDRESS_SANITIZER 1 +# else +# define ADDRESS_SANITIZER 0 +# endif #endif // Low-level allocation functions |