Skip to content

Commit

Permalink
fixing openssl linking on osx
Browse files Browse the repository at this point in the history
  • Loading branch information
Ata Kuyumcu committed Sep 24, 2019
1 parent 279fed2 commit a15701a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ addons:
- gcc@7
- curl-openssl

after_install:
- CC=gcc-7 && CXX=g++-7

before_script:
- export CC="$(which -- gcc-7)" CXX="$(which -- g++-7)"
- if [ ${TRAVIS_OS_NAME} = "osx" ]; then ln -s /usr/local/opt/openssl/include/openssl /usr/local/include; fi
- mkdir -p ${TRAVIS_BUILD_DIR}/vendor/sqlite/build && cd ${TRAVIS_BUILD_DIR}/vendor/sqlite/build && cmake -D BUILD_SHARED_LIBS=1 ..
- cd ${TRAVIS_BUILD_DIR}/vendor/sqlite/build && make

Expand Down
9 changes: 8 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,11 @@ if(COUNTLY_USE_SQLITE)
target_include_directories(countly PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/vendor/sqlite)
target_link_libraries(countly sqlite3)
if (APPLE)
target_include_directories(countly PRIVATE /usr/local/opt/openssl/include)
set(OPENSSL_ROOT_DIR "/usr/local/opt/openssl")
endif()
find_package(OpenSSL REQUIRED)
target_include_directories(countly PRIVATE ${OPENSSL_INCLUDE_DIRS})
target_link_libraries(countly ${OPENSSL_LIBRARIES})
endif()

if(COUNTLY_BUILD_TESTS)
Expand All @@ -63,4 +66,8 @@ if(COUNTLY_BUILD_TESTS)
target_include_directories(countly-tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/vendor/doctest/doctest)
target_include_directories(countly-tests PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/vendor/json/include)
target_link_libraries(countly-tests countly)
set_target_properties(countly-tests PROPERTIES
CXX_STANDARD 11
CXX_STANDARD_REQUIRED YES
CXX_EXTENSIONS NO)
endif()

0 comments on commit a15701a

Please sign in to comment.