[F] Fixed building

This commit is contained in:
seleznevae 2018-03-09 15:21:18 +03:00
parent a7e49497e8
commit cea035285a
2 changed files with 5 additions and 4 deletions

View File

@ -35,6 +35,7 @@ script:
- cmake .. -DFORT_TEST_BUILD=ON -DFORT_GCC_BUILD=${GCC_BUILD} - cmake .. -DFORT_TEST_BUILD=ON -DFORT_GCC_BUILD=${GCC_BUILD}
- cmake --build . --target all - cmake --build . --target all
- ls - ls
- LSAN_OPTIONS=verbosity=1:log_threads=1 ./libfort_example
- LSAN_OPTIONS=verbosity=1:log_threads=1 ./libfort_test - LSAN_OPTIONS=verbosity=1:log_threads=1 ./libfort_test

View File

@ -30,7 +30,7 @@ set(FORT_SOURCES
src/fort_impl.c) src/fort_impl.c)
add_executable(${PROJECT_NAME} add_executable(${PROJECT_NAME}_example
example/main.c example/main.c
${FORT_SOURCES}) ${FORT_SOURCES})
@ -38,7 +38,7 @@ add_executable(${PROJECT_NAME}
include_directories(tests/cmocka-1.1.0/include) include_directories(tests/cmocka-1.1.0/include)
link_directories(${CMAKE_SOURCE_DIR}/tests/cmocka-1.1.0/build/src) link_directories(${CMAKE_SOURCE_DIR}/tests/cmocka-1.1.0/build/src)
add_executable(libfort_test add_executable(${PROJECT_NAME}_test
${FORT_SOURCES} ${FORT_SOURCES}
tests/test.c tests/test.c
tests/test_vector.c tests/test_vector.c
@ -55,8 +55,8 @@ target_link_libraries(libfort_test
if(FORT_TEST_BUILD) if(FORT_TEST_BUILD)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=address") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=address")
if(FORT_GCC_BUILD) if(FORT_GCC_BUILD)
target_link_libraries(${PROJECT_NAME} asan) target_link_libraries(${PROJECT_NAME}_example asan)
target_link_libraries(libfort_test asan) target_link_libraries(${PROJECT_NAME}_test asan)
endif(FORT_GCC_BUILD) endif(FORT_GCC_BUILD)
endif(FORT_TEST_BUILD) endif(FORT_TEST_BUILD)