-
Notifications
You must be signed in to change notification settings - Fork 157
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
cmake: add basic support #79
base: master
Are you sure you want to change the base?
Conversation
A dynamic linked hlsdl has been built, these DLLs required if running outside MINGW64:
Actually dynamic linked hlsdl build always works on MINGW32/MINGW64 |
Sorry! my carelessness CMakeLists.txt
build
|
@mengmo Awesome, thank you. |
I'm not a diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index d070f48..6e6de86 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -14,12 +14,12 @@ find_package(OpenSSL REQUIRED)
find_package(CURL REQUIRED)
find_package(Threads REQUIRED)
-add_executable(hlsdl main.c aes_openssl.c curl.c hls.c misc.c msg.c mpegts.c)
+add_executable(hlsdl src/main.c src/aes_openssl.c src/curl.c src/hls.c src/misc.c src/msg.c src/mpegts.c)
target_include_directories(hlsdl PRIVATE ${OPENSSL_INCLUDE_DIR} ${CURL_INCLUDE_DIRS})
if (WIN32)
- target_sources(hlsdl PRIVATE "../msvc/win/memmem.c")
+ target_sources(hlsdl PRIVATE "msvc/win/memmem.c")
endif()
target_link_libraries(hlsdl PRIVATE OpenSSL::Crypto CURL::libcurl Threads::Threads) ...and moved it to the root-dir (where it belongs in my opinion). This is the (shortened) log of running
Lots of "undefined reference"-errors! diff --git a/src/CMakeLists.txt b/CMakeLists.txt
index d070f48..12fdd49
--- a/src/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -10,16 +10,20 @@ if (APPLE AND NOT IOS)
endif()
endif()
+if (WIN32)
+ add_definitions(-DCURL_STATICLIB)
+endif()
+
find_package(OpenSSL REQUIRED)
find_package(CURL REQUIRED)
find_package(Threads REQUIRED)
-add_executable(hlsdl main.c aes_openssl.c curl.c hls.c misc.c msg.c mpegts.c)
+add_executable(hlsdl src/main.c src/aes_openssl.c src/curl.c src/hls.c src/misc.c src/msg.c src/mpegts.c)
target_include_directories(hlsdl PRIVATE ${OPENSSL_INCLUDE_DIR} ${CURL_INCLUDE_DIRS})
if (WIN32)
- target_sources(hlsdl PRIVATE "../msvc/win/memmem.c")
+ target_sources(hlsdl PRIVATE "msvc/win/memmem.c")
endif()
-target_link_libraries(hlsdl PRIVATE OpenSSL::Crypto CURL::libcurl Threads::Threads)
+target_link_libraries(hlsdl PRIVATE CURL::libcurl -lssl OpenSSL::Crypto -lz -lws2_32 -lgdi32 -lcrypt32 -lwldap32 Threads::Threads) ...do I get a working I don't understand the need for either of these changes. After
So it looks like
...from Again, I'm no expert, but I'd say these additional changes shouldn't be needed. The detection of |
@Reino17 @mengmo Opinion on this? Both of you have compiled hlsdl on Windows before so you might be interested.
This seems cleaner than the current build script but can you still build static binaries using this?