Skip to content

Commit

Permalink
-Remove PLATFORM_WORD_SIZE configuration
Browse files Browse the repository at this point in the history
-Add detection for CMAKE_GENERATOR and CMAKE_CL_64 (working for x86 and x86_64 windows builds using Visual Studio)
  • Loading branch information
JaLooNz committed Jun 14, 2024
1 parent df80798 commit f749eed
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ project(libecc)
include_directories(include)

# Define options
option(PLATFORM_WORD_SIZE "Platform word size (16, 32 or 64)" "32")
option(PLATFORM_INCLUDE_STDLIB "Platform provides STDLIB" ON)
option(OPTION_SPECIFY_CONFIG "Customise libecc configuration" ON)
option(OPTION_BUILD_SELF_TEST "Build libecc ec-self-tests" ON)
Expand Down Expand Up @@ -292,11 +291,16 @@ if (OPTION_SPECIFY_CONFIG)
add_definitions(-DWITH_X448)
endif(OPTION_SUPPORT_ECDH_X448)
endif(OPTION_SPECIFY_CONFIG)
include(CheckCXXSourceCompiles)

if (NOT (PLATFORM_WORD_SIZE STREQUAL "16" OR PLATFORM_WORD_SIZE STREQUAL "32" OR PLATFORM_WORD_SIZE STREQUAL "64"))
set(PLATFORM_WORD_SIZE "32")
if (CMAKE_GENERATOR MATCHES "Visual Studio")
if(CMAKE_CL_64)
add_definitions(-D__x86_64__)
else()
add_definitions(-D__i386__)
endif()
endif()
add_definitions(-DWORDSIZE=${PLATFORM_WORD_SIZE})

if (PLATFORM_INCLUDE_STDLIB)
add_definitions(-DWITH_STDLIB)
endif()
Expand Down

0 comments on commit f749eed

Please sign in to comment.