Skip to content

Commit

Permalink
Using the system-wide boost instead of the one supplied by common (
Browse files Browse the repository at this point in the history
…satya-das#23).

Excluded `src/catch` from git (an old version is downloaded by the main CMakeLists.txt). Note that `Catch2 v3` is out, and we are going to have to refactor the codes and use the new release soon.
  • Loading branch information
salehjg committed Jun 26, 2023
1 parent ee0dc78 commit d3e4cee
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 11 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ y.output
parser.lex.cpp
parser.tab.*

src/catch

# Build results
cmake-build-*
.idea
Expand Down
19 changes: 10 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ project(cppparser)

enable_testing()

include("../common/cmake/conf.cmake")

set(CMAKE_CXX_STANDARD 17)

if(MSVC)
Expand All @@ -16,10 +14,14 @@ endif()
add_subdirectory(third_party/btyacc_tp)

add_definitions(-DBOOST_AUTO_LINK_NOMANGLE)
set(Boost_USE_STATIC_LIBS OFF)
set(Boost_USE_MULTITHREADED ON)
set(Boost_USE_STATIC_RUNTIME OFF)
find_package(Boost COMPONENTS filesystem program_options REQUIRED)

add_subdirectory(../common/third_party/boost_tp/cmake ${CMAKE_BINARY_DIR}/boost)

include_directories(../common/third_party)
if (NOT EXISTS "${CMAKE_SOURCE_DIR}/src/catch/catch.hpp")
file(DOWNLOAD "https://github.com/catchorg/Catch2/releases/download/v2.13.10/catch.hpp" "${CMAKE_SOURCE_DIR}/src/catch/catch.hpp")
endif()

#############################################
## CppParser
Expand Down Expand Up @@ -72,18 +74,17 @@ set(CPPPARSER_SOURCES
)

add_library(cppparser STATIC ${CPPPARSER_SOURCES})
add_dependencies(cppparser btyacc boost_filesystem boost_program_options)
add_dependencies(cppparser btyacc)
target_link_libraries(cppparser
PUBLIC
boost_filesystem
boost_program_options
${Boost_FILESYSTEM_LIBRARY}
${Boost_PROGRAM_OPTIONS_LIBRARY}
boost_system
)
target_include_directories(
cppparser
PUBLIC
pub
../common/third_party/boost_tp
PRIVATE
hack
)
Expand Down
3 changes: 3 additions & 0 deletions test/app/compare.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

#include <iostream>
#include <sstream>
#include<fstream>
#include<string>
#include<iterator>

#include <boost/filesystem.hpp>
#include <boost/program_options.hpp>
Expand Down
2 changes: 0 additions & 2 deletions third_party/btyacc_tp/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
include("../../../common/cmake/conf.cmake")

project(btyacc)

if(${CMAKE_CXX_COMPILER_ID} STREQUAL "MSVC")
Expand Down

0 comments on commit d3e4cee

Please sign in to comment.