diff options
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 22 |
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) |