Skip to content

Commit 3c99dd4

Browse files
authored
Merge pull request #2 from externpro/xpro
externpro devel package
2 parents 2216eed + 276fca9 commit 3c99dd4

12 files changed

Lines changed: 125 additions & 28 deletions

File tree

.devcontainer

Submodule .devcontainer added at 3a7e0dd

.github/workflows/xpbuild.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Build
2+
on:
3+
push:
4+
branches: [ "dev" ]
5+
pull_request:
6+
branches: [ "dev" ]
7+
workflow_dispatch:
8+
jobs:
9+
linux:
10+
uses: externpro/externpro/.github/workflows/build-linux.yml@25.05.2
11+
with:
12+
cmake-workflow-preset: Linux
13+
runon: ubuntu-latest
14+
secrets: inherit
15+
linux-arm64:
16+
uses: externpro/externpro/.github/workflows/build-linux.yml@25.05.2
17+
with:
18+
cmake-workflow-preset: Linux
19+
runon: ubuntu-24.04-arm
20+
secrets: inherit
21+
macos:
22+
uses: externpro/externpro/.github/workflows/build-macos.yml@25.05.2
23+
with:
24+
cmake-workflow-preset: Darwin
25+
secrets: inherit
26+
windows:
27+
uses: externpro/externpro/.github/workflows/build-windows.yml@25.05.2
28+
with:
29+
cmake-workflow-preset: Windows
30+
secrets: inherit

.github/workflows/xprelease.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Release
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
workflow_run_url:
6+
description: 'URL of the workflow run containing artifacts to upload (e.g., https://github.com/owner/repo/actions/runs/123456789)'
7+
required: true
8+
type: string
9+
jobs:
10+
# Upload build artifacts as release assets
11+
release-from-build:
12+
uses: externpro/externpro/.github/workflows/release-from-build.yml@25.05.2
13+
with:
14+
workflow_run_url: ${{ github.event.inputs.workflow_run_url }}
15+
artifact_pattern: "*.tar.xz"
16+
permissions:
17+
contents: write
18+
id-token: write
19+
attestations: write
20+
secrets: inherit

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,3 +61,8 @@ Temporary Items
6161

6262
#Build cmake dir
6363
build
64+
65+
# externpro
66+
.env
67+
_bld*/
68+
docker-compose.override.yml

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule ".devcontainer"]
2+
path = .devcontainer
3+
url = https://github.com/externpro/externpro

CMakeLists.txt

Lines changed: 32 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
cmake_minimum_required(VERSION 3.5)
1+
cmake_minimum_required(VERSION 3.5...3.31)
2+
set(CMAKE_PROJECT_TOP_LEVEL_INCLUDES .devcontainer/cmake/xproinc.cmake)
23
project(wirehair)
34

5+
46
set(CMAKE_CXX_STANDARD 11)
57
include(xpflags)
68

@@ -11,6 +13,7 @@ if(NOT CMAKE_BUILD_TYPE)
1113
endif()
1214

1315
option(MARCH_NATIVE "Use -march=native option" ON)
16+
option(BUILD_TESTS "build testsuite" ON)
1417

1518
set(LIB_SOURCE_FILES
1619
wirehair.cpp
@@ -79,56 +82,60 @@ else()
7982
endforeach()
8083
if(XP_BUILD_VERBOSE)
8184
message(STATUS "CMAKE_CXX_FLAGS: ${CMAKE_CXX_FLAGS}")
82-
message(STATUS "CMAKE_CXX_FLAGS_DEBUG: ${CMAKE_CXX_FLAGS_DEBUG}")
83-
message(STATUS "CMAKE_CXX_FLAGS_RELEASE: ${CMAKE_CXX_FLAGS_RELEASE}")
85+
message(STATUS "CMAKE_CXX_FLAGS_DEBUG: ${CMAKE_CXX_FLAGS_DEBUG}") # "-g -O0"
86+
message(STATUS "CMAKE_CXX_FLAGS_RELEASE: ${CMAKE_CXX_FLAGS_RELEASE}") # "-O3"
87+
message(STATUS "CMAKE_CXX_FLAGS_RELWITHDEBINFO: ${CMAKE_CXX_FLAGS_RELWITHDEBINFO}") # "-g -O3"
8488
endif()
8589
if (CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64")
8690
add_definitions(-DLINUX_ARM=1)
8791
endif()
8892
endif()
8993

90-
if(DONT_INSTALL_PYTHON)
91-
set(optionalInstall EXCLUDE_FROM_ALL)
92-
endif()
93-
9494
add_library(wirehair ${LIB_SOURCE_FILES})
9595
set_target_properties(wirehair PROPERTIES VERSION 2)
9696
set_target_properties(wirehair PROPERTIES SOVERSION 2)
9797
target_include_directories(wirehair PUBLIC $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
9898
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
9999
)
100100

101-
add_executable(unit_test ${UNIT_TEST_SOURCE_FILES})
102-
target_link_libraries(unit_test wirehair)
101+
if (BUILD_TESTS)
102+
add_executable(unit_test ${UNIT_TEST_SOURCE_FILES})
103+
target_link_libraries(unit_test wirehair)
103104

104-
add_executable(gen_small_dseeds ${GEN_SMALL_DSEEDS})
105-
target_link_libraries(gen_small_dseeds wirehair)
105+
add_executable(gen_small_dseeds ${GEN_SMALL_DSEEDS})
106+
target_link_libraries(gen_small_dseeds wirehair)
106107

107-
add_executable(gen_peel_seeds ${GEN_PEEL_SEEDS})
108-
target_link_libraries(gen_peel_seeds wirehair)
108+
add_executable(gen_peel_seeds ${GEN_PEEL_SEEDS})
109+
target_link_libraries(gen_peel_seeds wirehair)
109110

110-
add_executable(gen_most_dseeds ${GEN_MOST_DSEEDS})
111-
target_link_libraries(gen_most_dseeds wirehair)
111+
add_executable(gen_most_dseeds ${GEN_MOST_DSEEDS})
112+
target_link_libraries(gen_most_dseeds wirehair)
112113

113-
add_executable(gen_dcounts ${GEN_DCOUNTS})
114-
target_link_libraries(gen_dcounts wirehair)
114+
add_executable(gen_dcounts ${GEN_DCOUNTS})
115+
target_link_libraries(gen_dcounts wirehair)
115116

116-
add_executable(gen_tables ${GEN_TABLES})
117-
target_link_libraries(gen_tables wirehair)
117+
add_executable(gen_tables ${GEN_TABLES})
118+
target_link_libraries(gen_tables wirehair)
119+
endif()
118120

119121
include(GNUInstallDirs)
120122

121-
set(targetsFile ${PROJECT_NAME}-targets)
122-
install(TARGETS wirehair EXPORT ${targetsFile}
123-
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
124-
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
125-
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
123+
set(lib wirehair)
126124
if(DEFINED XP_NAMESPACE)
127125
set(nameSpace NAMESPACE ${XP_NAMESPACE}::)
126+
string(PREPEND lib "${XP_NAMESPACE}::")
128127
endif()
129128
if(NOT DEFINED XP_INSTALL_CMAKEDIR)
130129
set(XP_INSTALL_CMAKEDIR ${CMAKE_INSTALL_DATADIR}/cmake)
131130
endif()
131+
set(targetsFile ${PROJECT_NAME}-targets)
132+
xpPackageDevel(TARGETS_FILE ${targetsFile} LIBRARIES ${lib})
133+
install(TARGETS wirehair EXPORT ${targetsFile}
134+
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
135+
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
136+
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
132137
install(EXPORT ${targetsFile} DESTINATION ${XP_INSTALL_CMAKEDIR} ${nameSpace})
133138
install(DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
134-
install(DIRECTORY python DESTINATION ${CMAKE_INSTALL_PREFIX} ${optionalInstall})
139+
if(NOT DONT_INSTALL_PYTHON)
140+
install(DIRECTORY python DESTINATION ${CMAKE_INSTALL_PREFIX})
141+
endif()

CMakePresets.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"version": 8,
3+
"include": [
4+
".devcontainer/cmake/presets/xpLinuxNinja.json",
5+
".devcontainer/cmake/presets/xpDarwinNinja.json",
6+
".devcontainer/cmake/presets/xpWindowsVs2022.json"
7+
]
8+
}

CMakePresetsBase.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"version": 8,
3+
"configurePresets": [
4+
{
5+
"name": "config-base",
6+
"hidden": true,
7+
"binaryDir": "${sourceDir}/_bld-${presetName}",
8+
"cacheVariables": {
9+
"XP_NAMESPACE": "xpro",
10+
"DONT_INSTALL_PYTHON": true,
11+
"MARCH_NATIVE": "OFF"
12+
}
13+
}
14+
],
15+
"buildPresets": [
16+
{
17+
"name": "build-base",
18+
"hidden": true
19+
}
20+
]
21+
}

docker-compose.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.devcontainer/compose.pro.sh

docker-compose.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.devcontainer/compose.bld.yml

0 commit comments

Comments
 (0)