Skip to content

Commit

Permalink
Linking stdmaths with Clang
Browse files Browse the repository at this point in the history
  • Loading branch information
hjabird committed Sep 9, 2019
1 parent 08e57b5 commit 6d537f9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ find_package(bsv CONFIG REQUIRED)
target_link_libraries(cvortex PUBLIC bsv)
target_include_directories(cvortex PUBLIC bsv)

if (${CMAKE_C_COMPILER_ID} STREQUAL "GNU")
link_libraries(cvortex m) # Maths std library.
if (${CMAKE_C_COMPILER_ID} STREQUAL "GNU" OR ${CMAKE_C_COMPILER_ID} STREQUAL "Clang")
target_link_libraries(cvortex PUBLIC m) # Maths std library.
endif()

set_property(TARGET cvortex PROPERTY FOLDER "libraries")
Expand Down
11 changes: 3 additions & 8 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,19 +1,14 @@
cmake_minimum_required(VERSION 3.1)

link_libraries(cvortex)
link_libraries(bsv)
if (${CMAKE_C_COMPILER_ID} STREQUAL "GNU")
link_libraries(m) # Maths std library.
endif()

# Find all of our tests sources
file (GLOB TESTCVTX_SOURCE "*.[ch]")
source_group("cvtx_test_source" FILES ${TESTCVTX_SOURCE})
add_executable(all_tests ${TESTCVTX_SOURCE})

target_link_libraries(all_tests PUBLIC cvortex)
target_link_libraries(all_tests PUBLIC bsv)

# And add the main as an executable ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
enable_testing()
add_executable(all_tests ${TESTCVTX_SOURCE})
target_compile_definitions(all_tests PRIVATE _CRT_SECURE_NO_WARNINGS)


0 comments on commit 6d537f9

Please sign in to comment.