Debug and release build types

This commit is contained in:
Ilia Udalov 2017-03-26 14:34:44 +03:00
parent f5cbd44c1d
commit f97e2d046e
2 changed files with 7 additions and 8 deletions

View File

@ -26,7 +26,7 @@ matrix:
- ulimit -c unlimited -S - ulimit -c unlimited -S
script: script:
- mkdir build_dir && cd build_dir - mkdir build_dir && cd build_dir
- cmake -DLUA_INCLUDE_DIR="/usr/include/lua5.2" -DLUA_LIBRARY="/usr/lib/x86_64-linux-gnu/liblua5.2.so" .. - cmake -DCMAKE_BUILD_TYPE=Debug -DLUA_INCLUDE_DIR="/usr/include/lua5.2" -DLUA_LIBRARY="/usr/lib/x86_64-linux-gnu/liblua5.2.so" ..
- make -j4 all && make install - make -j4 all && make install
- ./tests - ./tests
- ./run_tests.lua - ./run_tests.lua
@ -40,6 +40,6 @@ matrix:
- brew install lua - brew install lua
script: script:
- mkdir build_dir && cd build_dir - mkdir build_dir && cd build_dir
- cmake .. && make -j4 all && make install - cmake -DCMAKE_BUILD_TYPE=Debug .. && make -j4 all && make install
- ./tests - ./tests
- ./run_tests.lua - ./run_tests.lua

View File

@ -21,10 +21,11 @@ endif()
add_library(effil SHARED ${SOURCES}) add_library(effil SHARED ${SOURCES})
target_link_libraries(effil -lpthread ${LUA_LIBRARY}) target_link_libraries(effil -lpthread ${LUA_LIBRARY})
set(GENERAL "-std=c++14 -pthread") set(GENERAL "-std=c++14")
set(ENABLE_WARNINGS "-Wall -Wextra -pedantic -Werror") set(ENABLE_WARNINGS "-Wall -Wextra -pedantic")
set(BUILD_FLAVOR "-O3 -DNDEBUG") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GENERAL} ${ENABLE_WARNINGS}")
set_target_properties(effil PROPERTIES COMPILE_FLAGS "${ENABLE_WARNINGS} ${GENERAL} ${BUILD_FLAVOR}") set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Werror -O0 -g -UNDEBUG")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3 -g0 -DNDEBUG")
#---------- #----------
# TESTS --- # TESTS ---
@ -38,8 +39,6 @@ include_directories(${GTEST_DIR}/include ${GTEST_DIR})
add_executable(tests ${TEST_SOURCES} ${GTEST_DIR}/src/gtest-all.cc) add_executable(tests ${TEST_SOURCES} ${GTEST_DIR}/src/gtest-all.cc)
target_link_libraries(tests effil) target_link_libraries(tests effil)
set_target_properties(tests PROPERTIES COMPILE_FLAGS "${ENABLE_WARNINGS} ${GENERAL} ${BUILD_FLAVOR}")
#---------- #----------
# INSTALL - # INSTALL -
#---------- #----------