From 0a574d5f25cd03a024b54b0faae2c4196bba783a Mon Sep 17 00:00:00 2001 From: Zeex Date: Sat, 11 Aug 2018 20:03:37 +0600 Subject: [PATCH] Remove CTest and add a top-level CMakeLists.txt --- .travis.yml | 6 +++--- CMakeLists.txt | 8 ++++++++ appveyor.yml | 5 +---- source/amx/CMakeLists.txt | 1 + source/compiler/CMakeLists.txt | 8 ++------ 5 files changed, 15 insertions(+), 13 deletions(-) create mode 100644 CMakeLists.txt diff --git a/.travis.yml b/.travis.yml index 2378ac5..4b71685 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,9 +14,9 @@ addons: - cmake before_script: - - cmake source/compiler -DCMAKE_BUILD_TYPE=RelWithDebInfo - -DCMAKE_C_FLAGS="-m32 -Werror -Wno-address-of-packed-member" - -DCPACK_GENERATOR="TGZ;ZIP" + - cmake . -DCMAKE_BUILD_TYPE=RelWithDebInfo + -DCMAKE_C_FLAGS="-m32 -Werror -Wno-address-of-packed-member" + -DCPACK_GENERATOR="TGZ;ZIP" script: - make diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..b386580 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,8 @@ +project(pawn C) +cmake_minimum_required(VERSION 2.8) + +# For the compiler we only utilize headers from source/amx, i.e. we don't +# actually build any of the AMX modules. +# add_subdirectory(source/amx) + +add_subdirectory(source/compiler) diff --git a/appveyor.yml b/appveyor.yml index 78713fb..bf09638 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -5,7 +5,7 @@ configuration: - RelWithDebInfo before_build: - - cmake -G "Visual Studio 14 2015" source/compiler -DCPACK_GENERATOR=ZIP -DCMAKE_GENERATOR_TOOLSET=v100 + - cmake . -G "Visual Studio 14 2015" -DCPACK_GENERATOR=ZIP -DCMAKE_GENERATOR_TOOLSET=v100 build_script: - cmake --build . --config %CONFIGURATION% @@ -14,9 +14,6 @@ build_script: test_script: - cmake --build . --config %CONFIGURATION% --target pawncc_tests -on_failure: - - type Testing\Temporary\LastTest.log - artifacts: - path: pawnc-*-windows.zip name: Binary package diff --git a/source/amx/CMakeLists.txt b/source/amx/CMakeLists.txt index a3bfb0f..bc68454 100644 --- a/source/amx/CMakeLists.txt +++ b/source/amx/CMakeLists.txt @@ -68,6 +68,7 @@ if(WIN32) set_target_properties(amxDGram PROPERTIES LINK_FLAGS "/export:amx_DGramInit /export:amx_DGramCleanup") endif() + target_link_libraries(amxDGram ws2_32) endif() # amxFile diff --git a/source/compiler/CMakeLists.txt b/source/compiler/CMakeLists.txt index 1a2ff83..51cee48 100644 --- a/source/compiler/CMakeLists.txt +++ b/source/compiler/CMakeLists.txt @@ -160,12 +160,8 @@ if(MSVC) DESTINATION bin) endif() -# Generate tests (only if enabled, i.e. BUILD_TESTING=ON) -include(CTest) -if(BUILD_TESTING) - enable_testing() - add_subdirectory(tests) -endif() +# Generate targets for running compiler tests +add_subdirectory(tests) # Generate a binary package with CPack set(CPACK_PACKAGE_NAME pawnc)