-
Notifications
You must be signed in to change notification settings - Fork 10
Enhance CMake portability #810
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: add/cmake
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -26,8 +26,6 @@ openvic_disable_rtti() | |
|
|
||
| option(OPENVIC_USE_PCH "Precompile openvic-simulation/pch.hpp" ON) | ||
|
|
||
| add_subdirectory(deps) | ||
|
|
||
| file(GLOB_RECURSE sim_sources CONFIGURE_DEPENDS src/openvic-simulation/*.cpp) | ||
| list(REMOVE_ITEM sim_sources ${CMAKE_CURRENT_SOURCE_DIR}/src/openvic-simulation/pch.cpp) | ||
|
|
||
|
|
@@ -88,12 +86,29 @@ target_link_libraries( | |
| ov_foonathan_memory | ||
| ) | ||
|
|
||
| if(CMAKE_SYSTEM_NAME STREQUAL "Linux") | ||
| # all unix non apple systems need tbb this way | ||
| if(UNIX AND NOT APPLE) | ||
| find_package(PkgConfig REQUIRED) | ||
| pkg_check_modules(TBB REQUIRED IMPORTED_TARGET tbb) | ||
| target_link_libraries(openvic-simulation PUBLIC PkgConfig::TBB) | ||
| pkg_check_modules(TBB_PC REQUIRED IMPORTED_TARGET GLOBAL tbb) | ||
| target_link_libraries(openvic-simulation PUBLIC PkgConfig::TBB_PC) | ||
| endif() | ||
|
|
||
| # if needed detect other platforms | ||
|
|
||
|
Comment on lines
+96
to
+97
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please follow the style FakeByte used for comments to keep consistency. Also remove the newline spacing. |
||
| if(CMAKE_SYSTEM_NAME STREQUAL "OpenBSD") | ||
| find_path(ICONV_INCLUDE_DIR iconv.h) | ||
| find_library(ICONV_LIBRARY NAMES iconv) | ||
|
|
||
| if(NOT ICONV_INCLUDE_DIR OR NOT ICONV_LIBRARY) | ||
| message(FATAL_ERROR "iconv not found, try installing it") | ||
| endif() | ||
|
|
||
| include_directories(${ICONV_INCLUDE_DIR}) | ||
| link_libraries(${ICONV_LIBRARY}) | ||
| endif() | ||
|
|
||
| add_subdirectory(deps) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why was deps moved down here?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. so the makefile it's jumping to knows about iconv |
||
|
|
||
| if(APPLE) | ||
| # clang emits the TLS init aliases (_ZTH*) for inline thread_local members | ||
| # as non-weak private-external symbols, one per TU that odr-uses them, and | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please follow the style FakeByte used for comments to keep consistency.