Skip to content

Commit

Permalink
Fix example build (intel#114)
Browse files Browse the repository at this point in the history
  • Loading branch information
joserochh authored Jun 21, 2022
1 parent 4830694 commit 034c1b9
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions example/vcpkg/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,16 @@ project(hexl_example LANGUAGES C CXX)
cmake_minimum_required(VERSION 3.13)
set(CMAKE_CXX_STANDARD 11)

# Setting Release as default mode. Otherwise vcpkg uses debug mode by default.
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Build type" FORCE)
endif()

# This flag is needed to build HEXL on Debug mode
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
set(CMAKE_CXX_FLAGS "-fsanitize=address")
endif()

# Example using vcpkg
find_package(HEXL CONFIG REQUIRED)
add_executable(example ../example.cpp)
Expand Down

0 comments on commit 034c1b9

Please sign in to comment.