git repos / oastat

commit 5b5a422f

sago007 · 2019-03-23 11:58
5b5a422f7ff9fc762e94ca5bd4ef124675c13007 patch · browse files
parent 3700a795b563bbac87611ac4e2407ef5208d0050

Use a common lib to prevent compiling everything twice

Changed files

M CMakeLists.txt before
diff --git a/CMakeLists.txt b/CMakeLists.txt index 2de5ab4..7780163 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt
@@ -6,10 +6,12 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -std=c++11 -DUSECPPDB=1")
file(GLOB SOURCES "src/*/*.cpp")
-add_executable(oastat src/oastat.cpp ${SOURCES})
-TARGET_LINK_LIBRARIES( oastat ${Boost_LIBRARIES} )
+add_library(oastatlib ${SOURCES})
+
+add_executable(oastat src/oastat.cpp)
+TARGET_LINK_LIBRARIES( oastat oastatlib ${Boost_LIBRARIES} )
target_link_libraries( oastat cppdb gcrypt gpg-error)
-add_executable(oastat_delete_games src/oastat_delete_games.cpp ${SOURCES})
-TARGET_LINK_LIBRARIES( oastat_delete_games ${Boost_LIBRARIES} )
+add_executable(oastat_delete_games src/oastat_delete_games.cpp)
+TARGET_LINK_LIBRARIES( oastat_delete_games oastatlib ${Boost_LIBRARIES} )
target_link_libraries( oastat_delete_games cppdb gcrypt gpg-error)
\ No newline at end of file