From 9063e32a8948fc346468aa5689bff93580f3b65d Mon Sep 17 00:00:00 2001 From: WitherOrNot Date: Thu, 10 Aug 2023 09:49:04 -0400 Subject: [PATCH 01/41] Update CMakeLists.txt --- CMakeLists.txt | 70 +++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 63 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9c80a12..8e3ec7e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -45,6 +45,31 @@ else() set(OPENSSL_MSVC_STATIC_RT TRUE) endif() +# if we found shared libraries - do the following: +string(REGEX MATCH "(\\.so|\\.dll|\\.dylib)$" OPENSSL_CRYPTO_SHARED "${OPENSSL_CRYPTO_LIBRARY}") +if(OPENSSL_CRYPTO_SHARED) + message(STATUS "[UMSKT] Detected Shared library version of OpenSSL") + set(BUILD_SHARED_LIBS ON) +else() + message(STATUS "[UMSKT] Detected Static Library version of OpenSSL") +endif() + +# if we're compiling with MSVC, respect the DEBUG compile option +if(MSVC) + set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") + if(NOT BUILD_SHARED_LIBS) + set(CMAKE_CXX_FLAGS_RELEASE "/MT") + set(CMAKE_CXX_FLAGS_DEBUG "/MTd") + else() + set(CMAKE_CXX_FLAGS_RELEASE "/MD") + set(CMAKE_CXX_FLAGS_DEBUG "/MDd") + endif() + set(CMAKE_EXE_LINKER_FLAGS "/INCREMENTAL:NO /NODEFAULTLIB:MSVCRT") + set(CMAKE_ENABLE_EXPORTS ON) + set(UMSKT_EXE_WINDOWS_EXTRA src/windows/umskt.rc) + set(UMSKT_EXE_WINDOWS_DLL src/windows/dllmain.cpp) +endif() + if(MUSL_STATIC AND NOT UMSKT_USE_SHARED_OPENSSL) set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libgcc -static-libstdc++") set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -static-libgcc -static-libstdc++") @@ -78,10 +103,10 @@ CPMAddPackage( # For Emscripten builds, set CMAKE_TOOLCHAIN_FILE to the appropriate file set(EMSCRIPTEN_BUILD OFF CACHE BOOL "Build for Emscripten" FORCE) if(EMSCRIPTEN_BUILD) - set(CMAKE_TOOLCHAIN_FILE "${CMAKE_SOURCE_DIR}/cmake/Emscripten.cmake" CACHE STRING "Emscripten toolchain file") + set(CMAKE_TOOLCHAIN_FILE "${CMAKE_SOURCE_DIR}/cmake/Emscripten.cmake" CACHE string "Emscripten toolchain file") endif() -CMRC_ADD_RESOURCE_LIBRARY(umskt-rc ALIAS umskt::rc NAMESPACE umskt keys.json) +cmrc_add_resource_library(umskt-rc ALIAS umskt::rc NAMESPACE umskt keys.json) set(LIBUMSKT_SRC src/libumskt/libumskt.cpp @@ -100,10 +125,41 @@ else() add_library(_umskt STATIC ${LIBUMSKT_SRC}) endif() -target_include_directories(_umskt PUBLIC ${OPENSSL_INCLUDE_DIR}) -target_link_libraries(_umskt PRIVATE OpenSSL::Crypto fmt) +#### Separate Build Path for emscripten +if (EMSCRIPTEN) + add_executable(umskt ${LIBUMSKT_SRC}) + target_include_directories(umskt PUBLIC ${OPENSSL_INCLUDE_DIR}) + target_link_libraries(umskt -static OpenSSL::Crypto cryptopp::cryptopp fmt) + set(CMAKE_EXECUTABLE_SUFFIX ".html") -add_executable(umskt src/main.cpp src/cli.cpp ${UMSKT_EXE_WINDOWS_EXTRA}) + set_target_properties(umskt PROPERTIES COMPILE_FLAGS "-Os -sEXPORTED_RUNTIME_METHODS=ccall,cwrap") + set_target_properties(umskt PROPERTIES LINK_FLAGS "-Os -sWASM=1 -sEXPORT_ALL=1 -sEXPORTED_RUNTIME_METHODS=ccall,cwrap --no-entry") +else() + if(NOT UMSKT_USE_SHARED_OPENSSL) + ### Static library compilation + add_library(_umskt STATIC ${LIBUMSKT_SRC}) + target_include_directories(_umskt PUBLIC ${OPENSSL_INCLUDE_DIR}) + target_link_libraries(_umskt -static OpenSSL::Crypto fmt ${UMSKT_LINK_LIBS}) + else() + ### Shared library compilation + add_library(_umskt SHARED ${LIBUMSKT_SRC} ${UMSKT_EXE_WINDOWS_EXTRA} ${UMSKT_EXE_WINDOWS_DLL}) + target_include_directories(_umskt PUBLIC ${OPENSSL_INCLUDE_DIR}) + target_link_libraries(_umskt OpenSSL::Crypto fmt ${UMSKT_LINK_LIBS}) + target_link_directories(_umskt PUBLIC ${UMSKT_LINK_DIRS}) + endif() -target_include_directories(umskt PUBLIC ${OPENSSL_INCLUDE_DIR}) -target_link_libraries(umskt PRIVATE _umskt OpenSSL::Crypto fmt nlohmann_json::nlohmann_json umskt::rc) + ### UMSKT executable compilation + add_executable(umskt src/main.cpp src/cli.cpp ${UMSKT_EXE_WINDOWS_EXTRA}) + target_include_directories(umskt PUBLIC ${OPENSSL_INCLUDE_DIR}) + target_link_libraries(umskt _umskt OpenSSL::Crypto fmt nlohmann_json::nlohmann_json umskt::rc ${UMSKT_LINK_LIBS}) + target_link_directories(umskt PUBLIC ${UMSKT_LINK_DIRS}) + if(MSVC AND MSVC_MSDOS_STUB) + set_property(TARGET umskt APPEND PROPERTY LINK_FLAGS /STUB:${MSVC_MSDOS_STUB}) + endif() + + ### Copy Shared Libraries and dependency files + if (OPENSSL_CRYPTO_SHARED) + get_filename_component(OPENSSL_CRYPTO_LIBRARY_FILENAME ${OPENSSL_CRYPTO_LIBRARY} NAME) + configure_file(${OPENSSL_CRYPTO_LIBRARY} "${CMAKE_CURRENT_BINARY_DIR}/${OPENSSL_CRYPTO_LIBRARY_FILENAME}" COPYONLY) + endif() +endif() From 9f7920ca2d6b186ca0155b0f27ab674c13677e1a Mon Sep 17 00:00:00 2001 From: WitherOrNot Date: Thu, 10 Aug 2023 09:51:10 -0400 Subject: [PATCH 02/41] Update CMakeLists.txt --- CMakeLists.txt | 6 ------ 1 file changed, 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8e3ec7e..2031b22 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -119,12 +119,6 @@ set(LIBUMSKT_SRC src/libumskt/debugoutput.cpp ) -if(UMSKT_USE_SHARED_OPENSSL) - add_library(_umskt SHARED ${LIBUMSKT_SRC}) -else() - add_library(_umskt STATIC ${LIBUMSKT_SRC}) -endif() - #### Separate Build Path for emscripten if (EMSCRIPTEN) add_executable(umskt ${LIBUMSKT_SRC}) From 11253c5e2ce75ba13f092453e72a7425081c2a19 Mon Sep 17 00:00:00 2001 From: WitherOrNot Date: Thu, 10 Aug 2023 09:59:20 -0400 Subject: [PATCH 03/41] Revert to old CMakeLists for now --- CMakeLists.txt | 234 ++++++++++++++++++++++++++----------------------- 1 file changed, 126 insertions(+), 108 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2031b22..36fda23 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,142 +18,160 @@ # @FileCreated by Andrew on 05/30/2023 # @Maintainer Neo -cmake_minimum_required(VERSION 3.12) +CMAKE_MINIMUM_REQUIRED(VERSION 3.12) +PROJECT(UMSKT) +SET(CMAKE_CXX_STANDARD 17) +SET(CMAKE_POSITION_INDEPENDENT_CODE ON) +OPTION(UMSKT_USE_SHARED_OPENSSL "Force linking against the system-wide OpenSSL library" OFF) +OPTION(MUSL_STATIC "Enable fully static builds in a muslc environment (i.e. Alpine Linux)" OFF) +OPTION(DJGPP_WATT32 "Enable compilation and linking with DJGPP/WATT32/OpenSSL" OFF) +OPTION(MSVC_MSDOS_STUB "Specify a custom MS-DOS stub for a 32-bit MSVC compilation" OFF) -project(UMSKT) -set(CMAKE_OSX_SYSROOT "macosx" CACHE PATH "macOS SDK path") +SET(UMSKT_LINK_LIBS ${UMSKT_LINK_LIBS}) +SET(UMSKT_LINK_DIRS ${UMSKT_LINK_DIRS}) -set(CMAKE_CXX_STANDARD 17) -set(CMAKE_POSITION_INDEPENDENT_CODE ON) +IF(UMSKT_USE_SHARED_OPENSSL) + SET(OPENSSL_USE_STATIC_LIBS FALSE) + SET(OPENSSL_MSVC_STATIC_RT FALSE) + MESSAGE(WARNING "[UMSKT] Forcing shared OpenSSL runtime") +ELSE() + SET(OPENSSL_USE_STATIC_LIBS TRUE) + SET(OPENSSL_MSVC_STATIC_RT TRUE) +ENDIF() -option(UMSKT_USE_SHARED_OPENSSL "Force linking against the system-wide OpenSSL library" OFF) -option(MUSL_STATIC "Enable fully static builds in a muslc environment (i.e. Alpine Linux)" OFF) -option(DJGPP_WATT32 "Enable compilation and linking with DJGPP/WATT32/OpenSSL" OFF) -option(MSVC_MSDOS_STUB "Specify a custom MS-DOS stub for a 32-bit MSVC compilation" OFF) +IF(DJGPP_WATT32) + SET(CMAKE_SYSTEM_NAME MSDOS) + SET(UMSKT_LINK_LIBS ${UMSKT_LINK_LIBS} ${DJGPP_WATT32}) + SET(UMSKT_LINK_DIRS ${UMSKT_LINK_DIRS} ${WATT_ROOT}/lib) +ENDIF() -find_package(OpenSSL REQUIRED) - -if(NOT OpenSSL_FOUND) - message(FATAL_ERROR "OpenSSL Development Libraries Not Found. Please install the required OpenSSL development package.") -endif() - -if(UMSKT_USE_SHARED_OPENSSL) - set(OPENSSL_USE_STATIC_LIBS FALSE) - set(OPENSSL_MSVC_STATIC_RT FALSE) -else() - set(OPENSSL_USE_STATIC_LIBS TRUE) - set(OPENSSL_MSVC_STATIC_RT TRUE) -endif() +# find the system installed OpenSSL development library +FIND_PACKAGE(OpenSSL REQUIRED) +IF(NOT OPENSSL_FOUND) + MESSAGE(SEND_ERROR "OpenSSL Development Libraries Not Found") + MESSAGE(SEND_ERROR "Please consult your package manager of choice to install the prerequisite") + MESSAGE(SEND_ERROR "The package name is commonly called libssl-dev or openssl-dev depending on distribution") + MESSAGE(FATAL_ERROR "Can not continue without OpenSSL") +ENDIF() # if we found shared libraries - do the following: -string(REGEX MATCH "(\\.so|\\.dll|\\.dylib)$" OPENSSL_CRYPTO_SHARED "${OPENSSL_CRYPTO_LIBRARY}") -if(OPENSSL_CRYPTO_SHARED) - message(STATUS "[UMSKT] Detected Shared library version of OpenSSL") - set(BUILD_SHARED_LIBS ON) -else() - message(STATUS "[UMSKT] Detected Static Library version of OpenSSL") -endif() +STRING(REGEX MATCH "(\\.so|\\.dll|\\.dylib)$" OPENSSL_CRYPTO_SHARED "${OPENSSL_CRYPTO_LIBRARY}") +IF(OPENSSL_CRYPTO_SHARED) + MESSAGE(STATUS "[UMSKT] Detected Shared library version of OpenSSL") + SET(BUILD_SHARED_LIBS ON) +ELSE() + MESSAGE(STATUS "[UMSKT] Detected Static Library version of OpenSSL") +ENDIF() # if we're compiling with MSVC, respect the DEBUG compile option -if(MSVC) - set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") - if(NOT BUILD_SHARED_LIBS) - set(CMAKE_CXX_FLAGS_RELEASE "/MT") - set(CMAKE_CXX_FLAGS_DEBUG "/MTd") - else() - set(CMAKE_CXX_FLAGS_RELEASE "/MD") - set(CMAKE_CXX_FLAGS_DEBUG "/MDd") - endif() - set(CMAKE_EXE_LINKER_FLAGS "/INCREMENTAL:NO /NODEFAULTLIB:MSVCRT") - set(CMAKE_ENABLE_EXPORTS ON) - set(UMSKT_EXE_WINDOWS_EXTRA src/windows/umskt.rc) - set(UMSKT_EXE_WINDOWS_DLL src/windows/dllmain.cpp) -endif() +IF(MSVC) + SET(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") + IF(NOT BUILD_SHARED_LIBS) + SET(CMAKE_CXX_FLAGS_RELEASE "/MT") + SET(CMAKE_CXX_FLAGS_DEBUG "/MTd") + ELSE() + SET(CMAKE_CXX_FLAGS_RELEASE "/MD") + SET(CMAKE_CXX_FLAGS_DEBUG "/MDd") + ENDIF() + SET(CMAKE_EXE_LINKER_FLAGS "/INCREMENTAL:NO /NODEFAULTLIB:MSVCRT") + SET(CMAKE_ENABLE_EXPORTS ON) + SET(UMSKT_EXE_WINDOWS_EXTRA src/windows/umskt.rc) + SET(UMSKT_EXE_WINDOWS_DLL src/windows/dllmain.cpp) +ENDIF() -if(MUSL_STATIC AND NOT UMSKT_USE_SHARED_OPENSSL) - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libgcc -static-libstdc++") - set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -static-libgcc -static-libstdc++") - set(CMAKE_FIND_LIBRARY_SUFFIXES ".a") - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -static-libgcc -static-libstdc++") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-libgcc -static-libstdc++") -endif() +IF(MUSL_STATIC) + MESSAGE(STATUS "[UMSKT] Performing a fully static build using muslc") + SET(CMAKE_EXE_LINKER_FLAGS "-static -static-libgcc -static-libstdc++") + SET(CMAKE_SHARED_LINKER_FLAGS "-static -static-libgcc -static-libstdc++") + SET(CMAKE_FIND_LIBRARY_SUFFIXES ".a") + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -static-libgcc -static-libstdc++") + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-libgcc -static-libstdc++") +ENDIF() -include(cmake/CPM.cmake) +# initalize cpm.CMake +INCLUDE(cmake/CPM.cmake) +# fetch cpm.CMake dependencies +# Include JSON development library CPMAddPackage( - NAME nlohmann_json - GITHUB_REPOSITORY nlohmann/json - VERSION 3.11.2 + NAME nlohmann_json + GITHUB_REPOSITORY nlohmann/json + VERSION 3.11.2 ) +# Include fmt development library CPMAddPackage( - NAME fmt - GITHUB_REPOSITORY fmtlib/fmt - GIT_TAG 10.0.0 - VERSION 10.0.0 + NAME fmt + GITHUB_REPOSITORY fmtlib/fmt + GIT_TAG 10.0.0 + VERSION 10.0.0 ) +# Include cmrc resource compiler CPMAddPackage( - NAME cmrc - GITHUB_REPOSITORY vector-of-bool/cmrc - GIT_TAG 2.0.1 - VERSION 2.0.1 + NAME cmrc + GITHUB_REPOSITORY vector-of-bool/cmrc + GIT_TAG 2.0.1 + VERSION 2.0.1 ) -# For Emscripten builds, set CMAKE_TOOLCHAIN_FILE to the appropriate file -set(EMSCRIPTEN_BUILD OFF CACHE BOOL "Build for Emscripten" FORCE) -if(EMSCRIPTEN_BUILD) - set(CMAKE_TOOLCHAIN_FILE "${CMAKE_SOURCE_DIR}/cmake/Emscripten.cmake" CACHE string "Emscripten toolchain file") -endif() +# Include Crypto++ development library +#CPMAddPackage( +# NAME cryptopp-cmake +# GITHUB_REPOSITORY abdes/cryptopp-cmake +# GIT_TAG CRYPTOPP_8_8_0 +# VERSION 8.8.0 +# OPTIONS "CRYPTOPP_BUILD_TESTING OFF" +#) -cmrc_add_resource_library(umskt-rc ALIAS umskt::rc NAMESPACE umskt keys.json) +#include googletest unit testing library +#CPMAddPackage( +# NAME googletest +# GITHUB_REPOSITORY google/googletest +# VERSION 1.13.0 +# OPTIONS "INSTALL_GTEST OFF" "gtest_force_shared_crt" +#) -set(LIBUMSKT_SRC - src/libumskt/libumskt.cpp - src/libumskt/pidgen3/BINK1998.cpp - src/libumskt/pidgen3/BINK2002.cpp - src/libumskt/pidgen3/key.cpp - src/libumskt/pidgen3/util.cpp - src/libumskt/confid/confid.cpp - src/libumskt/pidgen2/PIDGEN2.cpp - src/libumskt/debugoutput.cpp -) +### Resource compilation +CMRC_ADD_RESOURCE_LIBRARY(umskt-rc ALIAS umskt::rc NAMESPACE umskt keys.json) + +SET(LIBUMSKT_SRC src/libumskt/libumskt.cpp src/libumskt/pidgen3/BINK1998.cpp src/libumskt/pidgen3/BINK2002.cpp src/libumskt/pidgen3/key.cpp src/libumskt/pidgen3/util.cpp src/libumskt/confid/confid.cpp src/libumskt/pidgen2/PIDGEN2.cpp src/libumskt/debugoutput.cpp) #### Separate Build Path for emscripten -if (EMSCRIPTEN) - add_executable(umskt ${LIBUMSKT_SRC}) - target_include_directories(umskt PUBLIC ${OPENSSL_INCLUDE_DIR}) - target_link_libraries(umskt -static OpenSSL::Crypto cryptopp::cryptopp fmt) - set(CMAKE_EXECUTABLE_SUFFIX ".html") +IF (EMSCRIPTEN) + ADD_EXECUTABLE(umskt ${LIBUMSKT_SRC}) + TARGET_INCLUDE_DIRECTORIES(umskt PUBLIC ${OPENSSL_INCLUDE_DIR}) + TARGET_LINK_LIBRARIES(umskt -static OpenSSL::Crypto cryptopp::cryptopp fmt) + SET(CMAKE_EXECUTABLE_SUFFIX ".html") - set_target_properties(umskt PROPERTIES COMPILE_FLAGS "-Os -sEXPORTED_RUNTIME_METHODS=ccall,cwrap") - set_target_properties(umskt PROPERTIES LINK_FLAGS "-Os -sWASM=1 -sEXPORT_ALL=1 -sEXPORTED_RUNTIME_METHODS=ccall,cwrap --no-entry") -else() - if(NOT UMSKT_USE_SHARED_OPENSSL) + SET_TARGET_PROPERTIES(umskt PROPERTIES COMPILE_FLAGS "-Os -sEXPORTED_RUNTIME_METHODS=ccall,cwrap") + SET_TARGET_PROPERTIES(umskt PROPERTIES LINK_FLAGS "-Os -sWASM=1 -sEXPORT_ALL=1 -sEXPORTED_RUNTIME_METHODS=ccall,cwrap --no-entry") +ELSE() + IF(NOT UMSKT_USE_SHARED_OPENSSL) ### Static library compilation - add_library(_umskt STATIC ${LIBUMSKT_SRC}) - target_include_directories(_umskt PUBLIC ${OPENSSL_INCLUDE_DIR}) - target_link_libraries(_umskt -static OpenSSL::Crypto fmt ${UMSKT_LINK_LIBS}) - else() + ADD_LIBRARY(_umskt STATIC ${LIBUMSKT_SRC}) + TARGET_INCLUDE_DIRECTORIES(_umskt PUBLIC ${OPENSSL_INCLUDE_DIR}) + TARGET_LINK_LIBRARIES(_umskt -static OpenSSL::Crypto fmt ${UMSKT_LINK_LIBS}) + ELSE() ### Shared library compilation - add_library(_umskt SHARED ${LIBUMSKT_SRC} ${UMSKT_EXE_WINDOWS_EXTRA} ${UMSKT_EXE_WINDOWS_DLL}) - target_include_directories(_umskt PUBLIC ${OPENSSL_INCLUDE_DIR}) - target_link_libraries(_umskt OpenSSL::Crypto fmt ${UMSKT_LINK_LIBS}) - target_link_directories(_umskt PUBLIC ${UMSKT_LINK_DIRS}) - endif() + ADD_LIBRARY(_umskt SHARED ${LIBUMSKT_SRC} ${UMSKT_EXE_WINDOWS_EXTRA} ${UMSKT_EXE_WINDOWS_DLL}) + TARGET_INCLUDE_DIRECTORIES(_umskt PUBLIC ${OPENSSL_INCLUDE_DIR}) + TARGET_LINK_LIBRARIES(_umskt OpenSSL::Crypto fmt ${UMSKT_LINK_LIBS}) + TARGET_LINK_DIRECTORIES(_umskt PUBLIC ${UMSKT_LINK_DIRS}) + ENDIF() ### UMSKT executable compilation - add_executable(umskt src/main.cpp src/cli.cpp ${UMSKT_EXE_WINDOWS_EXTRA}) - target_include_directories(umskt PUBLIC ${OPENSSL_INCLUDE_DIR}) - target_link_libraries(umskt _umskt OpenSSL::Crypto fmt nlohmann_json::nlohmann_json umskt::rc ${UMSKT_LINK_LIBS}) - target_link_directories(umskt PUBLIC ${UMSKT_LINK_DIRS}) - if(MSVC AND MSVC_MSDOS_STUB) - set_property(TARGET umskt APPEND PROPERTY LINK_FLAGS /STUB:${MSVC_MSDOS_STUB}) - endif() + ADD_EXECUTABLE(umskt src/main.cpp src/cli.cpp ${UMSKT_EXE_WINDOWS_EXTRA}) + TARGET_INCLUDE_DIRECTORIES(umskt PUBLIC ${OPENSSL_INCLUDE_DIR}) + TARGET_LINK_LIBRARIES(umskt _umskt OpenSSL::Crypto fmt nlohmann_json::nlohmann_json umskt::rc ${UMSKT_LINK_LIBS}) + TARGET_LINK_DIRECTORIES(umskt PUBLIC ${UMSKT_LINK_DIRS}) + IF(MSVC AND MSVC_MSDOS_STUB) + SET_PROPERTY(TARGET umskt APPEND PROPERTY LINK_FLAGS /STUB:${MSVC_MSDOS_STUB}) + ENDIF() ### Copy Shared Libraries and dependency files - if (OPENSSL_CRYPTO_SHARED) - get_filename_component(OPENSSL_CRYPTO_LIBRARY_FILENAME ${OPENSSL_CRYPTO_LIBRARY} NAME) - configure_file(${OPENSSL_CRYPTO_LIBRARY} "${CMAKE_CURRENT_BINARY_DIR}/${OPENSSL_CRYPTO_LIBRARY_FILENAME}" COPYONLY) - endif() -endif() + IF (OPENSSL_CRYPTO_SHARED) + GET_FILENAME_COMPONENT(OPENSSL_CRYPTO_LIBRARY_FILENAME ${OPENSSL_CRYPTO_LIBRARY} NAME) + CONFIGURE_FILE(${OPENSSL_CRYPTO_LIBRARY} "${CMAKE_CURRENT_BINARY_DIR}/${OPENSSL_CRYPTO_LIBRARY_FILENAME}" COPYONLY) + ENDIF() +ENDIF() From d411d56d81790fb0ccbcb2e739c8e4dc830c5476 Mon Sep 17 00:00:00 2001 From: WitherOrNot Date: Thu, 10 Aug 2023 10:18:55 -0400 Subject: [PATCH 04/41] Update dos-djgpp.yml --- .github/workflows/dos-djgpp.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/dos-djgpp.yml b/.github/workflows/dos-djgpp.yml index e16ee23..4d65b01 100644 --- a/.github/workflows/dos-djgpp.yml +++ b/.github/workflows/dos-djgpp.yml @@ -27,8 +27,8 @@ on: branches: [ "master" ] env: - CMAKE_C_COMPILER: ${{ github.workspace }}/djgpp/bin/i586-pc-msdosdjgpp-gcc - CMAKE_CXX_COMPILER: ${{ github.workspace }}/djgpp/bin/i586-pc-msdosdjgpp-g++ + CMAKE_C_COMPILER: ${{ github.workspace }}/djgpp/bin/i386-pc-msdosdjgpp-gcc + CMAKE_CXX_COMPILER: ${{ github.workspace }}/djgpp/bin/i386-pc-msdosdjgpp-g++ CMAKE_FIND_ROOT_PATH: ${{ github.workspace }}/djgpp CMAKE_FIND_ROOT_PATH_MODE_PROGRAM: NEVER CMAKE_FIND_ROOT_PATH_MODE_LIBRARY: ONLY @@ -47,9 +47,10 @@ jobs: - name: Download and Setup DJGPP Toolchain run: | - wget https://github.com/andrewwutw/build-djgpp/releases/download/v3.4/djgpp-linux64-gcc1220.tar.bz2 - tar xjf djgpp-linux64-gcc1220.tar.bz2 + mkdir ${{ github.workspace }}/djgpp cd ${{ github.workspace }}/djgpp + wget https://github.com/UMSKT/build-djgpp/releases/download/toolchain/toolchain.tar.gz + tar xzf toolchain.tar.gz git clone https://github.com/UMSKT/Watt-32.git watt32 cd watt32/util make clean && make linux @@ -67,7 +68,7 @@ jobs: ./Configure no-threads -DOPENSSL_DEV_NO_ATOMICS --prefix=${{ github.workspace }}/djgpp DJGPP make && make install popd - ls ${{ github.workspace }}/djgpp/i586-pc-msdosdjgpp/bin/ + ls ${{ github.workspace }}/djgpp/i386-pc-msdosdjgpp/bin/ - name: Checkout Source Tree uses: actions/checkout@v3 From 232be6aba2a2626cb412276699e51e96250e2343 Mon Sep 17 00:00:00 2001 From: TheTank20 Date: Thu, 10 Aug 2023 14:45:04 -0500 Subject: [PATCH 05/41] trigger GitHub Actions --- _dummy.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 _dummy.txt diff --git a/_dummy.txt b/_dummy.txt new file mode 100644 index 0000000..4dba588 --- /dev/null +++ b/_dummy.txt @@ -0,0 +1 @@ +I put this file in to get Actions to trigger. From c078247beab3fc4a7596d9fa0e7aa51426198c91 Mon Sep 17 00:00:00 2001 From: TheTank20 Date: Thu, 10 Aug 2023 14:46:11 -0500 Subject: [PATCH 06/41] Delete _dummy.txt --- _dummy.txt | 1 - 1 file changed, 1 deletion(-) delete mode 100644 _dummy.txt diff --git a/_dummy.txt b/_dummy.txt deleted file mode 100644 index 4dba588..0000000 --- a/_dummy.txt +++ /dev/null @@ -1 +0,0 @@ -I put this file in to get Actions to trigger. From 46c39df15de643add214e86211a491782218e82c Mon Sep 17 00:00:00 2001 From: WitherOrNot Date: Thu, 10 Aug 2023 16:23:01 -0400 Subject: [PATCH 07/41] Update CMakeLists.txt --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 36fda23..7e7e307 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,6 +22,7 @@ CMAKE_MINIMUM_REQUIRED(VERSION 3.12) PROJECT(UMSKT) SET(CMAKE_CXX_STANDARD 17) SET(CMAKE_POSITION_INDEPENDENT_CODE ON) +SET(CMAKE_OSX_SYSROOT "macosx" CACHE PATH "macOS SDK path") OPTION(UMSKT_USE_SHARED_OPENSSL "Force linking against the system-wide OpenSSL library" OFF) OPTION(MUSL_STATIC "Enable fully static builds in a muslc environment (i.e. Alpine Linux)" OFF) OPTION(DJGPP_WATT32 "Enable compilation and linking with DJGPP/WATT32/OpenSSL" OFF) From f43a2d5c37b82b1c636418ee7878d7010432de59 Mon Sep 17 00:00:00 2001 From: WitherOrNot Date: Thu, 10 Aug 2023 16:54:33 -0400 Subject: [PATCH 08/41] Update CMakeLists.txt --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7e7e307..cb0aaed 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -42,6 +42,10 @@ ENDIF() IF(DJGPP_WATT32) SET(CMAKE_SYSTEM_NAME MSDOS) + SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) + SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) + SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) + SET(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY) SET(UMSKT_LINK_LIBS ${UMSKT_LINK_LIBS} ${DJGPP_WATT32}) SET(UMSKT_LINK_DIRS ${UMSKT_LINK_DIRS} ${WATT_ROOT}/lib) ENDIF() From bde4371cbe7a408999cee1559ca6e7910311f3ff Mon Sep 17 00:00:00 2001 From: WitherOrNot Date: Thu, 10 Aug 2023 16:59:23 -0400 Subject: [PATCH 09/41] Update dos-djgpp.yml --- .github/workflows/dos-djgpp.yml | 56 ++++++++++++++------------------- 1 file changed, 23 insertions(+), 33 deletions(-) diff --git a/.github/workflows/dos-djgpp.yml b/.github/workflows/dos-djgpp.yml index 4d65b01..aaed076 100644 --- a/.github/workflows/dos-djgpp.yml +++ b/.github/workflows/dos-djgpp.yml @@ -21,74 +21,64 @@ name: C/C++ CI (DOS DJGPP) on: - push: - branches: [ "master" ] - pull_request: - branches: [ "master" ] + workflow_call: env: - CMAKE_C_COMPILER: ${{ github.workspace }}/djgpp/bin/i386-pc-msdosdjgpp-gcc - CMAKE_CXX_COMPILER: ${{ github.workspace }}/djgpp/bin/i386-pc-msdosdjgpp-g++ + CC: ${{ github.workspace }}/djgpp/bin/i586-pc-msdosdjgpp-gcc + CXX: ${{ github.workspace }}/djgpp/bin/i586-pc-msdosdjgpp-g++ CMAKE_FIND_ROOT_PATH: ${{ github.workspace }}/djgpp - CMAKE_FIND_ROOT_PATH_MODE_PROGRAM: NEVER - CMAKE_FIND_ROOT_PATH_MODE_LIBRARY: ONLY - CMAKE_FIND_ROOT_PATH_MODE_INCLUDE: ONLY - CMAKE_FIND_ROOT_PATH_MODE_PACKAGE: ONLY WATT_ROOT: ${{ github.workspace }}/djgpp/watt32 jobs: build: runs-on: ubuntu-latest steps: + - name: Checkout Source Tree + uses: actions/checkout@v3 + - name: Setup build environment run: | sudo apt -y update - sudo apt -y install build-essential cmake wget 7zip git flex nasm libslang2-dev pkg-config libslang2-modules gcc-multilib + sudo apt -y install build-essential cmake wget 7zip git flex libfl-dev nasm libslang2-dev pkg-config libslang2-modules gcc-multilib - name: Download and Setup DJGPP Toolchain run: | - mkdir ${{ github.workspace }}/djgpp + pushd ${{ github.workspace }} + wget https://github.com/andrewwutw/build-djgpp/releases/download/v3.4/djgpp-linux64-gcc1220.tar.bz2 + tar xjf djgpp-linux64-gcc1220.tar.bz2 cd ${{ github.workspace }}/djgpp - wget https://github.com/UMSKT/build-djgpp/releases/download/toolchain/toolchain.tar.gz - tar xzf toolchain.tar.gz git clone https://github.com/UMSKT/Watt-32.git watt32 cd watt32/util make clean && make linux cd ../src + source ${{ github.workspace }}/djgpp/setenv ./configur.sh djgpp make -f djgpp.mak - ln -s ${{ github.workspace }}/djgpp/watt32/lib/libwatt.a ${{ github.workspace }}/djgpp/lib + ln -s ${WATT_ROOT}/lib/libwatt.a ${{ github.workspace }}/djgpp/lib - - name: Checkout and Cross Compile OpenSSL 3.1 + - name: Checkout and Cross Compile OpenSSL 3.1.2 run: | git clone https://github.com/UMSKT/openssl.git openssl pushd openssl - git checkout openssl-3.1.1 source ${{ github.workspace }}/djgpp/setenv ./Configure no-threads -DOPENSSL_DEV_NO_ATOMICS --prefix=${{ github.workspace }}/djgpp DJGPP make && make install popd - ls ${{ github.workspace }}/djgpp/i386-pc-msdosdjgpp/bin/ - - - name: Checkout Source Tree - uses: actions/checkout@v3 - name: Build - uses: threeal/cmake-action@v1.2.0 - with: - c-compiler: gcc - cxx-compiler: g++ - options: OPENSSL_ROOT_DIR:string=${{ github.workspace }}/djgpp DJGPP_WATT32=ON - run-build: true - - - name: Test & Move files to correct directory run: | - mkdir -p build/actions_upload - mv build/umskt build/actions_upload/umskt + source ${{ github.workspace }}/djgpp/setenv + pushd build + cmake ../ -D DJGPP_WATT32=${WATT_ROOT}/lib/libwatt.a -D CMAKE_FIND_ROOT_PATH=${CMAKE_FIND_ROOT_PATH} + make + + - name: Move executable to upload directory + run: | + mkdir build/actions_upload + mv build/umskt.exe build/actions_upload/ - name: Upload build artifact uses: actions/upload-artifact@v3.1.2 with: - name: UMSKT-DOS-DJGPP + name: UMSKT-DOS path: build/actions_upload - From de09feb18f2ff5ade004ecf7436ca3a3b2c23ba8 Mon Sep 17 00:00:00 2001 From: WitherOrNot Date: Thu, 10 Aug 2023 17:00:49 -0400 Subject: [PATCH 10/41] Update dos-djgpp.yml --- .github/workflows/dos-djgpp.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/dos-djgpp.yml b/.github/workflows/dos-djgpp.yml index aaed076..5410fb0 100644 --- a/.github/workflows/dos-djgpp.yml +++ b/.github/workflows/dos-djgpp.yml @@ -21,7 +21,10 @@ name: C/C++ CI (DOS DJGPP) on: - workflow_call: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] env: CC: ${{ github.workspace }}/djgpp/bin/i586-pc-msdosdjgpp-gcc From 444f8c45c7e8be42e973fc6cfd0cbb7681eb3e7e Mon Sep 17 00:00:00 2001 From: TheTank20 Date: Mon, 14 Aug 2023 15:07:24 -0400 Subject: [PATCH 11/41] Allow manual workflows and auto workflows on all branches This lets workflows work on all branches without changing anything, and allows workflows to be activated manually. --- .github/workflows/windows.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 27a3d67..2167042 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -22,9 +22,10 @@ name: C/C++ CI (Windows) on: push: - branches: [ "master" ] + branches: [ "*" ] pull_request: - branches: [ "master" ] + branches: [ "*" ] + workflow_dispatch: jobs: build-32bit: From f95501b7890bb99d7b94304c0ae696397cee1118 Mon Sep 17 00:00:00 2001 From: TheTank20 Date: Mon, 14 Aug 2023 15:08:24 -0400 Subject: [PATCH 12/41] Update macos.yml --- .github/workflows/macos.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index ea3ae00..505d6fd 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -22,9 +22,10 @@ name: C/C++ CI (macOS) on: push: - branches: [ "master" ] + branches: [ "*" ] pull_request: - branches: [ "master" ] + branches: [ "*" ] + workflow_dispatch: jobs: build-x86: From c664ea7f9cee709c7fe4e807eede3d4267f6fa64 Mon Sep 17 00:00:00 2001 From: TheTank20 Date: Mon, 14 Aug 2023 15:08:52 -0400 Subject: [PATCH 13/41] Update linux.yml --- .github/workflows/linux.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index ce884c5..1a78c93 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -22,9 +22,10 @@ name: C/C++ CI (Linux) on: push: - branches: [ "master" ] + branches: [ "*" ] pull_request: - branches: [ "master" ] + branches: [ "*" ] + workflow_dispatch: jobs: build: From e9131e45c8332bdaba7149fe5e9430adabc9b554 Mon Sep 17 00:00:00 2001 From: TheTank20 Date: Mon, 14 Aug 2023 15:09:16 -0400 Subject: [PATCH 14/41] Update freebsd.yml --- .github/workflows/freebsd.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/freebsd.yml b/.github/workflows/freebsd.yml index c8eaa49..b2954d1 100644 --- a/.github/workflows/freebsd.yml +++ b/.github/workflows/freebsd.yml @@ -22,9 +22,10 @@ name: C/C++ CI (FreeBSD) on: push: - branches: [ "master" ] + branches: [ "*" ] pull_request: - branches: [ "master" ] + branches: [ "*" ] + workflow_dispatch: jobs: build: From 75e81e7049e95abbb0e6cd998b887410a12b7f14 Mon Sep 17 00:00:00 2001 From: TheTank20 Date: Mon, 14 Aug 2023 15:09:41 -0400 Subject: [PATCH 15/41] Update dos-djgpp.yml --- .github/workflows/dos-djgpp.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dos-djgpp.yml b/.github/workflows/dos-djgpp.yml index e16ee23..b6c2097 100644 --- a/.github/workflows/dos-djgpp.yml +++ b/.github/workflows/dos-djgpp.yml @@ -22,9 +22,10 @@ name: C/C++ CI (DOS DJGPP) on: push: - branches: [ "master" ] + branches: [ "*" ] pull_request: - branches: [ "master" ] + branches: [ "*" ] + workflow_dispatch: env: CMAKE_C_COMPILER: ${{ github.workspace }}/djgpp/bin/i586-pc-msdosdjgpp-gcc From c91bbad69a512189c3478976bc1147f51bbeb117 Mon Sep 17 00:00:00 2001 From: TheTank20 Date: Mon, 14 Aug 2023 15:11:17 -0400 Subject: [PATCH 16/41] Update dos-djgpp.yml --- .github/workflows/dos-djgpp.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/dos-djgpp.yml b/.github/workflows/dos-djgpp.yml index b6c2097..3559c24 100644 --- a/.github/workflows/dos-djgpp.yml +++ b/.github/workflows/dos-djgpp.yml @@ -23,8 +23,6 @@ name: C/C++ CI (DOS DJGPP) on: push: branches: [ "*" ] - pull_request: - branches: [ "*" ] workflow_dispatch: env: From e76eb7ac33fd9cdea357af6fb5f777e98781c6d2 Mon Sep 17 00:00:00 2001 From: TheTank20 Date: Mon, 14 Aug 2023 15:11:35 -0400 Subject: [PATCH 17/41] Update freebsd.yml --- .github/workflows/freebsd.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/freebsd.yml b/.github/workflows/freebsd.yml index b2954d1..36f61fc 100644 --- a/.github/workflows/freebsd.yml +++ b/.github/workflows/freebsd.yml @@ -23,8 +23,6 @@ name: C/C++ CI (FreeBSD) on: push: branches: [ "*" ] - pull_request: - branches: [ "*" ] workflow_dispatch: jobs: From f7b41a9810efe16ca05c6bf73f93bb47f5b10403 Mon Sep 17 00:00:00 2001 From: TheTank20 Date: Mon, 14 Aug 2023 15:11:53 -0400 Subject: [PATCH 18/41] Update linux.yml --- .github/workflows/linux.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 1a78c93..a94794b 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -23,8 +23,6 @@ name: C/C++ CI (Linux) on: push: branches: [ "*" ] - pull_request: - branches: [ "*" ] workflow_dispatch: jobs: From a6bfaed6e89ac4c3a2b0b3c6e907ead50d3a5aaf Mon Sep 17 00:00:00 2001 From: TheTank20 Date: Mon, 14 Aug 2023 15:12:13 -0400 Subject: [PATCH 19/41] Update macos.yml --- .github/workflows/macos.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 505d6fd..d6bfc4b 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -23,8 +23,6 @@ name: C/C++ CI (macOS) on: push: branches: [ "*" ] - pull_request: - branches: [ "*" ] workflow_dispatch: jobs: From 6ae5c9e43552d9d90f201aa94a0fc995bc1d57b4 Mon Sep 17 00:00:00 2001 From: TheTank20 Date: Mon, 14 Aug 2023 15:12:24 -0400 Subject: [PATCH 20/41] Update windows.yml --- .github/workflows/windows.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 2167042..37f8a02 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -23,8 +23,6 @@ name: C/C++ CI (Windows) on: push: branches: [ "*" ] - pull_request: - branches: [ "*" ] workflow_dispatch: jobs: From e3a6b784071c1d681aeb77504b82146737d79bc5 Mon Sep 17 00:00:00 2001 From: TheTank20 Date: Mon, 14 Aug 2023 21:59:25 -0400 Subject: [PATCH 21/41] Update dos-djgpp.yml --- .github/workflows/dos-djgpp.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/dos-djgpp.yml b/.github/workflows/dos-djgpp.yml index 3559c24..f2f6c9f 100644 --- a/.github/workflows/dos-djgpp.yml +++ b/.github/workflows/dos-djgpp.yml @@ -23,6 +23,7 @@ name: C/C++ CI (DOS DJGPP) on: push: branches: [ "*" ] + paths-ignore: [ '**.md', 'doc/**', '.idea/**'] # If only these files are edited, skip workflow_dispatch: env: From 1370a6ecff0edc93167bfd19f959a4ff641b30b9 Mon Sep 17 00:00:00 2001 From: TheTank20 Date: Mon, 14 Aug 2023 22:00:56 -0400 Subject: [PATCH 22/41] Update windows.yml --- .github/workflows/windows.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 37f8a02..b1673de 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -23,6 +23,7 @@ name: C/C++ CI (Windows) on: push: branches: [ "*" ] + paths-ignore: [ '**.md', 'doc/**', '.idea/**'] # If only these files are edited, skip workflow_dispatch: jobs: From 2ee6a99acd0c68efc121aa79a4efd32801bcaff1 Mon Sep 17 00:00:00 2001 From: TheTank20 Date: Mon, 14 Aug 2023 22:00:58 -0400 Subject: [PATCH 23/41] Update macos.yml --- .github/workflows/macos.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index d6bfc4b..34e47c7 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -23,6 +23,7 @@ name: C/C++ CI (macOS) on: push: branches: [ "*" ] + paths-ignore: [ '**.md', 'doc/**', '.idea/**'] # If only these files are edited, skip workflow_dispatch: jobs: From c1eb81490b42fbcac09be0b07ffd5301e4546624 Mon Sep 17 00:00:00 2001 From: TheTank20 Date: Mon, 14 Aug 2023 22:01:01 -0400 Subject: [PATCH 24/41] Update freebsd.yml --- .github/workflows/freebsd.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/freebsd.yml b/.github/workflows/freebsd.yml index 36f61fc..4c0e1e6 100644 --- a/.github/workflows/freebsd.yml +++ b/.github/workflows/freebsd.yml @@ -23,6 +23,7 @@ name: C/C++ CI (FreeBSD) on: push: branches: [ "*" ] + paths-ignore: [ '**.md', 'doc/**', '.idea/**'] # If only these files are edited, skip workflow_dispatch: jobs: From 283df1c1fe31893cdf0d4257556247cef5b3574b Mon Sep 17 00:00:00 2001 From: TheTank20 Date: Mon, 14 Aug 2023 22:01:07 -0400 Subject: [PATCH 25/41] Update linux.yml --- .github/workflows/linux.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index a94794b..fcb5f00 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -23,6 +23,7 @@ name: C/C++ CI (Linux) on: push: branches: [ "*" ] + paths-ignore: [ '**.md', 'doc/**', '.idea/**'] # If only these files are edited, skip workflow_dispatch: jobs: From 52c9a57ea2cbc7e79d2c31c2cc095dc99687a78f Mon Sep 17 00:00:00 2001 From: TheTank20 Date: Mon, 14 Aug 2023 22:16:07 -0400 Subject: [PATCH 26/41] Create test.md --- test.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 test.md diff --git a/test.md b/test.md new file mode 100644 index 0000000..823d2b7 --- /dev/null +++ b/test.md @@ -0,0 +1 @@ +This tests to make sure Actions only executes when needed. Will be deleted after. From b7965f19e85d88d13c75c89f4563dbf08bde51f3 Mon Sep 17 00:00:00 2001 From: TheTank20 Date: Mon, 14 Aug 2023 22:20:59 -0400 Subject: [PATCH 27/41] Delete test.md --- test.md | 1 - 1 file changed, 1 deletion(-) delete mode 100644 test.md diff --git a/test.md b/test.md deleted file mode 100644 index 823d2b7..0000000 --- a/test.md +++ /dev/null @@ -1 +0,0 @@ -This tests to make sure Actions only executes when needed. Will be deleted after. From 361a39e2047b863c06f72280998792b15311b4ed Mon Sep 17 00:00:00 2001 From: TheTank20 Date: Sat, 2 Sep 2023 09:20:54 -0400 Subject: [PATCH 28/41] Fix macOS compilation (Attempt 1) --- CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9c80a12..9031fd9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -45,6 +45,12 @@ else() set(OPENSSL_MSVC_STATIC_RT TRUE) endif() +# macOS does not support static build +if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") + set(OPENSSL_USE_STATIC_LIBS FALSE) + set(OPENSSL_MSVC_STATIC_RT FALSE) +endif() + if(MUSL_STATIC AND NOT UMSKT_USE_SHARED_OPENSSL) set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libgcc -static-libstdc++") set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -static-libgcc -static-libstdc++") From f65533bbb300ab99cef978a3c6e711e71246cb84 Mon Sep 17 00:00:00 2001 From: TheTank20 Date: Sat, 2 Sep 2023 09:24:04 -0400 Subject: [PATCH 29/41] macOS build is not static --- .github/workflows/macos.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 0623445..792dff9 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -56,5 +56,5 @@ jobs: - name: Upload build artifact uses: actions/upload-artifact@v3.1.2 with: - name: UMSKT-macOS-${{ matrix.arch }}-static + name: UMSKT-macOS-${{ matrix.arch }} path: build/actions_upload From d53409f5bd82a1824026589683f501dcb94b4c59 Mon Sep 17 00:00:00 2001 From: TheTank20 Date: Sat, 2 Sep 2023 09:51:35 -0400 Subject: [PATCH 30/41] TEMP -- use -v --- .github/workflows/macos.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 792dff9..239296c 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -40,7 +40,7 @@ jobs: - name: Configure and build UMSKT run: | cd build - cmake -DCMAKE_BUILD_TYPE=Release .. + cmake -v -DCMAKE_BUILD_TYPE=Release .. make - name: Move files to correct directory From a2d521c230aeaf25fe89d8b8c5d9ec25e9c6a8c6 Mon Sep 17 00:00:00 2001 From: TheTank20 Date: Sat, 2 Sep 2023 09:55:20 -0400 Subject: [PATCH 31/41] Update CMakeLists.txt --- CMakeLists.txt | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a031569..48bcae7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -31,6 +31,11 @@ OPTION(MSVC_MSDOS_STUB "Specify a custom MS-DOS stub for a 32-bit MSVC compilati SET(UMSKT_LINK_LIBS ${UMSKT_LINK_LIBS}) SET(UMSKT_LINK_DIRS ${UMSKT_LINK_DIRS}) +# macOS does not support static build +if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") + SET(UMSKT_USE_SHARED_OPENSSL ON) +endif() + IF(UMSKT_USE_SHARED_OPENSSL) SET(OPENSSL_USE_STATIC_LIBS FALSE) SET(OPENSSL_MSVC_STATIC_RT FALSE) @@ -40,11 +45,7 @@ ELSE() SET(OPENSSL_MSVC_STATIC_RT TRUE) ENDIF() -# macOS does not support static build -if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") - set(OPENSSL_USE_STATIC_LIBS FALSE) - set(OPENSSL_MSVC_STATIC_RT FALSE) -endif() + IF(DJGPP_WATT32) SET(CMAKE_SYSTEM_NAME MSDOS) From 974f400cfcb237bea40c00aff2222d0c831bf76c Mon Sep 17 00:00:00 2001 From: TheTank20 Date: Sat, 2 Sep 2023 09:56:36 -0400 Subject: [PATCH 32/41] Revert "TEMP -- use -v" --- .github/workflows/macos.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 239296c..792dff9 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -40,7 +40,7 @@ jobs: - name: Configure and build UMSKT run: | cd build - cmake -v -DCMAKE_BUILD_TYPE=Release .. + cmake -DCMAKE_BUILD_TYPE=Release .. make - name: Move files to correct directory From 4d1b5d6681d9b147320befe51cf6afa20210b982 Mon Sep 17 00:00:00 2001 From: TheTank20 Date: Sat, 2 Sep 2023 11:11:16 -0400 Subject: [PATCH 33/41] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 408fcc3..69700ed 100644 --- a/README.md +++ b/README.md @@ -13,9 +13,9 @@ [![C/C++ CI (Linux)](https://github.com/UMSKT/UMSKT/actions/workflows/linux.yml/badge.svg)](../../actions/workflows/linux.yml) -[![C/C++ CI (FreeBSD)](https://github.com/UMSKT/UMSKT/actions/workflows/freebsd.yml/badge.svg)](../../actions/workflows/dos-djgpp.yml) +[![C/C++ CI (FreeBSD)](https://github.com/UMSKT/UMSKT/actions/workflows/freebsd.yml/badge.svg)](../../actions/workflows/freebsd.yml) -[![C/C++ CI (DOS DJGPP)](https://github.com/UMSKT/UMSKT/actions/workflows/dos-djgpp.yml/badge.svg)](../../actions/workflows/freebsd.yml) +[![C/C++ CI (DOS DJGPP)](https://github.com/UMSKT/UMSKT/actions/workflows/dos-djgpp.yml/badge.svg)](../../actions/workflows/dos-djgpp.yml) ------ From b1743f4bff530a5d77ed047a916d27959e0da4a6 Mon Sep 17 00:00:00 2001 From: TheTank20 Date: Sat, 2 Sep 2023 11:17:52 -0400 Subject: [PATCH 34/41] fix name for FreeBSD --- .github/workflows/freebsd.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/freebsd.yml b/.github/workflows/freebsd.yml index bcc2d23..bc75a3a 100644 --- a/.github/workflows/freebsd.yml +++ b/.github/workflows/freebsd.yml @@ -20,7 +20,7 @@ name: C/C++ CI (FreeBSD) -on: + on: push: branches: [ "*" ] paths-ignore: [ '**.md', 'doc/**', '.idea/**'] # If only these files are edited, skip From 0d016b88727db5a861830f57eb57bf2184131f98 Mon Sep 17 00:00:00 2001 From: TheTank20 Date: Sat, 2 Sep 2023 11:31:25 -0400 Subject: [PATCH 35/41] Update cli.cpp --- src/cli.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/cli.cpp b/src/cli.cpp index 80fe38f..b2ce5bb 100644 --- a/src/cli.cpp +++ b/src/cli.cpp @@ -61,6 +61,7 @@ void CLI::showHelp(char *argv[]) { fmt::print("\t-s --serial\tspecifies a serial to use in the product ID (defaults to random, BINK1998 only)\n"); fmt::print("\t-u --upgrade\tspecifies the Product Key will be an \"Upgrade\" version\n"); fmt::print("\t-V --validate\tproduct key to validate signature\n"); + fmt::print("\t-N --nonewline\tdisables newlines (for easier embedding in other apps)\n"); fmt::print("\n"); } From 09842ace12a6af26b5a3b9f415231ec8aec7ada9 Mon Sep 17 00:00:00 2001 From: TheTank20 Date: Sat, 2 Sep 2023 11:37:38 -0400 Subject: [PATCH 36/41] Update cli.h --- src/cli.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/cli.h b/src/cli.h index 43b329d..0c80bf7 100644 --- a/src/cli.h +++ b/src/cli.h @@ -67,6 +67,7 @@ struct Options { bool help; bool error; bool list; + bool nonewlines; MODE applicationMode; ACTIVATION_ALGORITHM activationMode; From 21bac3b66c9230df0411231917585383b93e8573 Mon Sep 17 00:00:00 2001 From: TheTank20 Date: Sat, 2 Sep 2023 11:37:41 -0400 Subject: [PATCH 37/41] Update cli.cpp --- src/cli.cpp | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/src/cli.cpp b/src/cli.cpp index b2ce5bb..63ac32e 100644 --- a/src/cli.cpp +++ b/src/cli.cpp @@ -82,13 +82,13 @@ int CLI::parseCommandLine(int argc, char* argv[], Options* options) { false, false, false, + false, MODE_BINK1998_GENERATE, WINDOWS }; for (int i = 1; i < argc; i++) { std::string arg = argv[i]; - if (arg == "-v" || arg == "--verbose") { options->verbose = true; UMSKT::setDebugOutput(stderr); @@ -194,7 +194,10 @@ int CLI::parseCommandLine(int argc, char* argv[], Options* options) { options->keyToCheck = argv[i+1]; options->applicationMode = MODE_BINK1998_VALIDATE; i++; - } else { + + } else if (arg == "-N" || arg == "--nonewline") { + options->nonewlines = true; + } else { options->error = true; } } @@ -447,10 +450,9 @@ int CLI::BINK1998Generate() { if (this->options.verbose) { fmt::print("\nSuccess count: {}/{}", this->count, this->total); } -#ifndef _WIN32 - fmt::print("\n"); -#endif - + if (this->options.nonewline == false) { + fmt::print("\n"); + } return 0; } @@ -496,9 +498,9 @@ int CLI::BINK2002Generate() { if (this->options.verbose) { fmt::print("\nSuccess count: {}/{}", this->count, this->total); } -#ifndef _WIN32 - fmt::print("\n"); -#endif + if (this->options.nonewline == false) { + fmt::print("\n"); + } return 0; } @@ -572,9 +574,9 @@ int CLI::ConfirmationID() { case SUCCESS: fmt::print(confirmation_id); -#ifndef _WIN32 - fmt::print("\n"); -#endif + if (this->options.nonewline == false) { + fmt::print("\n"); + } return 0; default: From 12e511b3a5817c03721fccf2ff4ae0df3893f066 Mon Sep 17 00:00:00 2001 From: TheTank20 Date: Sat, 2 Sep 2023 11:39:22 -0400 Subject: [PATCH 38/41] Update cli.cpp --- src/cli.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/cli.cpp b/src/cli.cpp index 63ac32e..8a7825d 100644 --- a/src/cli.cpp +++ b/src/cli.cpp @@ -61,7 +61,7 @@ void CLI::showHelp(char *argv[]) { fmt::print("\t-s --serial\tspecifies a serial to use in the product ID (defaults to random, BINK1998 only)\n"); fmt::print("\t-u --upgrade\tspecifies the Product Key will be an \"Upgrade\" version\n"); fmt::print("\t-V --validate\tproduct key to validate signature\n"); - fmt::print("\t-N --nonewline\tdisables newlines (for easier embedding in other apps)\n"); + fmt::print("\t-N --nonewlines\tdisables newlines (for easier embedding in other apps)\n"); fmt::print("\n"); } @@ -450,7 +450,7 @@ int CLI::BINK1998Generate() { if (this->options.verbose) { fmt::print("\nSuccess count: {}/{}", this->count, this->total); } - if (this->options.nonewline == false) { + if (this->options.nonewlines == false) { fmt::print("\n"); } return 0; @@ -498,7 +498,7 @@ int CLI::BINK2002Generate() { if (this->options.verbose) { fmt::print("\nSuccess count: {}/{}", this->count, this->total); } - if (this->options.nonewline == false) { + if (this->options.nonewlines == false) { fmt::print("\n"); } @@ -574,7 +574,7 @@ int CLI::ConfirmationID() { case SUCCESS: fmt::print(confirmation_id); - if (this->options.nonewline == false) { + if (this->options.nonewlines == false) { fmt::print("\n"); } return 0; From 3ae078e3c56e6f3b94e0df04892e9d48870d41dc Mon Sep 17 00:00:00 2001 From: TheTank20 Date: Sat, 2 Sep 2023 11:53:09 -0400 Subject: [PATCH 39/41] update arg from nonewline to nonewlines --- src/cli.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cli.cpp b/src/cli.cpp index 8a7825d..56dbf8e 100644 --- a/src/cli.cpp +++ b/src/cli.cpp @@ -195,7 +195,7 @@ int CLI::parseCommandLine(int argc, char* argv[], Options* options) { options->applicationMode = MODE_BINK1998_VALIDATE; i++; - } else if (arg == "-N" || arg == "--nonewline") { + } else if (arg == "-N" || arg == "--nonewlines") { options->nonewlines = true; } else { options->error = true; From 178c9e068924120945d57befdf72da905272758a Mon Sep 17 00:00:00 2001 From: TheTank20 Date: Sat, 2 Sep 2023 13:43:03 -0400 Subject: [PATCH 40/41] Fix DOS compilation (Attempt 1) --- CMakeLists.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 48bcae7..bbac7cf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -36,6 +36,11 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") SET(UMSKT_USE_SHARED_OPENSSL ON) endif() +# neither does dos idk i'm trying random stuff +if (DJGPP_WATT32) { + SET(UMSKT_USE_SHARED_OPENSSL ON) +endif() + IF(UMSKT_USE_SHARED_OPENSSL) SET(OPENSSL_USE_STATIC_LIBS FALSE) SET(OPENSSL_MSVC_STATIC_RT FALSE) @@ -80,6 +85,11 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") MESSAGE(STATUS "[UMSKT] macOS has no static library - Shared library forced on") endif() +if (DJGPP_WATT32) { + SET(BUILD_SHARED_LIBS ON) + MESSAGE(STATUS "[UMSKT] DOS has no static library - Shared library forced on") +endif() + # if we're compiling with MSVC, respect the DEBUG compile option IF(MSVC) SET(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") From 49fefca596dcada8395c3b727372f1145180e404 Mon Sep 17 00:00:00 2001 From: TheTank20 Date: Sat, 2 Sep 2023 13:44:35 -0400 Subject: [PATCH 41/41] Fix DOS compilation (Attempt 2) --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index bbac7cf..ecff099 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -37,7 +37,7 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") endif() # neither does dos idk i'm trying random stuff -if (DJGPP_WATT32) { +if (DJGPP_WATT32) SET(UMSKT_USE_SHARED_OPENSSL ON) endif() @@ -85,7 +85,7 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") MESSAGE(STATUS "[UMSKT] macOS has no static library - Shared library forced on") endif() -if (DJGPP_WATT32) { +if (DJGPP_WATT32) SET(BUILD_SHARED_LIBS ON) MESSAGE(STATUS "[UMSKT] DOS has no static library - Shared library forced on") endif()