Skip to content

Commit

Permalink
Updated cmakelists
Browse files Browse the repository at this point in the history
  • Loading branch information
eg0000r-pub committed Jan 27, 2024
1 parent 68131d5 commit cca2b39
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,22 @@ endif ()
if (${APPLE})
set(CMAKE_CXX_FLAGS "-Wall -Wextra -O3")
add_compile_definitions(_LIBCPP_HAS_PARALLEL_ALGORITHMS)
find_package(oneDPL REQUIRED)
endif ()

if (${CMAKE_COMPILER_IS_GNUCXX})
set(CMAKE_CXX_FLAGS "-Wall -Wextra -O3 -march=native -flto=auto")
if (${ERROR_ON_WARN})
set(CMAKE_CXX_FLAGS "-Werror ${CMAKE_CXX_FLAGS}")
endif ()
find_package(TBB REQUIRED)
endif ()

# SYSTEM keyword suppressed warnings from included headers
include_directories(SYSTEM deps/libtimestep/include)
include_directories(SYSTEM deps/eigen)
include_directories(include)

if ((${CMAKE_COMPILER_IS_GNUCXX}) OR (${APPLE}))
find_package(TBB REQUIRED)
endif ()

#add_executable(libgran main.cpp writer.cpp)
# A particle and a lattice colliding
add_executable(contact_test test/contact.cpp test/compute_energy.cpp)
Expand All @@ -45,7 +43,7 @@ add_executable(hamaker_3_test test/hamaker_3.cpp writer.cpp)
# A sintered lattice undergoing rigid-body-motion
add_executable(sintered_test test/sintered.cpp test/mass_distribution.cpp)

if ((${CMAKE_COMPILER_IS_GNUCXX}) OR (${APPLE}))
if (${CMAKE_COMPILER_IS_GNUCXX})
# target_link_libraries(libgran PRIVATE TBB::tbb)
target_link_libraries(contact_test PRIVATE TBB::tbb)
target_link_libraries(hamaker_test PRIVATE TBB::tbb)
Expand All @@ -54,6 +52,15 @@ if ((${CMAKE_COMPILER_IS_GNUCXX}) OR (${APPLE}))
target_link_libraries(sintered_test PRIVATE TBB::tbb)
endif ()

if (${APPLE})
# target_link_libraries(libgran PRIVATE TBB::tbb)
target_link_libraries(contact_test oneDPL)
target_link_libraries(hamaker_test oneDPL)
target_link_libraries(hamaker_2_test oneDPL)
target_link_libraries(hamaker_3_test oneDPL)
target_link_libraries(sintered_test oneDPL)
endif ()

add_test(NAME contact_test COMMAND ${CMAKE_BINARY_DIR}/contact_test)
add_test(NAME hamaker_test COMMAND ${CMAKE_BINARY_DIR}/hamaker_test)
add_test(NAME sintered_test COMMAND ${CMAKE_BINARY_DIR}/sintered_test)

0 comments on commit cca2b39

Please sign in to comment.