Skip to content

Commit 3331b0a

Browse files
committed
Add libm to link libraries
Signed-off-by: André B. M. Gomes <bmg.andre@gmail.com>
1 parent c209897 commit 3331b0a

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ include(${CMAKE_SOURCE_DIR}/scripts/cmake/hackerrank_challenge.cmake)
1717
compiler_check()
1818

1919
if (USE_CONAN_LIBS)
20-
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
21-
conan_custom_setup()
20+
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
21+
conan_custom_setup()
2222
else()
2323
find_package(PkgConfig REQUIRED)
2424
pkg_check_modules(JsonCpp REQUIRED jsoncpp>=1.9.4)

scripts/cmake/hackerrank_challenge.cmake

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ macro(hackerrank_setup_project)
1313
set_target_properties(${ProjectId} PROPERTIES FOLDER "${ProjectFolder}")
1414

1515
if (USE_CONAN_LIBS)
16-
target_link_libraries(${ProjectId} ${CONAN_LIBS})
16+
target_link_libraries(${ProjectId} ${CONAN_LIBS} m)
1717
else()
18-
include_directories(${Boost_INCLUDE_DIRS} ${JsonCpp_INCLUDE_DIRS})
19-
target_link_libraries(${ProjectId} ${Boost_LIBRARIES} ${JsonCpp_LIBRARIES})
20-
endif (USE_CONAN_LIBS)
18+
include_directories(${Boost_INCLUDE_DIRS} ${JsonCpp_INCLUDE_DIRS})
19+
target_link_libraries(${ProjectId} ${Boost_LIBRARIES} ${JsonCpp_LIBRARIES} m)
20+
endif (USE_CONAN_LIBS)
2121
endmacro()
2222

2323
macro(hackerrank_challenge_solution)
@@ -41,11 +41,11 @@ macro(hackerrank_challenge_test)
4141
target_link_libraries(${ProjectTest} ${ProjectId} ${TestBaseProject} ${CONAN_LIBS})
4242
else()
4343
# GTest
44-
find_package(GTest REQUIRED)
45-
include_directories(${GTEST_INCLUDE_DIRS})
44+
find_package(GTest REQUIRED)
45+
include_directories(${GTEST_INCLUDE_DIRS})
4646

47-
target_link_libraries(${ProjectTest} ${ProjectId} ${TestBaseProject} ${GTEST_LIBRARIES} ${GTEST_MAIN_LIBRARIES} pthread)
48-
endif (USE_CONAN_LIBS)
47+
target_link_libraries(${ProjectTest} ${ProjectId} ${TestBaseProject} ${GTEST_LIBRARIES} ${GTEST_MAIN_LIBRARIES} pthread)
48+
endif (USE_CONAN_LIBS)
4949

5050
set_property(TARGET ${ProjectTest} PROPERTY CXX_STANDARD 14)
5151
set_property(TARGET ${ProjectTest} PROPERTY CXX_STANDARD_REQUIRED ON)

scripts/setup-new-problem

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ function write_header_file {
6666
done
6767

6868
echo -ne "#ifndef ${problem_name^^}_H
69-
#define ${problem_name^^}_H
69+
#define ${problem_name^^}_H
7070
7171
namespace hackerrank {
7272
namespace bmgandre {${ns_begin}

0 commit comments

Comments
 (0)