CMake Migration #3
4
.gitignore
vendored
4
.gitignore
vendored
@@ -52,5 +52,5 @@ Module.symvers
|
|||||||
Mkfile.old
|
Mkfile.old
|
||||||
dkms.conf
|
dkms.conf
|
||||||
|
|
||||||
# Ignore /bin directory
|
# Ignore /build directory from cmake
|
||||||
/bin
|
build/
|
||||||
|
|||||||
10
CMakeLists.txt
Normal file
10
CMakeLists.txt
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
cmake_minimum_required(VERSION 3.28.1)
|
||||||
|
|
||||||
|
project(quantum-utils)
|
||||||
|
|
||||||
|
add_library(quantum SHARED ./quantum/src/test.c)
|
||||||
|
|
||||||
|
add_executable(test_stuff ./test_stuff/src/main.c)
|
||||||
|
|
||||||
|
target_link_libraries(test_stuff quantum)
|
||||||
|
target_include_directories(test_stuff PUBLIC ./quantum/src/)
|
||||||
29
build-all.sh
29
build-all.sh
@@ -1,29 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
#
|
|
||||||
# Build script to build everything
|
|
||||||
|
|
||||||
set echo on
|
|
||||||
|
|
||||||
mkdir -p bin/
|
|
||||||
|
|
||||||
echo "Building all.."
|
|
||||||
|
|
||||||
pushd quantum
|
|
||||||
source build.sh
|
|
||||||
popd
|
|
||||||
|
|
||||||
ERRORLEVEL=$?
|
|
||||||
if [ $ERRORLEVEL -ne 0 ]; then
|
|
||||||
echo "Error:"$ERRORLEVEL && exit
|
|
||||||
fi
|
|
||||||
|
|
||||||
pushd test_stuff
|
|
||||||
source build.sh
|
|
||||||
popd
|
|
||||||
|
|
||||||
ERRORLEVEL=$?
|
|
||||||
if [ $ERRORLEVEL -ne 0 ]; then
|
|
||||||
echo "Error:"$ERRORLEVEL && exit
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "All assemblies built successfully!!!!"
|
|
||||||
10
clean-all.sh
10
clean-all.sh
@@ -1,10 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# Clean up paths if they exist
|
|
||||||
if [[ -d "./build/" ]]; then
|
|
||||||
rm -rf ./build
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ -d "./bin/" ]]; then
|
|
||||||
rm -rf ./bin
|
|
||||||
fi
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
#
|
|
||||||
# Build script for quantum
|
|
||||||
|
|
||||||
set echo on
|
|
||||||
|
|
||||||
mkdir -p ../build/
|
|
||||||
|
|
||||||
# Get a list of all the .c files.
|
|
||||||
cFilenames=$(find . -type f -name "*.c")
|
|
||||||
|
|
||||||
assembly="quantum"
|
|
||||||
objLocation="../build/libquantum.o"
|
|
||||||
compilerFlags="-g -c -fpic"
|
|
||||||
includeFlags="-Isrc"
|
|
||||||
|
|
||||||
echo "Building $assembly..."
|
|
||||||
|
|
||||||
# First we need to compile down to .o files
|
|
||||||
gcc $cFilenames $compilerFlags -o $objLocation $includeFlags
|
|
||||||
|
|
||||||
compilerFlags="-g -shared"
|
|
||||||
gcc $objLocation $compilerFlags -o ../bin/libquantum.so $includeFlags
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
#Build script for test_stuff
|
|
||||||
|
|
||||||
set echo on
|
|
||||||
|
|
||||||
# Get a list of all the .c files.
|
|
||||||
cFilenames=$(find . -type f -name "*.c")
|
|
||||||
|
|
||||||
assembly="test_stuff"
|
|
||||||
compilerFlags="-g -fpic"
|
|
||||||
includeFlags="-Isrc -I../quantum/src/"
|
|
||||||
linkerFlags="-L../bin/ -lquantum -Wl,-rpath,."
|
|
||||||
|
|
||||||
echo "Building $assembly..."
|
|
||||||
gcc $cFilenames $compilerFlags -o ../bin/$assembly $includeFlags $linkerFlags
|
|
||||||
Reference in New Issue
Block a user