Skip to content

Commit 49d2759

Browse files
committed
Build for windows with CMake
NTL provides zip file with some changes to its source code to make Windows happy. However, they don't provide any build system but refer people to some creative clicking in Visual Studio.
1 parent 22efd44 commit 49d2759

File tree

3 files changed

+26
-4
lines changed

3 files changed

+26
-4
lines changed

recipe/build.bat

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
cmake .
2+
msbuild ALL_BUILD.vcxproj

recipe/cmake.patch

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
--- /dev/null 2019-01-16 21:39:07.828957088 +0100
2+
+++ CMakeLists.txt 2019-01-17 03:36:35.265918586 +0100
3+
@@ -0,0 +1,12 @@
4+
+cmake_minimum_required(VERSION 3.6)
5+
+project(NTL)
6+
+
7+
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
8+
+
9+
+file(GLOB SOURCES src/*.cpp)
10+
+include_directories(include)
11+
+add_library(${PROJECT_NAME} SHARED ${SOURCES})
12+
+
13+
+install(TARGETS ${PROJECT_NAME} DESTINATION lib/${PROJECT_NAME})
14+
+file(GLOB HEADERS include/*.h)
15+
+install(FILES ${HEADERS} DESTINATION include/${PROJECT_NAME})

recipe/meta.yaml

+9-4
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,15 @@ package:
77

88
source:
99
fn: {{ name }}-{{ version }}.tar.gz
10-
url: http://www.shoup.net/ntl/ntl-{{ version }}.tar.gz
11-
sha256: 84ba3145abf8d5f3be6832a14c60b3368eb920719ee96e5774587e71ecd66e9d
10+
url: http://www.shoup.net/ntl/ntl-{{ version }}.tar.gz # [not win]
11+
url: https://www.shoup.net/ntl/WinNTL-{{ version }}.zip # [win]
12+
sha256: 84ba3145abf8d5f3be6832a14c60b3368eb920719ee96e5774587e71ecd66e9d # [not win]
13+
sha256: 7488f980ed1b84828f0baea1948233fec328047b27b33a0c3822820f13cc77e2 # [win]
14+
patches:
15+
- cmake.patch # [win]
1216

1317
build:
14-
number: 1000
15-
skip: true # [win]
18+
number: 1002
1619
track_features:
1720
- ntl
1821
run_exports:
@@ -24,6 +27,7 @@ requirements:
2427
- automake
2528
- {{ compiler('c') }}
2629
- {{ compiler('cxx') }}
30+
- cmake # [win]
2731
host:
2832
- gf2x
2933
- gmp
@@ -50,3 +54,4 @@ about:
5054
extra:
5155
recipe-maintainers:
5256
- isuruf
57+
- saraedum

0 commit comments

Comments
 (0)