Skip to content

Commit 36fc8c5

Browse files
Ckathswirlsneedcat
authored
Conan fully removed from project (#229)
* attempt to build without conan - many files modified to match before conan build times - lacking dirs in lib-src and cmake-proxies restored * got it build on windows x64/x86 also with ninja * added ckath's patches for linux * changed generator to ninja * looks like ninja was using mingw instead of cl for building on windows * name changing * repair ninja * update pkgbuild, remove conan as makedep * improve the linux package workaround instead of copying all the libs, only grab the local ones which just happen to be misplaced for whatever reason * added compiler cache * added some commits regarding sccache working on windows from tenacity * fix linux workaround (#226) * cleaned windows builds with ninja Co-authored-by: swirl <roachh@protonmail.com> Co-authored-by: Megumin <83077245+meguminloli@users.noreply.github.com>
1 parent 2793dcd commit 36fc8c5

File tree

382 files changed

+220954
-1568
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

382 files changed

+220954
-1568
lines changed

.github/workflows/cmake_build.yml

+43-22
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@ jobs:
1919
# This variables will be used by all the steps
2020
WINDOWS_CERTIFICATE: ${{ secrets.WINDOWS_CERTIFICATE }}
2121
WINDOWS_CERTIFICATE_PASSWORD: ${{ secrets.WINDOWS_CERTIFICATE_PASSWORD }}
22-
# Conan home location to be used for cache action
23-
CONAN_USER_HOME: "${{ github.workspace }}/conan-home/"
24-
CONAN_USER_HOME_SHORT: "${{ github.workspace }}/conan-home/short"
2522
strategy:
2623
fail-fast: false
2724
matrix:
@@ -30,35 +27,68 @@ jobs:
3027
- name: Ubuntu_18.04
3128
os: ubuntu-18.04
3229
arch: x86_64 # as reported by `arch` or `uname -m`
33-
generator: Unix Makefiles
30+
generator: Ninja
31+
compiler_cache: ccache
32+
compiler_cache_path: ~/.ccache
3433

3534
- name: macOS_Intel
3635
os: macos-latest
3736
arch: Intel # as reported by Apple menu > About This Mac
38-
generator: Xcode
37+
generator: Ninja
38+
compiler_cache: ccache
39+
compiler_cache_path: ~/Library/Caches/ccache
3940

4041
- name: Windows_32bit
4142
os: windows-latest
42-
arch: 32bit # as reported by Windows Settings > System > About
43-
generator: Visual Studio 16 2019
44-
43+
arch: x86 # as reported by Windows Settings > System > About
44+
generator: Ninja
45+
cc: cl
46+
cxx: cl
47+
compiler_cache: sccache
48+
compiler_cache_path: C:\Users\runneradmin\AppData\Local\Mozilla\sccache\cache
49+
4550
- name: Windows_64bit
4651
os: windows-latest
47-
arch: 64bit # as reported by Windows Settings > System > About
48-
generator: Visual Studio 16 2019
52+
arch: amd64 # as reported by Windows Settings > System > About
53+
generator: Ninja
54+
cc: cl
55+
cxx: cl
56+
compiler_cache: sccache
57+
compiler_cache_path: C:\Users\runneradmin\AppData\Local\Mozilla\sccache\cache
4958

5059
steps:
51-
5260
- name: Checkout
5361
uses: actions/checkout@v2
5462

63+
- uses: seanmiddleditch/gha-setup-ninja@master
64+
65+
5566
- name: Dependencies
5667
run: |
5768
exec bash "scripts/ci/dependencies.sh"
5869
5970
- name: Environment
6071
run: |
6172
source "scripts/ci/environment.sh"
73+
74+
- name: "Set up MSVC Developer Command Prompt"
75+
if: startswith( matrix.config.os, 'windows' )
76+
uses: seanmiddleditch/gha-setup-vsdevenv@v3
77+
with:
78+
arch: ${{ matrix.config.arch }}
79+
80+
- name: "Install sccache"
81+
if: startswith( matrix.config.os, 'windows' )
82+
run: choco install sccache
83+
84+
- name: "Set up compiler cache"
85+
uses: actions/cache@v2
86+
with:
87+
path: ${{ matrix.config.compiler_cache_path }}
88+
key: ${{ matrix.config.os }}-${{ matrix.config.arch }}-${{ github.head_ref }}-${{ github.run_number }}
89+
restore-keys: |
90+
${{ matrix.config.os }}-${{ matrix.config.arch }}-${{ github.head_ref }}-
91+
6292
6393
#- name: Install Apple codesigning certificates
6494
# uses: apple-actions/import-codesign-certs@v1
@@ -67,17 +97,6 @@ jobs:
6797
# p12-file-base64: ${{ secrets.APPLE_CERTIFICATE }}
6898
# p12-password: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
6999

70-
- name: Cache for .conan
71-
id: cache-conan
72-
uses: actions/cache@v2
73-
env:
74-
cache-name: cache-conan-modules
75-
with:
76-
path: ${{ env.CONAN_USER_HOME }}
77-
key: host-${{ matrix.config.name }}-${{ hashFiles('cmake-proxies/CMakeLists.txt') }}
78-
restore-keys: |
79-
host-${{ matrix.config.name }}-
80-
81100
- name: Configure
82101
env:
83102
# Error reporing
@@ -88,6 +107,8 @@ jobs:
88107
APPLE_CODESIGN_IDENTITY: ${{ secrets.APPLE_CODESIGN_IDENTITY }}
89108
APPLE_NOTARIZATION_USER_NAME: ${{ secrets.APPLE_NOTARIZATION_USER_NAME }}
90109
APPLE_NOTARIZATION_PASSWORD: ${{ secrets.APPLE_NOTARIZATION_PASSWORD }}
110+
CC: ${{ matrix.config.cc }}
111+
CXX: ${{ matrix.config.cxx }}
91112
run: |
92113
exec bash "scripts/ci/configure.sh"
93114

.gitignore

+6
Original file line numberDiff line numberDiff line change
@@ -206,3 +206,9 @@ win/xaudacity.ico
206206
#other files that get in the way
207207
*/not-for-git/*
208208
*.dll
209+
210+
# files autogenerated by vs
211+
out
212+
CMakeSettings.json
213+
.vs
214+
.vscode

BUILDING.md

-22
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,9 @@
33
## Prerequisites
44

55
* **python3** >= 3.5
6-
* **conan** >= 1.32.0
76
* **cmake** >= 3.16
87
* A working C++17 compiler
98

10-
### Conan
11-
12-
[The best way to install Conan is `pip`.](https://docs.conan.io/en/latest/installation.html)
13-
14-
To install Conan on Windows:
15-
16-
```
17-
$ pip install conan
18-
```
19-
20-
To install Conan on macOS and Linux:
21-
22-
```
23-
$ sudo pip3 install conan
24-
```
25-
26-
Alternatively, on macOS, Conan is available from `brew`.
27-
289
### CMake
2910

3011
On Windows, please use the [prebuilt binaries](https://cmake.org/download/).
@@ -52,7 +33,6 @@ On Debian or Ubuntu, you can install everything required using the following com
5233
```
5334
$ sudo apt-get update
5435
$ sudo apt-get install -y build-essential cmake git python3-pip
55-
$ sudo pip3 install conan
5636
$ sudo apt-get install libgtk2.0-dev libasound2-dev libavformat-dev libjack-jackd2-dev uuid-dev
5737
```
5838

@@ -84,8 +64,6 @@ $ sudo apt-get install libgtk2.0-dev libasound2-dev libavformat-dev libjack-jack
8464
8565
Generally, steps 1-5 are only needed the first-time you configure. Then, after you've generated the solution, you can open it in Visual Studio next time. If the project configuration has changed, the IDE will invoke CMake internally.
8666
87-
> Conan Center provides prebuilt binaries only for **x64**. Configuring the project for Win32 will take much longer, as all the 3rd party libraries will be built during the configuration.
88-
8967
## macOS
9068
9169
1. Clone Sneedacity from the Sneedacity GitHub project.

CMakeLists.txt

+27-12
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,20 @@ set( CMAKE_CXX_STANDARD_REQUIRED ON )
123123
find_program( CCACHE_PROGRAM ccache )
124124
mark_as_advanced( FORCE CCACHE_PROGRAM )
125125

126+
# use sccache if available
127+
find_program( SCCACHE_PROGRAM sccache )
128+
mark_as_advanced( FORCE SCCACHE_PROGRAM )
129+
126130
if( CCACHE_PROGRAM )
127-
set_property( GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CCACHE_PROGRAM}" )
131+
message( STATUS "Using ccache" )
132+
set( CMAKE_C_COMPILER_LAUNCHER "${CCACHE_PROGRAM}" )
133+
set( CMAKE_CXX_COMPILER_LAUNCHER "${CCACHE_PROGRAM}" )
134+
endif()
135+
136+
if( SCCACHE_PROGRAM )
137+
message( STATUS "Using ${SCCACHE_PROGRAM} for source code cache" )
138+
set( CMAKE_C_COMPILER_LAUNCHER "${SCCACHE_PROGRAM}" )
139+
set( CMAKE_CXX_COMPILER_LAUNCHER "${SCCACHE_PROGRAM}" )
128140
endif()
129141

130142
# Define option() prefix
@@ -151,8 +163,6 @@ cmd_option( ${_OPT}obey_system_dependencies
151163
Off
152164
)
153165

154-
include( SneedacityDependencies )
155-
156166
# Pull all the modules we'll need
157167
include( CheckCXXCompilerFlag )
158168
include( CheckIncludeFile )
@@ -257,18 +267,17 @@ if( CMAKE_GENERATOR MATCHES "Visual Studio" )
257267
include( InstallRequiredSystemLibraries )
258268
endif()
259269

260-
# Where the final product is stored
261-
set( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin )
262-
263270
set ( _SHARED_PROXY_BASE "shared" )
264271
set ( _SHARED_PROXY_BASE_PATH "${CMAKE_BINARY_DIR}/${_SHARED_PROXY_BASE}")
265272

266273
# Define the non-install and executable paths
267274
if( CMAKE_CONFIGURATION_TYPES )
275+
set( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin )
268276
set( _DESTDIR "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}" )
269277
set( _SHARED_PROXY_PATH "${_SHARED_PROXY_BASE_PATH}/${CMAKE_CFG_INTDIR}")
270278
else()
271-
set( _DESTDIR "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}" )
279+
set( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/${CMAKE_BUILD_TYPE} )
280+
set( _DESTDIR "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/" )
272281
set( _SHARED_PROXY_PATH "${_SHARED_PROXY_BASE_PATH}/${CMAKE_BUILD_TYPE}")
273282
endif()
274283

@@ -344,6 +353,17 @@ elseif( CMAKE_CXX_COMPILER_ID MATCHES "MSVC" )
344353
if( NOT IS_64BIT )
345354
set( SSE_FLAG "/arch:SSE2" )
346355
endif()
356+
# required for sccache
357+
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
358+
string(REPLACE "/Zi" "/Z7" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}")
359+
string(REPLACE "/Zi" "/Z7" CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG}")
360+
elseif(CMAKE_BUILD_TYPE STREQUAL "Release")
361+
string(REPLACE "/Zi" "/Z7" CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}")
362+
string(REPLACE "/Zi" "/Z7" CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}")
363+
elseif(CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")
364+
string(REPLACE "/Zi" "/Z7" CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
365+
string(REPLACE "/Zi" "/Z7" CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO}")
366+
endif()
347367
endif()
348368

349369
check_include_files( "float.h;stdarg.h;stdlib.h;string.h" STDC_HEADERS )
@@ -456,7 +476,6 @@ find_package( Python3 )
456476
if( Python3_FOUND )
457477
set( PYTHON "${Python3_EXECUTABLE}" )
458478
elseif( CMAKE_SYSTEM_NAME MATCHES "Windows" )
459-
# This is an odd case now, as Conan requires Python as well
460479
nuget_package( pkgdir "python3" "3.7.7" )
461480
file( TO_NATIVE_PATH "${pkgdir}/tools/python.exe" PYTHON )
462481
endif()
@@ -467,10 +486,6 @@ include( "src/Experimental.cmake" )
467486

468487
# Add our children
469488
add_subdirectory( "cmake-proxies" )
470-
471-
# Conan uses find_package and does not set GLOBAL flag
472-
resolve_conan_dependencies()
473-
474489
add_subdirectory( "help" )
475490
add_subdirectory( "images" )
476491
add_subdirectory( "libraries" )

0 commit comments

Comments
 (0)