floooh / sokol-samples

Sample code for https://github.com/floooh/sokol
MIT License
624 stars 79 forks source link

Fail to build on macos sonoma #132

Closed ernesernesto closed 11 months ago

ernesernesto commented 11 months ago

Latest sokol samples fails to build on macos sonoma 14.1.1, seems to be referring to MacOSX13.3.sdk folder.

cmake version is 3.27.5

Already tried running fips update, fips clean and then fips build

Here is the full fips build output


=== dependency: 'sokol':
dir '/Users/ernesernesto/Documents/Repo/sokol' exists
=== dependency: 'sokol-tools-bin':
dir '/Users/ernesernesto/Documents/Repo/sokol-tools-bin' exists
=== dependency: 'fips-glfw':
dir '/Users/ernesernesto/Documents/Repo/fips-glfw' exists
=== dependency: 'fips-cimgui':
dir '/Users/ernesernesto/Documents/Repo/fips-cimgui' exists
=== dependency: 'fips-imgui':
dir '/Users/ernesernesto/Documents/Repo/fips-imgui' exists
=== dependency: 'fips-imgui-dock':
dir '/Users/ernesernesto/Documents/Repo/fips-imgui-dock' exists
=== dependency: 'fips-libmodplug':
dir '/Users/ernesernesto/Documents/Repo/fips-libmodplug' exists
=== dependency: 'fips-utils':
dir '/Users/ernesernesto/Documents/Repo/fips-utils' exists
=== dependency: 'fips-dawn':
dir '/Users/ernesernesto/Documents/Repo/fips-dawn' exists
=== building: sapp-metal-osx-xcode-debug
=== generating: sapp-metal-osx-xcode-debug
config file: /Users/ernesernesto/Documents/Repo/sokol-samples/fips-files/configs/sapp-metal-osx-xcode-debug.yml
cmake -G "Xcode" -DCMAKE_BUILD_TYPE=Debug -DFIPS_CONFIG=sapp-metal-osx-xcode-debug -DFIPS_LOCAL_BUILD=OFF -DUSE_SOKOL_APP=ON -DSOKOL_USE_METAL=ON -DFIPS_USE_CCACHE=OFF -DFIPS_AUTO_IMPORT=OFF -DCMAKE_OSX_SYSROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk -B/Users/ernesernesto/Documents/Repo/fips-build/sokol-samples/sapp-metal-osx-xcode-debug -H/Users/ernesernesto/Documents/Repo/sokol-samples
-- The C compiler identification is AppleClang 14.0.3.14030022
-- The CXX compiler identification is AppleClang 14.0.3.14030022
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang - 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: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMAKE_BUILD_TYPE: Debug
FIPS_ROOT_DIR: /Users/ernesernesto/Documents/Repo/fips
FIPS_PROJECT_DIR: /Users/ernesernesto/Documents/Repo/sokol-samples
FIPS_BUILD_DIR: /Users/ernesernesto/Documents/Repo/fips-build
FIPS_DEPLOY_DIR: /Users/ernesernesto/Documents/Repo/fips-deploy
FIPS_PROJECT_NAME: sokol-samples
FIPS_AUTO_IMPORT: OFF
FIPS_CONFIG: sapp-metal-osx-xcode-debug
FIPS_PROJECT_BUILD_DIR: /Users/ernesernesto/Documents/Repo/fips-build/sokol-samples/sapp-metal-osx-xcode-debug
FIPS_PROJECT_DEPLOY_DIR: /Users/ernesernesto/Documents/Repo/fips-deploy/sokol-samples/sapp-metal-osx-xcode-debug
Host system: OSX
CMAKE_CXX_COMPILER_ID: AppleClang
Detected C++ Compiler: Clang (FIPS_CLANG)
FIPS_PLATFORM: OSX
FIPS_PLATFORM_NAME: osx
-- Found Python: /usr/local/Frameworks/Python.framework/Versions/3.11/bin/python3.11 (found version "3.11.5") found components: Interpreter
CMake Error at libs/microui/CMakeLists.txt:4 (target_compile_options):
  Cannot specify compile options for target "microui" which is not built by
  this project.

CMake Error at libs/microui/CMakeLists.txt:7 (target_compile_options):
  Cannot specify compile options for target "microui" which is not built by
  this project.

CMake Error at libs/sokol/CMakeLists.txt:98 (target_compile_options):
  Cannot specify compile options for target "sokol-dll" which is not built by
  this project.

CMake Error at libs/stb/CMakeLists.txt:4 (target_compile_options):
  Cannot specify compile options for target "stb" which is not built by this
  project.

CMake Error at libs/basisu/CMakeLists.txt:4 (target_compile_options):
  Cannot specify compile options for target "basisu" which is not built by
  this project.

CMake Error at libs/basisu/CMakeLists.txt:10 (target_compile_options):
  Cannot specify compile options for target "basisu" which is not built by
  this project.

CMake Error at libs/ozzanim/CMakeLists.txt:4 (target_include_directories):
  Cannot specify include directories for target "ozzanim" which is not built
  by this project.

CMake Error at libs/ozzanim/CMakeLists.txt:6 (target_compile_options):
  Cannot specify compile options for target "ozzanim" which is not built by
  this project.

CMake Error at libs/spine-c/CMakeLists.txt:4 (target_include_directories):
  Cannot specify include directories for target "spine-c" which is not built
  by this project.

CMake Error at libs/spine-c/CMakeLists.txt:6 (target_compile_options):
  Cannot specify compile options for target "spine-c" which is not built by
  this project.

CMake Error at libs/spine-c/CMakeLists.txt:9 (target_compile_options):
  Cannot specify compile options for target "spine-c" which is not built by
  this project.

CMake Error at sapp/CMakeLists.txt:13 (target_compile_definitions):
  Cannot specify compile definitions for target "clear-sapp-ui" which is not
  built by this project.

CMake Error at sapp/CMakeLists.txt:27 (target_compile_definitions):
  Cannot specify compile definitions for target "triangle-sapp-ui" which is
  not built by this project.

CMake Error at sapp/CMakeLists.txt:41 (target_compile_definitions):
  Cannot specify compile definitions for target "quad-sapp-ui" which is not
  built by this project.

CMake Error at sapp/CMakeLists.txt:55 (target_compile_definitions):
  Cannot specify compile definitions for target "bufferoffsets-sapp-ui" which
  is not built by this project.

CMake Error at sapp/CMakeLists.txt:69 (target_compile_definitions):
  Cannot specify compile definitions for target "cube-sapp-ui" which is not
  built by this project.

CMake Error at sapp/CMakeLists.txt:83 (target_compile_definitions):
  Cannot specify compile definitions for target "noninterleaved-sapp-ui"
  which is not built by this project.

CMake Error at sapp/CMakeLists.txt:97 (target_compile_definitions):
  Cannot specify compile definitions for target "texcube-sapp-ui" which is
  not built by this project.

CMake Error at sapp/CMakeLists.txt:111 (target_compile_definitions):
  Cannot specify compile definitions for target "offscreen-sapp-ui" which is
  not built by this project.

CMake Error at sapp/CMakeLists.txt:125 (target_compile_definitions):
  Cannot specify compile definitions for target "offscreen-msaa-sapp-ui"
  which is not built by this project.

CMake Error at sapp/CMakeLists.txt:139 (target_compile_definitions):
  Cannot specify compile definitions for target "shadows-sapp-ui" which is
  not built by this project.

CMake Error at sapp/CMakeLists.txt:153 (target_compile_definitions):
  Cannot specify compile definitions for target "shadows-depthtex-sapp-ui"
  which is not built by this project.

CMake Error at sapp/CMakeLists.txt:167 (target_compile_definitions):
  Cannot specify compile definitions for target "instancing-sapp-ui" which is
  not built by this project.

CMake Error at sapp/CMakeLists.txt:181 (target_compile_definitions):
  Cannot specify compile definitions for target "mrt-sapp-ui" which is not
  built by this project.

CMake Error at sapp/CMakeLists.txt:195 (target_compile_definitions):
  Cannot specify compile definitions for target "mrt-pixelformats-sapp-ui"
  which is not built by this project.

CMake Error at sapp/CMakeLists.txt:209 (target_compile_definitions):
  Cannot specify compile definitions for target "arraytex-sapp-ui" which is
  not built by this project.

CMake Error at sapp/CMakeLists.txt:223 (target_compile_definitions):
  Cannot specify compile definitions for target "tex3d-sapp-ui" which is not
  built by this project.

CMake Error at sapp/CMakeLists.txt:237 (target_compile_definitions):
  Cannot specify compile definitions for target "dyntex-sapp-ui" which is not
  built by this project.

CMake Error at sapp/CMakeLists.txt:251 (target_compile_definitions):
  Cannot specify compile definitions for target "mipmap-sapp-ui" which is not
  built by this project.

CMake Error at sapp/CMakeLists.txt:267 (target_compile_definitions):
  Cannot specify compile definitions for target "cubemap-jpeg-sapp-ui" which
  is not built by this project.

CMake Error at sapp/CMakeLists.txt:283 (target_compile_definitions):
  Cannot specify compile definitions for target "basisu-sapp-ui" which is not
  built by this project.

CMake Error at sapp/CMakeLists.txt:297 (target_compile_definitions):
  Cannot specify compile definitions for target "blend-sapp-ui" which is not
  built by this project.

CMake Error at sapp/CMakeLists.txt:311 (target_compile_definitions):
  Cannot specify compile definitions for target "uvwrap-sapp-ui" which is not
  built by this project.

CMake Error at sapp/CMakeLists.txt:325 (target_compile_definitions):
  Cannot specify compile definitions for target "uniformtypes-sapp-ui" which
  is not built by this project.

CMake Error at sapp/CMakeLists.txt:422 (target_compile_definitions):
  Cannot specify compile definitions for target "sgl-sapp-ui" which is not
  built by this project.

CMake Error at sapp/CMakeLists.txt:434 (target_compile_definitions):
  Cannot specify compile definitions for target "sgl-lines-sapp-ui" which is
  not built by this project.

CMake Error at sapp/CMakeLists.txt:446 (target_compile_definitions):
  Cannot specify compile definitions for target "sgl-points-sapp-ui" which is
  not built by this project.

CMake Error at sapp/CMakeLists.txt:458 (target_compile_definitions):
  Cannot specify compile definitions for target "sgl-context-sapp-ui" which
  is not built by this project.

CMake Error at sapp/CMakeLists.txt:471 (target_compile_definitions):
  Cannot specify compile definitions for target "sgl-microui-sapp-ui" which
  is not built by this project.

CMake Error at sapp/CMakeLists.txt:483 (target_compile_definitions):
  Cannot specify compile definitions for target "nuklear-sapp-ui" which is
  not built by this project.

CMake Error at sapp/CMakeLists.txt:495 (target_compile_definitions):
  Cannot specify compile definitions for target "nuklear-images-sapp-ui"
  which is not built by this project.

CMake Error at sapp/CMakeLists.txt:509 (target_compile_definitions):
  Cannot specify compile definitions for target "cubemaprt-sapp-ui" which is
  not built by this project.

CMake Error at sapp/CMakeLists.txt:523 (target_compile_definitions):
  Cannot specify compile definitions for target "miprender-sapp-ui" which is
  not built by this project.

CMake Error at sapp/CMakeLists.txt:537 (target_compile_definitions):
  Cannot specify compile definitions for target "layerrender-sapp-ui" which
  is not built by this project.

CMake Error at sapp/CMakeLists.txt:551 (target_compile_definitions):
  Cannot specify compile definitions for target "sdf-sapp-ui" which is not
  built by this project.

CMake Error at sapp/CMakeLists.txt:565 (target_compile_definitions):
  Cannot specify compile definitions for target "shapes-sapp-ui" which is not
  built by this project.

CMake Error at sapp/CMakeLists.txt:579 (target_compile_definitions):
  Cannot specify compile definitions for target "shapes-transform-sapp-ui"
  which is not built by this project.

CMake Error at sapp/CMakeLists.txt:593 (target_compile_definitions):
  Cannot specify compile definitions for target "primtypes-sapp-ui" which is
  not built by this project.

CMake Error at sapp/CMakeLists.txt:612 (target_compile_definitions):
  Cannot specify compile definitions for target "debugtext-sapp-ui" which is
  not built by this project.

CMake Error at sapp/CMakeLists.txt:624 (target_compile_definitions):
  Cannot specify compile definitions for target "debugtext-printf-sapp-ui"
  which is not built by this project.

CMake Error at sapp/CMakeLists.txt:636 (target_compile_definitions):
  Cannot specify compile definitions for target "debugtext-userfont-sapp-ui"
  which is not built by this project.

CMake Error at sapp/CMakeLists.txt:650 (target_compile_definitions):
  Cannot specify compile definitions for target "debugtext-context-sapp-ui"
  which is not built by this project.

CMake Error at sapp/CMakeLists.txt:662 (target_compile_definitions):
  Cannot specify compile definitions for target "debugtext-layers-sapp-ui"
  which is not built by this project.

CMake Error at sapp/CMakeLists.txt:702 (target_compile_definitions):
  Cannot specify compile definitions for target "fontstash-sapp-ui" which is
  not built by this project.

CMake Error at sapp/CMakeLists.txt:720 (target_compile_definitions):
  Cannot specify compile definitions for target "fontstash-layers-sapp-ui"
  which is not built by this project.

CMake Error at sapp/CMakeLists.txt:758 (target_compile_definitions):
  Cannot specify compile definitions for target "plmpeg-sapp-ui" which is not
  built by this project.

CMake Error at sapp/CMakeLists.txt:776 (target_compile_definitions):
  Cannot specify compile definitions for target "cgltf-sapp-ui" which is not
  built by this project.

CMake Error at sapp/CMakeLists.txt:794 (target_compile_definitions):
  Cannot specify compile definitions for target "loadpng-sapp-ui" which is
  not built by this project.

CMake Error at sapp/CMakeLists.txt:810 (target_compile_definitions):
  Cannot specify compile definitions for target "spine-simple-sapp-ui" which
  is not built by this project.

CMake Error at sapp/CMakeLists.txt:834 (target_compile_definitions):
  Cannot specify compile definitions for target "spine-skinsets-sapp-ui"
  which is not built by this project.

CMake Error at sapp/CMakeLists.txt:850 (target_compile_definitions):
  Cannot specify compile definitions for target "spine-layers-sapp-ui" which
  is not built by this project.

CMake Error at sapp/CMakeLists.txt:866 (target_compile_definitions):
  Cannot specify compile definitions for target "spine-contexts-sapp-ui"
  which is not built by this project.

CMake Error at sapp/CMakeLists.txt:882 (target_compile_definitions):
  Cannot specify compile definitions for target
  "spine-switch-skinsets-sapp-ui" which is not built by this project.
floooh commented 11 months ago

Hmm, I don't think it's the SDK version (I'm on macOS 14.1.2 with Xcode 15.0, and with that Xcode version it's using the 14.0 SDK, but if the SDK would be the problem the error messages would look differently.

What confuses me is that the cmake output after 'generating' looks wrong.

It should look like this:

=== building: sapp-metal-osx-xcode-debug
=== generating: sapp-metal-osx-xcode-debug
config file: /Users/floh/projects/sokol-samples/fips-files/configs/sapp-metal-osx-xcode-debug.yml
Preset CMake variables:

  CMAKE_BUILD_TYPE="Debug"
  CMAKE_OSX_SYSROOT="/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk"
  FIPS_AUTO_IMPORT="OFF"
  FIPS_CONFIG="sapp-metal-osx-xcode-debug"
  FIPS_LOCAL_BUILD="OFF"
  SOKOL_USE_METAL:BOOL="ON"
  USE_SOKOL_APP:BOOL="ON"

-- The C compiler identification is AppleClang 15.0.0.15000040

...but specifically this line:

cmake -G "Xcode" -DCMAKE_BUILD_TYPE=Debug -DFIPS_CONFIG=sapp-metal-osx-xcode-debug -DFIPS_LOCAL_BUILD=OFF -DUSE_SOKOL_APP=ON -DSOKOL_USE_METAL=ON -DFIPS_USE_CCACHE=OFF -DFIPS_AUTO_IMPORT=OFF -DCMAKE_OSX_SYSROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk -B/Users/ernesernesto/Documents/Repo/fips-build/sokol-samples/sapp-metal-osx-xcode-debug -H/Users/ernesernesto/Documents/Repo/sokol-samples

...looks like you're on an old fips version.

Can you try running ./fips update fips in the sokol-samples directory, and then:

./fips clean all
./fips set config sapp-metal-osx-make-debug
./fips gen
./fips build

(using sapp-metal-osx-make-debug instead of sapp-metal-osx-xcode-debug generates nicer console output)

ernesernesto commented 11 months ago

./fips update fips won't update the fips repo, pulling the latest fips repo does the trick

Thanks!

floooh commented 11 months ago

./fips update fips won't update the fips repo

That feature was added about 4 years ago ;)

https://github.com/floooh/fips/commit/3baadc9736e8ff1bcc6ff066fa7a98911ff39ca5