fungos / cr

cr.h: A Simple C Hot Reload Header-only Library
https://fungos.github.io/cr-simple-c-hot-reload/
MIT License
1.52k stars 101 forks source link

Unable to build samples on Linux "Cannot specify link libraries for target "crTest" which is not built by this project" #76

Closed darthdeus closed 4 days ago

darthdeus commented 3 weeks ago

Not sure what I could be doing wrong, but really just following the README instructions, cloned the project, ran ./fips build, it clones all the deps, and then fails

$ ./fips build
=== cloning fips build system to '/home/darth/projects/fips':
Cloning into '/home/darth/projects/fips'...
remote: Enumerating objects: 5822, done.
remote: Counting objects: 100% (990/990), done.
remote: Compressing objects: 100% (394/394), done.
remote: Total 5822 (delta 659), reused 786 (delta 574), pack-reused 4832
Receiving objects: 100% (5822/5822), 2.58 MiB | 5.04 MiB/s, done.
Resolving deltas: 100% (3964/3964), done.
=== dependency: 'fips-glfw':
Cloning into 'fips-glfw'...
remote: Enumerating objects: 38, done.
remote: Counting objects: 100% (38/38), done.
remote: Compressing objects: 100% (27/27), done.
remote: Total 38 (delta 16), reused 31 (delta 10), pack-reused 0
Receiving objects: 100% (38/38), 9.03 KiB | 288.00 KiB/s, done.
Resolving deltas: 100% (16/16), done.
Submodule 'glfw' (https://github.com/glfw/glfw.git) registered for path 'glfw'
Cloning into '/home/darth/projects/fips-glfw/glfw'...
remote: Enumerating objects: 28833, done.
remote: Counting objects: 100% (668/668), done.
remote: Compressing objects: 100% (296/296), done.
remote: Total 28833 (delta 453), reused 473 (delta 356), pack-reused 28165
Receiving objects: 100% (28833/28833), 14.77 MiB | 10.17 MiB/s, done.
Resolving deltas: 100% (20405/20405), done.
Submodule path 'glfw': checked out '2b3f919b6055e6837ca0fad193c7f96b323f1256'
=== dependency: 'fips-imgui':
Cloning into 'fips-imgui'...
remote: Enumerating objects: 30, done.
remote: Counting objects: 100% (30/30), done.
remote: Compressing objects: 100% (22/22), done.
remote: Total 30 (delta 11), reused 25 (delta 6), pack-reused 0
Receiving objects: 100% (30/30), done.
Resolving deltas: 100% (11/11), done.
Submodule 'imgui' (https://github.com/ocornut/imgui.git) registered for path 'imgui'
Cloning into '/home/darth/projects/fips-imgui/imgui'...
remote: Enumerating objects: 41891, done.
remote: Counting objects: 100% (133/133), done.
remote: Compressing objects: 100% (67/67), done.
remote: Total 41891 (delta 91), reused 90 (delta 66), pack-reused 41758
Receiving objects: 100% (41891/41891), 55.12 MiB | 19.75 MiB/s, done.
Resolving deltas: 100% (31756/31756), done.
Submodule path 'imgui': checked out 'd6cb3c923d28dcebb2d8d9605ccc7229ccef19eb'
=== dependency: 'fips-googletest':
Cloning into 'fips-googletest'...
remote: Enumerating objects: 80, done.
remote: Counting objects: 100% (80/80), done.
remote: Compressing objects: 100% (62/62), done.
remote: Total 80 (delta 19), reused 75 (delta 16), pack-reused 0
Receiving objects: 100% (80/80), 248.88 KiB | 1.93 MiB/s, done.
Resolving deltas: 100% (19/19), done.
Submodule 'gtest' (https://github.com/google/googletest.git) registered for path 'gtest'
Cloning into '/home/darth/projects/fips-googletest/gtest'...
remote: Enumerating objects: 27459, done.
remote: Counting objects: 100% (74/74), done.
remote: Compressing objects: 100% (47/47), done.
remote: Total 27459 (delta 29), reused 38 (delta 21), pack-reused 27385
Receiving objects: 100% (27459/27459), 12.81 MiB | 9.84 MiB/s, done.
Resolving deltas: 100% (20405/20405), done.
Submodule path 'gtest': checked out '247a3d8e5e5d403f7fcacdb8ccc71e5059f15daa'
=== building: linux-make-debug
=== generating: linux-make-debug
config file: /home/darth/projects/fips/configs/linux-make-debug.yml
Preset CMake variables:

  CMAKE_BUILD_TYPE="Debug"
  CMAKE_EXPORT_COMPILE_COMMANDS="ON"
  FIPS_AUTO_IMPORT="ON"
  FIPS_CONFIG="linux-make-debug"
  FIPS_LOCAL_BUILD="OFF"

CMake Warning (dev) in CMakeLists.txt:
  No project() command is present.  The top-level CMakeLists.txt file must
  contain a literal, direct call to the project() command.  Add a line of
  code such as

    project(ProjectName)

  near the top of the file, but after cmake_minimum_required().

  CMake is pretending there is a "project(Project)" command on the first
  line.
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) in CMakeLists.txt:
  cmake_minimum_required() should be called prior to this top-level project()
  call.  Please see the cmake-commands(7) manual for usage documentation of
  both commands.
This warning is for project developers.  Use -Wno-dev to suppress it.

-- The C compiler identification is GNU 14.1.1
-- The CXX compiler identification is GNU 14.1.1
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Deprecation Warning at CMakeLists.txt:8 (cmake_minimum_required):
  Compatibility with CMake < 3.5 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.

CMake Warning (dev) at /home/darth/projects/fips/cmake/fips.cmake:40 (option):
  Policy CMP0077 is not set: option() honors normal variables.  Run "cmake
  --help-policy CMP0077" for policy details.  Use the cmake_policy command to
  set the policy and suppress this warning.

  For compatibility with older versions of CMake, option is clearing the
  normal variable 'FIPS_DYNAMIC_CRT'.
Call Stack (most recent call first):
  CMakeLists.txt:11 (include)
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning at /home/darth/projects/fips/cmake/fips.cmake:56 (message):
  please call project([proj_name]) directly before fips_setup(), cmake is
  expecting this starting with version 3.15
Call Stack (most recent call first):
  CMakeLists.txt:14 (fips_setup)

=== fips_setup(PROJECT cr)
CMAKE_BUILD_TYPE: Debug
FIPS_ROOT_DIR: /home/darth/projects/fips
FIPS_PROJECT_DIR: /home/darth/projects/cr
FIPS_BUILD_DIR: /home/darth/projects/fips-build
FIPS_DEPLOY_DIR: /home/darth/projects/fips-deploy
FIPS_PROJECT_NAME: cr
FIPS_AUTO_IMPORT: ON
FIPS_CONFIG: linux-make-debug
FIPS_PROJECT_BUILD_DIR: /home/darth/projects/fips-build/cr/linux-make-debug
FIPS_PROJECT_DEPLOY_DIR: /home/darth/projects/fips-deploy/cr/linux-make-debug
Host system: Linux
CMAKE_CXX_COMPILER_ID: GNU
FIPS_GCC: 1
-- Looking for __atomic_fetch_add_4
-- Looking for __atomic_fetch_add_4 - not found
-- Looking for __atomic_fetch_add_4 in atomic
-- Looking for __atomic_fetch_add_4 in atomic - found
-- Looking for clock_gettime in rt
-- Looking for clock_gettime in rt - found
FIPS_PLATFORM: Linux
FIPS_PLATFORM_NAME: linux
-- Found Python: /usr/bin/python3.12 (found version "3.12.4") found components: Interpreter
CMake Warning at /home/darth/projects/fips/cmake/fips_deprecated.cmake:31 (message):
  !!! DEPRECATED !!! fips_include_directories() is deprecated, use
  target_include_directories()
Call Stack (most recent call first):
  /home/darth/projects/fips-googletest/CMakeLists.txt:16 (fips_include_directories)

CMake Warning at /home/darth/projects/fips/cmake/fips_deprecated.cmake:31 (message):
  !!! DEPRECATED !!! fips_include_directories() is deprecated, use
  target_include_directories()
Call Stack (most recent call first):
  /home/darth/projects/fips-googletest/CMakeLists.txt:22 (fips_include_directories)

CMake Error at /home/darth/projects/fips/cmake/fips_private.cmake:165 (target_sources):
  Cannot specify sources for target "crTest" which is not built by this
  project.
Call Stack (most recent call first):
  /home/darth/projects/fips/cmake/fips.cmake:406 (fips_add_file)
  tests/CMakeLists.txt:6 (fips_files)

CMake Error at /home/darth/projects/fips/cmake/fips_private.cmake:165 (target_sources):
  Cannot specify sources for target "crTest" which is not built by this
  project.
Call Stack (most recent call first):
  /home/darth/projects/fips/cmake/fips.cmake:406 (fips_add_file)
  tests/CMakeLists.txt:6 (fips_files)

CMake Error at /home/darth/projects/fips/cmake/fips_private.cmake:165 (target_sources):
  Cannot specify sources for target "crTest" which is not built by this
  project.
Call Stack (most recent call first):
  /home/darth/projects/fips/cmake/fips.cmake:406 (fips_add_file)
  tests/CMakeLists.txt:6 (fips_files)

CMake Error at /home/darth/projects/fips/cmake/fips.cmake:327 (target_link_libraries):
  Cannot specify link libraries for target "crTest" which is not built by
  this project.
Call Stack (most recent call first):
  tests/CMakeLists.txt:11 (fips_libs)

-- Configuring incomplete, errors occurred!
[ERROR] Failed to generate 'linux-make-debug' of project 'cr'
fungos commented 2 weeks ago

Hi, thanks for reporting. Not sure when this broke, I'll try to give a look soon.

fungos commented 2 weeks ago

I just pushed a fix, can you retry?