diff --git a/.travis.yml b/.travis.yml index eaede15..1576e16 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,19 +3,18 @@ branches: only: - master - /^v\d+\.\d+(\.\d+)?(-\S*)?$/ -sudo: required os: linux -dist: bionic +dist: focal -matrix: +jobs: include: - addons: apt: sources: - - sourceline: 'deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-10 main' + - sourceline: 'deb http://apt.llvm.org/focal/ llvm-toolchain-focal-10 main' key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key' packages: - - llvm-10 + - llvm-10-dev - clang-10 - lld-10 - libc++-10-dev @@ -30,10 +29,10 @@ matrix: - addons: apt: sources: - - sourceline: 'deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-10 main' + - sourceline: 'deb http://apt.llvm.org/focal/ llvm-toolchain-focal-10 main' key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key' packages: - - llvm-10 + - llvm-10-dev - clang-10 - lld-10 - libc++-10-dev @@ -103,7 +102,7 @@ before_deploy: - travis/package.sh deploy: - provider: releases - api_key: + token: secure: uGexzy3F5r3zVR/8lAOHVnwIhQ2VsV0Dx2sZgztmmK4YGWt1th5FH8iOWRc5LK8liufiz9pmfQov4TsCYTFFsi3j5zBdkWc0J+VoBWmy81Ua/CfKKaDQd/ynzaQ9w1+11/5sBciXEf3mekbTs2PNnoewwBIKLGcHHCrMSy6LexIpKh5IzXarwt1YUpVQsMpoEJ+wi8TNrN7d0hNO0uV/l6yPyEJ5vSmfEiq1mdKr/GlleBwSNncY2bV6hfoSedis+PO39mTDqQF4i3tGXPhtl0Ky6byUTzVXogpvQt05g9DMqM567U+Q1UJJuOdM1EN9cJDgufLifUQojFAdt8OH34thydKL2+WI4DTwpHw3yr4mVzHPyqWX+Pk3u19QTYTOtePKpkDE7OuHIstv9u0IXDKB7aYkuz2sO4ThrKV4TEBEW4GWVs8BuIaW43fh6NROMW1X+6Q8azZG5ab63dN7zvUkbgsuEDlAkIfMtVO0QqdSvEfE9HZSFSJlzenmZ4O/MM48PTbMAJBKdqruRiH5VB8Y5qwri7oUaxZ9cfTIB6rveAFKQcOXfhjTZXxiMOOoTROloZaQQJW7CEb44OurJpdkUr/RO23/+hWNlA3cJ3pyDQLON2JEerFschFxw3X5YLiwBMuNzBYYa5p6zqFdul4jEBRWh4qnFZvf5sU/Rxk= file: upload/spmod-$TRAVIS_OS_NAME-$TRAVIS_TAG-$CC$CC_VERSION-$LINK_TYPE.tar.xz skip_cleanup: true @@ -114,7 +113,7 @@ deploy: branch: /^v\d+\.\d+(\.\d+)?(-\S*)?$/ condition: $CLANG_VERSION = 10 || $GCC_VERSION = 10 - provider: s3 - local-dir: upload/s3 + local_dir: upload/s3 access_key_id: secure: g5eMcCQxblr3kXOtnGeAn/HWVLlRilOjU2+DsO/q0pcnkE6mqRQvXRhWt+fHV1YqBXV1JCdzTlGqv48Mt1X0LQMQYn+Gf1WomutQOcdrT9myWXqLLiXTNqqfoq+yBYLbtHDzwzamYu9iAKD5QY8XwcR2k3r4ThrVq/8wkIkU6HVRwhc4FV/oETtSe0E1SyYsMDmJqLg72TXmZdujmiCp34qjQKxOMFxMykoj9O2FcDmv0CMzOjZap8p9H2ove3U+mI+VUeQ9r1eo72tLtLS6ossH94MI9oBJ8NnONo1nnkskL4/GGqEqGnjcuvH3dSQHhpjqLoDOdJKodWFbPBvsjkpOeSmJmhl3rljMM6Jz0s65gkv8ilNVoGUIahvso+vMV3SMKsqjlCBacIBimar9q6BIouXIioHgnafbKJeqFP/aX7TD1mGJl7j3BFKHKXuBln0etlHfvFy7DR00SRBG8DGjRVKEJTwNc75ma5DQuTbSkf+8Tn12mQA+Ei8GGt68J2/ZERjERlszcphPm+E6X+x8x5wPIwJG58kuxzMGnglaV81LceX8gAkRo4pmM5jkIOjXjPRXw77b0DA9ZSQCzGL2LNi0IDk6kN8Z6VRnaflTFGHcbE0d5vGK0jrFls2IJ/EmCfnt1GRV0+10w9/HP+x642Ud4uXWskzE/QhcuKY= secret_access_key: diff --git a/CMakeLists.txt b/CMakeLists.txt index 565a2d6..aaf47f0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -39,7 +39,6 @@ else() endif() endif() -file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/third_party) if (UNIX) if (LLVM_BUILD) include(cmake/BuildYAMLClang.cmake) diff --git a/appveyor.yml b/appveyor.yml index 68ac19d..bd8b5d2 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -15,8 +15,8 @@ environment: - LINK_TYPE: dynamic - LINK_TYPE: static install: - - call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars32.bat" - set PATH=C:\Python38-x64;C:\Python38-x64\Scripts;%PATH% + - python -m pip install --upgrade pip - git submodule update --init --recursive build_script: - pwsh: appveyor\build.ps1 diff --git a/cmake/BuildSPVM.cmake b/cmake/BuildSPVM.cmake index cb91f83..f21a2dc 100644 --- a/cmake/BuildSPVM.cmake +++ b/cmake/BuildSPVM.cmake @@ -13,13 +13,30 @@ else() set(SPVM_DYNAMIC_LINK "") endif() -if (UNIX) +if(UNIX AND LLVM_BUILD) + ExternalProject_Add(spvm-project + GIT_REPOSITORY https://github.com/alliedmodders/sourcepawn.git + GIT_TAG d7d94319a58e7d800a5e095000efe8ba64bd6c86 + GIT_PROGRESS ON + SOURCE_DIR ${SPVM_SOURCE_DIR} + BINARY_DIR ${SPVM_BINARY_DIR} + DEPENDS ambuild-project + DEPENDS ${LLVM_LIBS} + PATCH_COMMAND ${BASH_EXEC} ${CMAKE_SOURCE_DIR}/patches/spvm_patch.sh ${PATCH_EXEC} ${SPVM_SOURCE_DIR} ${CMAKE_SOURCE_DIR} + COMMAND sed -i "s||${LLD}|g" ${SPVM_SOURCE_DIR}/AMBuildScript + COMMAND sed -i "s||${LLVM_LIBS_DIR}|g" ${SPVM_SOURCE_DIR}/AMBuildScript + CONFIGURE_COMMAND CC=${CMAKE_C_COMPILER} CXX=${CMAKE_CXX_COMPILER} ${Python3_EXECUTABLE} ${SPVM_SOURCE_DIR}/configure.py --enable-optimize --build=core --targets=x86 ${SPVM_DYNAMIC_LINK} + BUILD_COMMAND ${AMBUILD_EXEC} + INSTALL_COMMAND "" + ) +elseif(UNIX) ExternalProject_Add(spvm-project GIT_REPOSITORY https://github.com/alliedmodders/sourcepawn.git GIT_TAG d7d94319a58e7d800a5e095000efe8ba64bd6c86 GIT_PROGRESS ON SOURCE_DIR ${SPVM_SOURCE_DIR} BINARY_DIR ${SPVM_BINARY_DIR} + DEPENDS ambuild-project PATCH_COMMAND ${BASH_EXEC} ${CMAKE_SOURCE_DIR}/patches/spvm_patch.sh ${PATCH_EXEC} ${SPVM_SOURCE_DIR} ${CMAKE_SOURCE_DIR} COMMAND sed -i "s||${LLD}|g" ${SPVM_SOURCE_DIR}/AMBuildScript COMMAND sed -i "s||${LLVM_LIBS_DIR}|g" ${SPVM_SOURCE_DIR}/AMBuildScript @@ -28,10 +45,50 @@ if (UNIX) INSTALL_COMMAND "" ) else() -endif() - -if (LLVM_BUILD) - add_dependencies(spvm-project ${LLVM_LIBS}) -endif() + set(WIN_THIRD_PARTY ${CMAKE_BINARY_DIR}/third_party_win_deps) + set(SHA256_ZIP b9e07417ca08becada20f08e923021a80a9fb09f86d2f4ae48a4f8d275d578d3) + if (NOT EXISTS ${WIN_THIRD_PARTY}) + file(MAKE_DIRECTORY ${WIN_THIRD_PARTY}) + endif() + find_program(PWSH_EXEC + pwsh + REQUIRED) + function(downloadPatchZip) + execute_process(COMMAND + ${PWSH_EXEC} -command "Invoke-WebRequest -Method Get -Uri 'https://spmod.eu/build-deps/patch-2.7.6.zip' -OutFile 'patch.zip'" + WORKING_DIRECTORY ${WIN_THIRD_PARTY}) + file(SHA256 ${WIN_THIRD_PARTY}/patch.zip SHA256_ZIP_DOWNLOADED) + if (NOT ${SHA256_ZIP} EQUAL ${SHA256_ZIP_DOWNLOADED} AND DEFINED ALREADY_CONFIGURED_SPVM) + message(FATAL_ERROR "Checksums are not equal (patch utility for windows)") + endif() + endfunction() -add_dependencies(spvm-project ambuild-project) \ No newline at end of file + if (NOT EXISTS ${WIN_THIRD_PARTY}/patch) + if (NOT EXISTS ${WIN_THIRD_PARTY}/patch.zip) + message(VERBOSE "Patch archive not found. Downloading...") + downloadPatchZip() + endif() + execute_process(COMMAND + ${PWSH_EXEC} -command "Expand-Archive -Force 'patch.zip' '.'" + WORKING_DIRECTORY ${WIN_THIRD_PARTY}) + endif() + find_program(PATCH_EXEC + patch + PATHS ${WIN_THIRD_PARTY} + REQUIRED + ) + ExternalProject_Add(spvm-project + GIT_REPOSITORY https://github.com/alliedmodders/sourcepawn.git + GIT_TAG d7d94319a58e7d800a5e095000efe8ba64bd6c86 + GIT_PROGRESS ON + SOURCE_DIR ${SPVM_SOURCE_DIR} + BINARY_DIR ${SPVM_BINARY_DIR} + DEPENDS ambuild-project + PATCH_COMMAND ${PATCH_EXEC} --verbose ${SPVM_SOURCE_DIR}/AMBuildScript ${CMAKE_SOURCE_DIR}/patches/AMBuildScript.patch + COMMAND ${PATCH_EXEC} --verbose ${SPVM_SOURCE_DIR}/configure.py ${CMAKE_SOURCE_DIR}/patches/configurepy.patch + CONFIGURE_COMMAND ${Python3_EXECUTABLE} ${SPVM_SOURCE_DIR}/configure.py --enable-optimize --build=core --targets=x86 ${SPVM_DYNAMIC_LINK} + BUILD_COMMAND ${AMBUILD_EXEC} + INSTALL_COMMAND "" + ) + set(ALREADY_CONFIGURED_SPVM ON) +endif() \ No newline at end of file diff --git a/cmake/BuildYAMLClang.cmake b/cmake/BuildYAMLClang.cmake index abda93f..bc0c20a 100644 --- a/cmake/BuildYAMLClang.cmake +++ b/cmake/BuildYAMLClang.cmake @@ -6,6 +6,7 @@ FetchContent_Declare( yaml-cpp-project GIT_REPOSITORY https://github.com/jbeder/yaml-cpp.git GIT_TAG yaml-cpp-0.6.3 + GIT_SHALLOW ON ) set(YAML_CPP_BUILD_TESTS OFF CACHE INTERNAL "") diff --git a/cmake/BuildYAMLGCC.cmake b/cmake/BuildYAMLGCC.cmake index 3dbb2b4..e6cd84d 100644 --- a/cmake/BuildYAMLGCC.cmake +++ b/cmake/BuildYAMLGCC.cmake @@ -6,6 +6,7 @@ FetchContent_Declare( yaml-cpp-project GIT_REPOSITORY https://github.com/jbeder/yaml-cpp.git GIT_TAG yaml-cpp-0.6.3 + GIT_SHALLOW ON ) set(YAML_CPP_BUILD_TESTS OFF CACHE INTERNAL "") diff --git a/cmake/BuildYAMLMSVC.cmake b/cmake/BuildYAMLMSVC.cmake index a69d21e..c4a733a 100644 --- a/cmake/BuildYAMLMSVC.cmake +++ b/cmake/BuildYAMLMSVC.cmake @@ -1,41 +1,23 @@ include_guard(GLOBAL) # Building YAML -include(ExternalProject) +include(FetchContent) +FetchContent_Declare( + yaml-cpp-project + GIT_REPOSITORY https://github.com/jbeder/yaml-cpp.git + GIT_TAG yaml-cpp-0.6.3 + GIT_SHALLOW ON +) -ExternalProject_Add(yaml-cpp-project - GIT_REPOSITORY https://github.com/jbeder/yaml-cpp.git - GIT_TAG yaml-cpp-0.6.3 - GIT_SHALLOW ON - GIT_PROGRESS ON - SOURCE_DIR "${CMAKE_BINARY_DIR}/yaml-cpp-src" - BINARY_DIR "${CMAKE_BINARY_DIR}/yaml-cpp-build" - INSTALL_DIR "${CMAKE_BINARY_DIR}/install" - CMAKE_ARGS - -DCMAKE_INSTALL_PREFIX= - -DCMAKE_CXX_EXTENSIONS=OFF - -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} - -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} - -DYAML_BUILD_SHARED_LIBS=${BUILD_DYNAMIC} - -DYAML_MSVC_SHARED_RT=${BUILD_DYNAMIC} - -DYAML_CPP_BUILD_CONTRIB=OFF - -DYAML_CPP_BUILD_TESTS=OFF - -DYAML_CPP_BUILD_TOOLS=OFF - ) +set(YAML_CPP_BUILD_TESTS OFF CACHE INTERNAL "") +set(YAML_CPP_BUILD_TOOLS OFF CACHE INTERNAL "") +set(YAML_CPP_BUILD_CONTRIB OFF CACHE INTERNAL "") +set(YAML_BUILD_SHARED_LIBS ${BUILD_DYNAMIC} CACHE INTERNAL "") +set(YAML_MSVC_SHARED_RT ${BUILD_DYNAMIC} CACHE INTERNAL "") +FetchContent_MakeAvailable(yaml-cpp-project) -ExternalProject_Get_Property(yaml-cpp-project INSTALL_DIR) - -if (BUILD_DYNAMIC) - add_library(yaml-cpp SHARED IMPORTED GLOBAL) - set_target_properties(yaml-cpp - PROPERTIES - IMPORTED_LOCATION ${INSTALL_DIR}/bin/libyaml-cpp.dll - IMPORTED_IMPLIB ${INSTALL_DIR}/lib/yaml-cpp.lib - ) -else() - add_library(yaml-cpp STATIC IMPORTED GLOBAL) - set_target_properties(yaml-cpp PROPERTIES IMPORTED_LOCATION ${INSTALL_DIR}/lib/libyaml-cppmt.lib) -endif() - -set(YAML_CPP_INCLUDE_DIR "${INSTALL_DIR}/include") +set(YAML_CPP_INCLUDE_DIR "${yaml-cpp-project_SOURCE_DIR}/include") set(YAML_CPP_LIBRARIES "yaml-cpp") +if (WIN32) + target_compile_definitions(${YAML_CPP_LIBRARIES} PRIVATE /wd4251 /wd4275) +endif() \ No newline at end of file diff --git a/cmake/InstallAMBuild.cmake b/cmake/InstallAMBuild.cmake index 41f75c6..496c785 100644 --- a/cmake/InstallAMBuild.cmake +++ b/cmake/InstallAMBuild.cmake @@ -10,15 +10,29 @@ find_package(Python3 REQUIRED COMPONENTS Interpreter) message(STATUS "Installing AMBuild") set(AMBUILD_SOURCE_DIR "${CMAKE_BINARY_DIR}/ambuild-project-src") include(ExternalProject) -ExternalProject_Add(ambuild-project - GIT_REPOSITORY https://github.com/alliedmodders/ambuild.git - GIT_TAG 2.2 - GIT_SHALLOW ON - GIT_PROGRESS ON - SOURCE_DIR ${AMBUILD_SOURCE_DIR} - CONFIGURE_COMMAND "" - PATCH_COMMAND ${BASH_EXEC} ${CMAKE_SOURCE_DIR}/patches/ambuild_patch.sh ${PATCH_EXEC} ${AMBUILD_SOURCE_DIR} ${CMAKE_SOURCE_DIR} - BUILD_COMMAND ${Python3_EXECUTABLE} -m pip install ${AMBUILD_SOURCE_DIR} --user --force-reinstall - INSTALL_COMMAND "" - ) -set(AMBUILD_EXEC "$ENV{HOME}/.local/bin/ambuild") \ No newline at end of file +if(UNIX) + ExternalProject_Add(ambuild-project + GIT_REPOSITORY https://github.com/alliedmodders/ambuild.git + GIT_TAG 2.2 + GIT_SHALLOW ON + GIT_PROGRESS ON + SOURCE_DIR ${AMBUILD_SOURCE_DIR} + CONFIGURE_COMMAND "" + PATCH_COMMAND ${BASH_EXEC} ${CMAKE_SOURCE_DIR}/patches/ambuild_patch.sh ${PATCH_EXEC} ${AMBUILD_SOURCE_DIR} ${CMAKE_SOURCE_DIR} + BUILD_COMMAND ${Python3_EXECUTABLE} -m pip install ${AMBUILD_SOURCE_DIR} --user --force-reinstall + INSTALL_COMMAND "" + ) + set(AMBUILD_EXEC "$ENV{HOME}/.local/bin/ambuild") +else() + ExternalProject_Add(ambuild-project + GIT_REPOSITORY https://github.com/alliedmodders/ambuild.git + GIT_TAG 2.2 + GIT_SHALLOW ON + GIT_PROGRESS ON + SOURCE_DIR ${AMBUILD_SOURCE_DIR} + CONFIGURE_COMMAND "" + BUILD_COMMAND ${Python3_EXECUTABLE} -m pip install ${AMBUILD_SOURCE_DIR} --force-reinstall + INSTALL_COMMAND "" + ) + set(AMBUILD_EXEC "ambuild") +endif() \ No newline at end of file diff --git a/patches/AMBuildScript.patch b/patches/AMBuildScript.patch index cba9c9c..f443b49 100644 --- a/patches/AMBuildScript.patch +++ b/patches/AMBuildScript.patch @@ -1,5 +1,5 @@ --- AMBuildScript 2020-09-10 01:36:16.602652000 +0200 -+++ AMBuildScript-libc++ 2020-09-10 01:35:20.336178674 +0200 ++++ AMBuildScript-custom 2020-10-23 23:44:32.293952775 +0200 @@ -97,8 +97,10 @@ '-Wno-overloaded-virtual', ] @@ -13,7 +13,26 @@ cxx.postlink += ['-lm'] -@@ -183,6 +185,19 @@ +@@ -115,10 +117,16 @@ + cxx.defines += ['__linux__'] + elif cxx.like('msvc'): + if builder.options.debug == '1': +- cxx.cflags += ['/MTd'] ++ if getattr(builder.options, 'dynamic', False): ++ cxx.cflags += ['/MDd'] ++ else: ++ cxx.cflags += ['/MTd'] + cxx.linkflags += ['/NODEFAULTLIB:libcmt'] + else: +- cxx.cflags += ['/MT'] ++ if getattr(builder.options, 'dynamic', False): ++ cxx.cflags += ['/MD'] ++ else: ++ cxx.cflags += ['/MT'] + cxx.defines += [ + '_CRT_SECURE_NO_DEPRECATE', + '_CRT_SECURE_NO_WARNINGS', +@@ -183,6 +191,19 @@ # Platform-specifics if not cxx.like('emscripten'): if cxx.target.platform == 'linux': diff --git a/patches/spvm_patch.sh b/patches/spvm_patch.sh index f16e531..3fa88f5 100755 --- a/patches/spvm_patch.sh +++ b/patches/spvm_patch.sh @@ -4,7 +4,7 @@ PATCH_EXEC=${1} SPVM_SOURCE_DIR=${2} CMAKE_SOURCE_DIR=${3} -${PATCH_EXEC} -Ns --verbose -d ${SPVM_SOURCE_DIR} < ${CMAKE_SOURCE_DIR}/patches/AMBuildScript.patch || true -${PATCH_EXEC} -Ns --verbose -d ${SPVM_SOURCE_DIR} < ${CMAKE_SOURCE_DIR}/patches/configurepy.patch || true -${PATCH_EXEC} -Ns --verbose -d ${SPVM_SOURCE_DIR}/vm < ${CMAKE_SOURCE_DIR}/patches/AMBuilder_VM_fPIC.patch || true -${PATCH_EXEC} -Ns --verbose -d ${SPVM_SOURCE_DIR}/third_party/zlib < ${CMAKE_SOURCE_DIR}/patches/AMBuilder_zlib_fPIC.patch || true +${PATCH_EXEC} -N --verbose -d ${SPVM_SOURCE_DIR} < ${CMAKE_SOURCE_DIR}/patches/AMBuildScript.patch || true +${PATCH_EXEC} -N --verbose -d ${SPVM_SOURCE_DIR} < ${CMAKE_SOURCE_DIR}/patches/configurepy.patch || true +${PATCH_EXEC} -N --verbose -d ${SPVM_SOURCE_DIR}/vm < ${CMAKE_SOURCE_DIR}/patches/AMBuilder_VM_fPIC.patch || true +${PATCH_EXEC} -N --verbose -d ${SPVM_SOURCE_DIR}/third_party/zlib < ${CMAKE_SOURCE_DIR}/patches/AMBuilder_zlib_fPIC.patch || true diff --git a/src/PlayerSystem.cpp b/src/PlayerSystem.cpp index 86f8991..22f203a 100644 --- a/src/PlayerSystem.cpp +++ b/src/PlayerSystem.cpp @@ -144,7 +144,7 @@ bool Player::isInGame() const IBasePlayer *Player::basePlayer() const { - if (gSPGlobal->getModName() == ModType::Valve) + if (gSPGlobal->getModType() == ModType::Valve) { return m_basePlayer; } diff --git a/src/SPGlobal.cpp b/src/SPGlobal.cpp index 8c83493..5499113 100644 --- a/src/SPGlobal.cpp +++ b/src/SPGlobal.cpp @@ -249,6 +249,11 @@ MenuMngr *SPGlobal::getMenuManager() const return m_menuManager.get(); } +MessageMngr *SPGlobal::getMessageManager() const +{ + return m_messageManager.get(); +} + LoggerMngr *SPGlobal::getLoggerManager() const { return m_loggingSystem.get(); diff --git a/src/engine/Edict.cpp b/src/engine/Edict.cpp index ad66510..ae68c15 100644 --- a/src/engine/Edict.cpp +++ b/src/engine/Edict.cpp @@ -44,7 +44,7 @@ namespace SPMod::Engine IBaseEntity *Edict::getBaseEntity() { - switch (gSPGlobal->getModName()) + switch (gSPGlobal->getModType()) { case ModType::Valve: return getEntity(); @@ -55,7 +55,7 @@ namespace SPMod::Engine IBasePlayer *Edict::getBasePlayer() { - switch (gSPGlobal->getModName()) + switch (gSPGlobal->getModType()) { case ModType::Valve: return getEntity(); diff --git a/src/spmod.hpp b/src/spmod.hpp index 2b76e39..c4c89d3 100644 --- a/src/spmod.hpp +++ b/src/spmod.hpp @@ -25,11 +25,9 @@ #if defined SP_MSVC #pragma warning(push) #pragma warning(disable:4100) + #pragma warning(disable:4005) #endif #include -#if defined SP_MSVC - #pragma warning(pop) -#endif #include #include @@ -40,6 +38,10 @@ #include #include +#if defined SP_MSVC + #pragma warning(pop) +#endif + #undef max #undef min diff --git a/subprojects/sourcepawn/CMakeLists.txt b/subprojects/sourcepawn/CMakeLists.txt index ccda112..ca1cf20 100644 --- a/subprojects/sourcepawn/CMakeLists.txt +++ b/subprojects/sourcepawn/CMakeLists.txt @@ -23,6 +23,7 @@ set(SRC_FILES AdapterInterface.cpp VTableNatives.cpp NativeCallback.hpp NativeCallback.cpp) add_library(${PROJECT_NAME} MODULE ${SRC_FILES}) +add_dependencies(${PROJECT_NAME} spvm-project) include(${CMAKE_SOURCE_DIR}/cmake/CompilerSetup.cmake) @@ -52,11 +53,11 @@ ExternalProject_Get_Property(spvm-project BINARY_DIR) # SourcePawn lib install(FILES - ${BINARY_DIR}/vm/sourcepawn.vm/linux-x86/sourcepawn.vm.$,so,dll> + ${BINARY_DIR}/vm/sourcepawn.vm/$,linux-x86,windows-x86>/sourcepawn.vm.$,so,dll> DESTINATION exts ) install(PROGRAMS - ${BINARY_DIR}/compiler/spcomp/linux-x86/spcomp$<$:.exe> + ${BINARY_DIR}/compiler/spcomp/$,linux-x86,windows-x86>/spcomp$<$:.exe> DESTINATION scripting ) diff --git a/subprojects/sourcepawn/ExtMain.hpp b/subprojects/sourcepawn/ExtMain.hpp index 26b2986..6df7172 100644 --- a/subprojects/sourcepawn/ExtMain.hpp +++ b/subprojects/sourcepawn/ExtMain.hpp @@ -25,6 +25,7 @@ #include #include #include +#include #if defined SP_POSIX #include diff --git a/travis/build.sh b/travis/build.sh index 6597872..ae785dc 100755 --- a/travis/build.sh +++ b/travis/build.sh @@ -7,7 +7,7 @@ else BUILD_DYNAMIC="OFF" fi -mkdir -p build -cd build -cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../upload -DBUILD_DYNAMIC=${BUILD_DYNAMIC} .. . +mkdir -p ${TRAVIS_BUILD_DIR}/build +cd ${TRAVIS_BUILD_DIR}/build +cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../upload -DBUILD_DYNAMIC=${BUILD_DYNAMIC} .. make -j 16 install