Skip to content

Commit

Permalink
config: add support for clang-cl
Browse files Browse the repository at this point in the history
  • Loading branch information
Hedede committed Dec 1, 2023
1 parent 2616f7e commit 341f06c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ set(AW_CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/awlib/cmake")

list(APPEND CMAKE_MODULE_PATH ${AW_CMAKE_MODULE_PATH})

if (MSVC)
if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
add_compile_options(
# multicore build by default
"/MP"
Expand Down
9 changes: 5 additions & 4 deletions awlib/include/aw/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,11 @@
(((major) << 0x10000) + ((minor) << 0x100) + (patch))

/**** DEFINITIONS ****/
#define AW_COMPILER_GCC 1
#define AW_COMPILER_CLANG 2
#define AW_COMPILER_MSVC 3
#define AW_COMPILER_UNKNOWN 0
#define AW_COMPILER_GCC 1
#define AW_COMPILER_CLANG 2
#define AW_COMPILER_CLANG_CL 3
#define AW_COMPILER_MSVC 4
#define AW_COMPILER_UNKNOWN 0

#define AW_ARCH_i686 686
#define AW_ARCH_x86_64 8664
Expand Down
4 changes: 4 additions & 0 deletions awlib/include/aw/config/clang.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@
*/
#ifndef aw_compiler_setup_2
#define aw_compiler_setup_2
#ifdef _MSC_VER
#define AW_COMPILER AW_COMPILER_CLANG_CL
#else
#define AW_COMPILER AW_COMPILER_CLANG
#endif
// TODO: apple clang version bullshit
#define AW_CVER_X __clang_major__
#define AW_CVER_Y __clang_minor__
Expand Down

0 comments on commit 341f06c

Please sign in to comment.