aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWohlstand <admin@wohlnet.ru>2018-12-03 02:44:18 +0300
committerWohlstand <admin@wohlnet.ru>2018-12-03 02:44:18 +0300
commitf4c70cc982de120c68187122be3bdb0c27d8704b (patch)
treede69604636b25717e33cbc151f5a821d10e95444
parentfe69b9c8ac137366123f7c52c51c42a34fcfd032 (diff)
downloadlibADLMIDI-f4c70cc982de120c68187122be3bdb0c27d8704b.tar.gz
libADLMIDI-f4c70cc982de120c68187122be3bdb0c27d8704b.tar.bz2
libADLMIDI-f4c70cc982de120c68187122be3bdb0c27d8704b.zip
Fixed OpenBSD build
-rw-r--r--CMakeLists.txt22
1 files changed, 19 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4770318..adc1054 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -10,7 +10,7 @@ set(CMAKE_CXX_STANDARD 98)
# Strip garbage
if(APPLE)
set(LINK_FLAGS_RELEASE "${LINK_FLAGS_RELEASE} -dead_strip")
-elseif(NOT MSVC AND NOT MSDOS)
+elseif(NOT MSVC AND NOT MSDOS AND NOT OPENBSD_LOCALBASE)
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -Os -s -fdata-sections -ffunction-sections -Wl,--gc-sections -Wl,-s")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -Os -s -fdata-sections -ffunction-sections -Wl,--gc-sections -Wl,-s")
set(LINK_FLAGS_RELEASE "${LINK_FLAGS_RELEASE} -Wl,--gc-sections -Wl,-s")
@@ -51,6 +51,11 @@ IF(NOT WIN32 AND NOT DJGPP AND NOT MSDOS)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
ENDIF()
+if(OPENBSD_LOCALBASE)
+ message("OpenBSD Detected!")
+ include_directories(/usr/local/include)
+endif()
+
if(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} VERSION_LESS 3.2)
message("==Legacy CMake detected! Turning C++11 for everything==")
if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
@@ -318,6 +323,9 @@ if(libADLMIDI_SHARED)
set_property(TARGET ADLMIDI_shared APPEND_STRING PROPERTY LINK_FLAGS " -Wl,-Bstatic,--whole-archive -lpthread -Wl,-Bdynamic,--no-whole-archive")
endif()
endif()
+ if(OPENBSD_LOCALBASE)
+ set_property(TARGET ADLMIDI_shared APPEND_STRING PROPERTY LINK_FLAGS " -lc")
+ endif()
if(WITH_EMBEDDED_BANKS AND WITH_GENADLDATA)
add_dependencies(ADLMIDI_shared gen-adldata-run)
endif()
@@ -376,7 +384,11 @@ if(WITH_MIDIPLAY)
if(MSDOS OR DJGPP)
target_link_libraries(adlmidiplay ADLMIDI_IF)
else()
- target_link_libraries(adlmidiplay ADLMIDI_IF ${SDL2_LIBRARY} pthread dl m stdc++)
+ set(ADLMIDIPLAY_LIBS ADLMIDI_IF ${SDL2_LIBRARY} pthread dl m stdc++)
+ if(OPENBSD_LOCALBASE)
+ list(REMOVE_ITEM ADLMIDIPLAY_LIBS dl)
+ endif()
+ target_link_libraries(adlmidiplay ${ADLMIDIPLAY_LIBS})
endif()
endif()
@@ -438,7 +450,11 @@ if(WITH_ADLMIDI2)
elseif(DJGPP OR MSDOS)
target_link_libraries(adlmidi2 ADLMIDI_IF)
else()
- target_link_libraries(adlmidi2 ADLMIDI_IF ${SDL2_LIBRARY} pthread dl m stdc++)
+ set(ADLMIDI2_LIBS ADLMIDI_IF ${SDL2_LIBRARY} pthread dl m stdc++)
+ if(OPENBSD_LOCALBASE)
+ list(REMOVE_ITEM ADLMIDI2_LIBS dl)
+ endif()
+ target_link_libraries(adlmidi2 ${ADLMIDI2_LIBS})
endif()
if(NOT WITH_CPP_EXTRAS)