Skip to content

Commit 2d08ae9

Browse files
committed
2 parents c180945 + 64f81a9 commit 2d08ae9

File tree

76 files changed

+763
-337
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+763
-337
lines changed

CMakeLists.txt

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ cmake_minimum_required(VERSION 3.2 FATAL_ERROR)
2929
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
3030
set(WriterCompilerDetectionHeaderFound NOTFOUND)
3131

32-
include(GenerateExportHeader)
3332
include(ExternalProject)
3433

3534
# This module is only available with CMake >=3.1, so check whether it could be found
@@ -122,6 +121,23 @@ file(WRITE "${PROJECT_BINARY_DIR}/VERSION" "${META_NAME_VERSION}")
122121

123122
include(Portability)
124123

124+
#
125+
# Define Export Headers
126+
#
127+
128+
include(GenerateExportHeader)
129+
130+
# Workaround to enable Haiku with export headers
131+
# This can be removed once export headers support Haiku
132+
if(PROJECT_OS_HAIKU)
133+
function(GENERATE_EXPORT_HEADER)
134+
set(WIN32 1)
135+
# When the function is redefined, the old function can be accessed through underscore
136+
_GENERATE_EXPORT_HEADER(${ARGN})
137+
unset(WIN32)
138+
endfunction()
139+
endif()
140+
125141
#
126142
# Compiler settings and options
127143
#

cmake/CompileOptions.cmake

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ string(TOUPPER ${CMAKE_SYSTEM_NAME} SYSTEM_NAME_UPPER)
1313

1414
# Determine architecture (32/64 bit)
1515
set(X64 OFF)
16+
1617
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
1718
set(X64 ON)
1819
endif()
@@ -160,9 +161,8 @@ if (PROJECT_OS_FAMILY MATCHES "unix")
160161
add_compile_options(-Wreturn-stack-address)
161162
endif()
162163

163-
if(PROJECT_OS_LINUX)
164-
# Enable threads in linux
165-
add_compile_options(-pthread)
164+
if(PROJECT_OS_HAIKU)
165+
add_compile_options(-fPIC)
166166
endif()
167167

168168
# All warnings that are not explicitly disabled are reported as errors
@@ -201,9 +201,13 @@ endif()
201201

202202
set(DEFAULT_LINKER_OPTIONS)
203203

204-
# Use pthreads on mingw and linux
205-
if(("${CMAKE_C_COMPILER_ID}" MATCHES "GNU" AND "${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") OR "${CMAKE_SYSTEM_NAME}" MATCHES "Linux")
204+
if(APPLE OR PROJECT_OS_LINUX OR MINGW)
205+
# Enable threads in linux, macos and mingw
206206
set(DEFAULT_LINKER_OPTIONS
207207
-pthread
208208
)
209+
elseif(PROJECT_OS_HAIKU)
210+
set(DEFAULT_LINKER_OPTIONS
211+
-lpthread
212+
)
209213
endif()

cmake/Portability.cmake

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,17 @@ if(PROJECT_OS_SOLARIS)
5454
set(PROJECT_OS_FAMILY unix)
5555
endif()
5656

57+
# Check Haiku
58+
string(REGEX MATCH "Haiku" PROJECT_OS_HAIKU ${CMAKE_SYSTEM_NAME})
59+
60+
if(PROJECT_OS_HAIKU)
61+
set(HAIKU 1)
62+
set(PROJECT_OS_HAIKU TRUE BOOL INTERNAL)
63+
set(PROJECT_OS_NAME "Haiku")
64+
set(PROJECT_OS_FAMILY beos)
65+
add_compile_definitions(__HAIKU__)
66+
endif()
67+
5768
# Check Windows
5869
if(WIN32)
5970
set(PROJECT_OS_WIN TRUE BOOL INTERNAL)

source/adt/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ target_link_libraries(${target}
144144
${META_PROJECT_NAME}::version
145145
${META_PROJECT_NAME}::preprocessor
146146
${META_PROJECT_NAME}::format
147+
${META_PROJECT_NAME}::threading
147148
${META_PROJECT_NAME}::log
148149

149150
PUBLIC

source/configuration/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ target_link_libraries(${target}
140140
${META_PROJECT_NAME}::preprocessor
141141
${META_PROJECT_NAME}::environment
142142
${META_PROJECT_NAME}::format
143+
${META_PROJECT_NAME}::threading
143144
${META_PROJECT_NAME}::log
144145
${META_PROJECT_NAME}::memory
145146
${META_PROJECT_NAME}::portability

source/detour/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ target_link_libraries(${target}
140140
${META_PROJECT_NAME}::preprocessor
141141
${META_PROJECT_NAME}::environment
142142
${META_PROJECT_NAME}::format
143+
${META_PROJECT_NAME}::threading
143144
${META_PROJECT_NAME}::log
144145
${META_PROJECT_NAME}::memory
145146
${META_PROJECT_NAME}::portability

source/detours/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ set(DETOUR_MODULE_NAMES
1212
preprocessor
1313
environment
1414
format
15+
threading
1516
log
1617
memory
1718
portability

source/dynlink/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ target_link_libraries(${target}
161161
${META_PROJECT_NAME}::version
162162
${META_PROJECT_NAME}::preprocessor
163163
${META_PROJECT_NAME}::format
164+
${META_PROJECT_NAME}::threading
164165
${META_PROJECT_NAME}::log
165166

166167
PUBLIC

source/dynlink/include/dynlink/dynlink.h

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,21 @@
11
/*
22
* Dynamic Link Library by Parra Studios
3-
* Copyright (C) 2009 - 2016 Vicente Eduardo Ferrer Garcia <[email protected]>
4-
*
53
* A library for dynamic loading and linking shared objects at run-time.
64
*
5+
* Copyright (C) 2016 - 2021 Vicente Eduardo Ferrer Garcia <[email protected]>
6+
*
7+
* Licensed under the Apache License, Version 2.0 (the "License");
8+
* you may not use this file except in compliance with the License.
9+
* You may obtain a copy of the License at
10+
*
11+
* http://www.apache.org/licenses/LICENSE-2.0
12+
*
13+
* Unless required by applicable law or agreed to in writing, software
14+
* distributed under the License is distributed on an "AS IS" BASIS,
15+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
* See the License for the specific language governing permissions and
17+
* limitations under the License.
18+
*
719
*/
820

921
#ifndef DYNLINK_H

source/dynlink/include/dynlink/dynlink_flags.h

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,21 @@
11
/*
22
* Dynamic Link Library by Parra Studios
3-
* Copyright (C) 2009 - 2016 Vicente Eduardo Ferrer Garcia <[email protected]>
4-
*
53
* A library for dynamic loading and linking shared objects at run-time.
64
*
5+
* Copyright (C) 2016 - 2021 Vicente Eduardo Ferrer Garcia <[email protected]>
6+
*
7+
* Licensed under the Apache License, Version 2.0 (the "License");
8+
* you may not use this file except in compliance with the License.
9+
* You may obtain a copy of the License at
10+
*
11+
* http://www.apache.org/licenses/LICENSE-2.0
12+
*
13+
* Unless required by applicable law or agreed to in writing, software
14+
* distributed under the License is distributed on an "AS IS" BASIS,
15+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
* See the License for the specific language governing permissions and
17+
* limitations under the License.
18+
*
719
*/
820

921
#ifndef DYNLINK_FLAGS_H

0 commit comments

Comments
 (0)