emplace 0.1.10 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +7 -1
- data/lib/emplace.rb +6 -3
- data/modules/Emplace.cmake +17 -0
- data/modules/unix/Emplace.cmake +13 -0
- data/modules/win32/Emplace.cmake +14 -0
- data/test/emplace-test.rb +2 -2
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f74a6856d8982edf301a6212c529d95d52d21a14
|
4
|
+
data.tar.gz: 0f3d59b63618dffc8c067510a390d43c03768e0d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a6ed5830a0f40b955c0af05c870590e20e9778aa5f42ebc60b8f838cacb70d3b01be599a7d0d4fd27255edf75394a02e0204304212e455c26ad918719fe764e8
|
7
|
+
data.tar.gz: 88c87d4307828f0fd6dc4ca5462d125620b2899c056bcf1cbf8477cf005eea86903a1355087728a693eeda7cf00e23bd5ec8171d2ea748e24a735bee06b5f6a3
|
data/README.md
CHANGED
@@ -18,7 +18,7 @@ Or install it yourself as:
|
|
18
18
|
|
19
19
|
$ gem install emplace
|
20
20
|
|
21
|
-
## Usage
|
21
|
+
## Rakefile Usage
|
22
22
|
|
23
23
|
require 'emplace'
|
24
24
|
project = Emplace.new 'project-name'
|
@@ -27,6 +27,12 @@ Or install it yourself as:
|
|
27
27
|
project.test!
|
28
28
|
project.package!
|
29
29
|
|
30
|
+
## CMake Macros
|
31
|
+
|
32
|
+
include(Emplace)
|
33
|
+
|
34
|
+
install_symbols(<target> [STATIC] DESTINATION <directory>)
|
35
|
+
|
30
36
|
## Contributing
|
31
37
|
|
32
38
|
1. Fork it
|
data/lib/emplace.rb
CHANGED
@@ -7,6 +7,9 @@ module Emplace
|
|
7
7
|
@name = name
|
8
8
|
@impl = impl
|
9
9
|
end
|
10
|
+
def module_dir
|
11
|
+
File.join(File.dirname(File.dirname(__FILE__)), 'modules')
|
12
|
+
end
|
10
13
|
def build_dir
|
11
14
|
'build'
|
12
15
|
end
|
@@ -22,7 +25,7 @@ module Emplace
|
|
22
25
|
FileUtils.rm_rf vendor_dir
|
23
26
|
end
|
24
27
|
def cmake!
|
25
|
-
@impl.cmake @name, build_dir, dist_dir
|
28
|
+
@impl.cmake @name, module_dir, build_dir, dist_dir
|
26
29
|
end
|
27
30
|
def build!
|
28
31
|
@impl.build build_dir
|
@@ -48,8 +51,8 @@ module Emplace
|
|
48
51
|
end
|
49
52
|
|
50
53
|
class CMakeBuild
|
51
|
-
def cmake(name, build_dir, dist_dir)
|
52
|
-
sh "cmake . -B#{build_dir} -DCMAKE_INSTALL_PREFIX=#{dist_dir}/#{name} -G \"#{cmake_generator}\""
|
54
|
+
def cmake(name, module_dir, build_dir, dist_dir)
|
55
|
+
sh "cmake . -B#{build_dir} -DCMAKE_MODULE_PATH=#{module_dir} -DCMAKE_INSTALL_PREFIX=#{dist_dir}/#{name} -G \"#{cmake_generator}\""
|
53
56
|
end
|
54
57
|
def build(dir)
|
55
58
|
sh "cmake --build #{dir} --target install"
|
@@ -0,0 +1,17 @@
|
|
1
|
+
include(CMakeParseArguments)
|
2
|
+
|
3
|
+
if(UNIX)
|
4
|
+
include(unix/Emplace)
|
5
|
+
elseif(WIN32)
|
6
|
+
include(win32/Emplace)
|
7
|
+
endif()
|
8
|
+
|
9
|
+
macro(install_symbols)
|
10
|
+
cmake_parse_arguments(install_args "STATIC" "DESTINATION" "TARGETS" ${ARGN})
|
11
|
+
|
12
|
+
foreach(target ${install_args_TARGETS})
|
13
|
+
if(${install_args_STATIC} STREQUAL "TRUE")
|
14
|
+
_install_static_lib_symbols(${target} ${install_args_DESTINATION})
|
15
|
+
endif()
|
16
|
+
endforeach()
|
17
|
+
endmacro()
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# Unix global definitions
|
2
|
+
|
3
|
+
set(warning_flags "-Werror=return-type -Wno-unused-local-typedefs")
|
4
|
+
if(APPLE)
|
5
|
+
set(warning_flags "${warning_flags} -Wno-overloaded-virtual")
|
6
|
+
endif()
|
7
|
+
|
8
|
+
set(CMAKE_CXX_FLAGS "-Wall -fPIC -fno-omit-frame-pointer -fno-strict-aliasing -g -O2 ${warning_flags}")
|
9
|
+
set(CMAKE_C_FLAGS "-Wall -fPIC -fno-omit-frame-pointer -fno-strict-aliasing -g -O2 ${warning_flags}")
|
10
|
+
|
11
|
+
macro(_install_static_lib_symbols proj dir)
|
12
|
+
# nothing to do
|
13
|
+
endmacro()
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# Windows MSVC global definitions
|
2
|
+
|
3
|
+
string(REGEX REPLACE "/STACK:[0-9]+" "" CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}")
|
4
|
+
set(CMAKE_CXX_FLAGS_INIT "/DWIN32 /D_WINDOWS /W3 /Zm1000 /EHsc /GR")
|
5
|
+
set(CMAKE_CXX_FLAGS_DEBUG_INIT "/D_DEBUG /MTd /Zi /Ob0 /Od /RTC1")
|
6
|
+
set(CMAKE_C_FLAGS_DEBUG_INIT "/D_DEBUG /MTd /Zi /Ob0 /Od /RTC1")
|
7
|
+
|
8
|
+
macro(_install_static_lib_symbols proj dir)
|
9
|
+
install(
|
10
|
+
FILES "${CMAKE_CURRENT_BINARY_DIR}/$(IntDir)${proj}.pdb"
|
11
|
+
DESTINATION symbols
|
12
|
+
OPTIONAL
|
13
|
+
)
|
14
|
+
endmacro()
|
data/test/emplace-test.rb
CHANGED
@@ -65,7 +65,7 @@ class TestEmplace < Test::Unit::TestCase
|
|
65
65
|
|
66
66
|
travis = Travis.new
|
67
67
|
project = Emplace::Project.new 'foo', travis
|
68
|
-
project.fetch!
|
68
|
+
project.fetch! "file://#{FileUtils.pwd}/url_source_dir"
|
69
69
|
|
70
70
|
assert_equal 'foo', File.read('vendor/foo-linux-x86_64-cc.tgz')
|
71
71
|
ensure
|
@@ -81,7 +81,7 @@ class TestEmplace < Test::Unit::TestCase
|
|
81
81
|
|
82
82
|
appveyor = AppVeyor.new
|
83
83
|
project = Emplace::Project.new 'foo', appveyor
|
84
|
-
project.fetch!
|
84
|
+
project.fetch! "file://#{FileUtils.pwd}/url_source_dir"
|
85
85
|
|
86
86
|
assert_equal 'foo', File.read('vendor/foo-win-x64-msvc-cfg.zip')
|
87
87
|
ensure
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: emplace
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Calhoun
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-03-12 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Keeps settings for running cmake builds on Travis-CI and AppVeyor.
|
14
14
|
email:
|
@@ -21,6 +21,9 @@ files:
|
|
21
21
|
- README.md
|
22
22
|
- Rakefile
|
23
23
|
- lib/emplace.rb
|
24
|
+
- modules/Emplace.cmake
|
25
|
+
- modules/unix/Emplace.cmake
|
26
|
+
- modules/win32/Emplace.cmake
|
24
27
|
- test/emplace-test.rb
|
25
28
|
homepage: https://github.com/ryancalhoun/emplace
|
26
29
|
licenses:
|