diff --git a/CMakeLists.txt b/CMakeLists.txt index 5a09801..e19ea85 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -47,7 +47,7 @@ project(ztd.vargs VERSION 0.0.0 DESCRIPTION [[Code to access Variable Arguments ("var args") without the cruft of an inital first parameter.]] HOMEPAGE_URL "https://ztdvargs.readthedocs.io/en/latest/" - LANGUAGES C CXX ASM_MASM ASM) + LANGUAGES C CXX) if(ZTD_VARGS_READTHEDOCS) # ReadTheDocs seems unable to handle the include at the project level: something must be going wrong? @@ -121,7 +121,7 @@ file(GLOB_RECURSE ztd.vargs.sources CONFIGURE_DEPENDS source/*.c source/*.cpp) -set(ztd.vargs.sources.prefix "${CMAKE_CURRENT_SOURCE_DIR}/source/ztd/vargs" +set(ztd.vargs.sources.prefix "${CMAKE_CURRENT_SOURCE_DIR}/source/ztd/vargs") if(WIN32) # CMAKE_SYSTEM_PROCESSOR will be the result of %PROCESSOR_ARCHITEW6432%, # and thus will be one of {AMD64, IA64, ARM64, x86, ARM} @@ -135,18 +135,20 @@ if(WIN32) set(arch_name "arm") endif() - if(MSVC) - message(STATUS "[ztd.vargs] Using VC++ ${arch_name} assembly files") - set(ztd.vargs.sources.asm - "${ztd.vargs.sources.prefix}/windows/${arch_name}.asm") - elseif (GCC OR MINGW) + if(MINGW) message(STATUS "[ztd.vargs] Using mingw ${arch_name} assembly files") - set(ztd.vargs.sources.asm - "${ztd.vargs.sources.prefix}/mingw/${arch_name}.asm") - endif() - - if(NOT EXISTS "${ztd.vargs.sources.asm}") - set(ztd.vargs.sources.asm "") + enable_language(ASM) + file(GLOB_RECURSE ztd.vargs.sources.asm + LIST_DIRECTORIES FALSE + CONFIGURE_DEPENDS + "${ztd.vargs.sources.prefix}/mingw/${arch_name}*.s") + else() + message(STATUS "[ztd.vargs] Using VC++ ${arch_name} assembly files") + enable_language(ASM_MASM) + file(GLOB_RECURSE ztd.vargs.sources.asm + LIST_DIRECTORIES FALSE + CONFIGURE_DEPENDS + "${ztd.vargs.sources.prefix}/windows/${arch_name}*.asm") endif() endif() diff --git a/source/ztd/vargs/mingw/x64.hpp b/source/ztd/vargs/mingw/x64.hpp index e34b34b..ec35186 100644 --- a/source/ztd/vargs/mingw/x64.hpp +++ b/source/ztd/vargs/mingw/x64.hpp @@ -27,8 +27,8 @@ // // ============================================================================> -#ifndef ZTD_VARGS_SOURCE_WINDOWS_GCC_X64_HPP -#define ZTD_VARGS_SOURCE_WINDOWS_GCC_X64_HPP +#ifndef ZTD_VARGS_SOURCE_MINGW_X64_HPP +#define ZTD_VARGS_SOURCE_MINGW_X64_HPP #include @@ -45,4 +45,4 @@ extern "C" void* __ztdc_va_next(ztdc_va_list* __p_vl, size_t __size, size_t __al __ztdc_vargs_detail_broad_type __broad_type) noexcept { } -#endif // ZTD_VARGS_SOURCE_WINDOWS_GCC_X64_HPP +#endif // ZTD_VARGS_SOURCE_MINGW_X64_HPP diff --git a/source/ztd/vargs/va_next.va_start.cpp b/source/ztd/vargs/va_next.va_start.cpp index 4967092..fbea054 100644 --- a/source/ztd/vargs/va_next.va_start.cpp +++ b/source/ztd/vargs/va_next.va_start.cpp @@ -40,7 +40,7 @@ #else #if defined(_M_AMD64) #define ZTD_VARGS_SOURCE_FOUND_PLATFORM_ABI_I_ ZTD_ON - #include "windows/vc++/x64.hpp" + #include "windows/x64.hpp" // #elif defined(_M_IX86) // #elif defined(_M_ARM) // #elif defined(_M_ARM64) diff --git a/source/ztd/vargs/windows/x64.hpp b/source/ztd/vargs/windows/x64.hpp index d80d017..faac4b9 100644 --- a/source/ztd/vargs/windows/x64.hpp +++ b/source/ztd/vargs/windows/x64.hpp @@ -27,8 +27,8 @@ // // ============================================================================> -#ifndef ZTD_VARGS_SOURCE_WINDOWS_VCXX_X64_HPP -#define ZTD_VARGS_SOURCE_WINDOWS_VCXX_X64_HPP +#ifndef ZTD_VARGS_SOURCE_WINDOWS_X64_HPP +#define ZTD_VARGS_SOURCE_WINDOWS_X64_HPP #include @@ -141,4 +141,4 @@ extern "C" void* __ztdc_va_next(ztdc_va_list* __p_vl, size_t __size, size_t __al return __target; } -#endif // ZTD_VARGS_SOURCE_WINDOWS_VCXX_X64_HPP +#endif // ZTD_VARGS_SOURCE_WINDOWS_X64_HPP