aboutsummaryrefslogtreecommitdiffhomepage
path: root/CMake/TdSetUpCompiler.cmake
diff options
context:
space:
mode:
authorJoshua M. Clulow <josh@sysmgr.org>2021-04-29 06:40:08 -0700
committerGitHub <noreply@github.com>2021-04-29 16:40:08 +0300
commited291840d3a841bb5b49457c88c57e8467e4a5b0 (patch)
tree83f6f56f33b4463132dd23afaebb66f0d214a66c /CMake/TdSetUpCompiler.cmake
parent75e593fd51c984195f36b7b18791ec57cab93b6a (diff)
add illumos support (#1501)
Diffstat (limited to 'CMake/TdSetUpCompiler.cmake')
-rw-r--r--CMake/TdSetUpCompiler.cmake12
1 files changed, 11 insertions, 1 deletions
diff --git a/CMake/TdSetUpCompiler.cmake b/CMake/TdSetUpCompiler.cmake
index 11a681c1f..73f74cbdb 100644
--- a/CMake/TdSetUpCompiler.cmake
+++ b/CMake/TdSetUpCompiler.cmake
@@ -5,6 +5,8 @@ function(td_set_up_compiler)
set(CMAKE_POSITION_INDEPENDENT_CODE ON PARENT_SCOPE)
+ include(illumos)
+
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set(GCC 1)
set(GCC 1 PARENT_SCOPE)
@@ -58,7 +60,9 @@ function(td_set_up_compiler)
else()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -ffunction-sections -fdata-sections")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ffunction-sections -fdata-sections")
- set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--gc-sections -Wl,--exclude-libs,ALL")
+ if (NOT ILLUMOS)
+ set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--gc-sections -Wl,--exclude-libs,ALL")
+ endif()
endif()
if (WIN32 OR CYGWIN)
@@ -81,6 +85,12 @@ function(td_set_up_compiler)
add_definitions(-D_FILE_OFFSET_BITS=64)
endif()
+ if (ILLUMOS)
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -lnsl -lsocket")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -lnsl -lsocket")
+ add_definitions(-DTD_ILLUMOS=1)
+ endif()
+
include(AddCXXCompilerFlag)
if (NOT MSVC)
add_cxx_compiler_flag("-Wall")