Skip to content

Commit

Permalink
More Apple attempts.
Browse files Browse the repository at this point in the history
  • Loading branch information
dkorolev committed Sep 30, 2023
1 parent 9a836b1 commit 1d332d9
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ cmake_minimum_required(VERSION 3.14.1)
if(APPLE)
project(C5T LANGUAGES C CXX OBJC)
message(STATUS "We are on 'Darwin'!")
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -x objective-c++")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -x objective-c++")
find_library(FOUNDATION_LIBRARY Foundation)
elseif(UNIX)
project(C5T LANGUAGES C CXX)
message(STATUS "We are on Unix!")
Expand Down Expand Up @@ -45,7 +46,11 @@ if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
add_executable(${TEST_NAME} "${TEST_SOURCE_FULL_NAME_CC}")
target_compile_definitions(${TEST_NAME} PRIVATE CURRENT_CMAKE_BUILT_TEST)
target_include_directories(${TEST_NAME} PRIVATE "${CMAKE_SOURCE_DIR}/scripts") # For `current_build.h`, needed for `karl/`.
target_link_libraries(${TEST_NAME} PRIVATE Threads::Threads dl C5T)
if(APPLE)
target_link_libraries(${TEST_NAME} PRIVATE Threads::Threads dl ${FOUNDATION_LIBRARY})
else()
target_link_libraries(${TEST_NAME} PRIVATE Threads::Threads dl)
endif()
add_test(${TEST_NAME} ${TEST_NAME} COMMAND ${TEST_NAME})
endforeach()
endif()

0 comments on commit 1d332d9

Please sign in to comment.